-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable cephes on FreeBSD and disable it on Cygwin #9543
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
I made an spkg at http://sage.math.washington.edu/home/mhansen/cephes-2.8.p0.spkg , but I get the following build error on Cygwin:
|
comment:3
The patches I added do not affect the build on Cygwin and I get exactly the same failure when building cephes-2.8.spkg (without any of my patches) on Cygwin. As I noted in my initial description, some of the cephes self-tests have been removed - whitebxf.c being one such. |
comment:4
Note that patches should now be applied by using Also, it would be really nice to make it more uniform: when possible, use the same patches both for Cygwin and for FreeBSD. |
comment:5
Replying to @jdemeyer:
Of course, though with Cygwin development halted for a bit that may not be as crucial. |
comment:6
With respect to this patch right now, according to Stephen Montgomery-Smith, "It caused build errors in other sub-packages." However, it does seem that cephes is needed for ccosh and who knows what else. |
comment:7
|
comment:8
I could not get pjeremy's patch to work for FreeBSD. After some searching, I found out that the problem is that his patch attempts to link the cephes functions with /lib/libm.so. This is something that is not meant to work for dynamic libraries. Once a dynamic library has been created, apparently there is no mechanism for merging it with other dynamic libraries. My solution was to slightly modify pjeremy's patch so that it creates a library libm_complex.so. The following patch should be applied to pjeremy's patch:
Then I put a script in $SAGE_ROOT/local/bin called "cc" which is a wrapper around the cc I really want to use:
|
comment:9
Replying to @sagetrac-stephen:
Are you sure about this? Couldn't you link Cephes's I'm willing to experiment with this if somebody could give me access to a FreeBSD box. |
comment:10
Replying to @jdemeyer:
No I am not sure about this. I received a private email from pjeremy, and did some more investigating. I discovered his patch doesn't work when I use the gcc46 compiler, which comes with the FreeBSD ports system, and is automatically invoked when you use fortran. Let me think some more about this. |
comment:11
Replying to @sagetrac-stephen:
It looks like I found the problem. I was building under a chroot'ed environment. I have discovered that after I perform the
I need to do
It looks like I only need to do this one time. Thanks for sticking with me on this guys. It looks like pjeremy's patch works, as is, with no changes. |
Reviewer: Stephen Montgomery-Smith |
Author: Peter Jeremy |
comment:12
Great, we just have to make a new spkg for this. Probably we should change to patches instead of entire files copied over, though these are all new files so it's not as big of an issue. |
comment:13
On #13806 this message came up. Relevant? Sorry that we still haven't made an spkg for this... |
comment:15
Spkg cleanup and only targetting FreeBSD at |
This comment has been minimized.
This comment has been minimized.
Changed author from Peter Jeremy to Peter Jeremy, Jean-Pierre Flori |
comment:16
Trivial error
Anyway, I'm trying this on Cygwin now. |
comment:17
Regarding testing the cephes library - I don't think it is fair to I have been working with the FreeBSD people to get the C99 math Nevertheless they still won't commit my programs until I have made some The only other package I know of that implements these functions well Another person is working on clog. The real part of clog(z) is The linux and OpenBSD libraries totally disregard the issues that give And for casinh and cacosh, even the mpc libraries are badly written in Anyway, all this is to say that you shouldn't hold the cephes libraries |
This comment has been minimized.
This comment has been minimized.
comment:18
Replying to @sagetrac-stephen:
I'm not sure anyone was suggesting doing this, just to at least provide such functions on Cygwin.
Hopefully that is all we are asking for! I'm going to change the description to point out that we really just want this. So... would you mind checking (at your convenience) whether this spkg indeed does the same thing as the patches from before and at your port? Then if it works on Cygwin (i.e., if Cygwin doesn't need it) we can merge this and simplify things slightly. |
comment:19
This new spkg failed to build rather early in the process:
|
Work Issues: typo in spkg-install, check_error not defined, complex_bsd.h |
comment:22
I've upped a new spkg which:
|
Changed keywords from none to cephes spkg cygwin freebsd |
Changed work issues from typo in spkg-install, check_error not defined, complex_bsd.h to none |
comment:23
This is fine from my point of view. If Stephen can check whether it performs as promised then we'll be set. |
comment:24
Replying to @kcrisman:
Agreed! Quite strangely, I don't have access to a FreeBSD box :) (although I vaguely remember trying to setup one once) |
comment:25
It still fails with the "complex_bsd.h" no rule message. I looked at Jeremy's patch, and it seemed to me that it did create math_bsd.h and complex_bsd.h. For example, it has lines like this:
This is a diff against a non-existent file, using the "-N" option to diff. The patch program creates a new file. Makefile then copies this from cephes-2.8/patches to where-ever it is needed. I would probably change the patch so that it is created directly in the directory where it is needed. |
comment:26
Oh, and the reason it worked so well with cygwin is because it didn't do anything. |
comment:27
Yes, understood. |
comment:28
Ok, I had a closer look at jeremy's patch and indeed the *_bsd.h file are needed and copied by the new makefile. I did not create them at first because the bunch of bash functions called on cygwin explicitely copied them whereas on bsd we just have make / make install calls which got me confused. I'll fix that tomorrow. |
Attachment: cephes-2.8.p0.diff.gz Spkg diff, for review only. |
comment:29
Everything is hopefully fine now. I've slightly modified Jeremy's approach to create (or rather modify as far as complex.h is concerned) the various headers while patching the src dir, rather than overwriting them with Makefile rules. |
comment:30
The latest version built and worked just fine. |
comment:31
And the spkg-install looks good to me. Assuming that you formed it correctly, this should be good to go in! |
comment:32
Sorry to be annoying but could you please document why we need cephes on FreeBSD? Preferably something should be mentioned in
which is very vague. |
comment:33
FreeBSD's math library does not have all the mathematics functions described in Sections 7.3 and 7.12 of the C99 standard:
Specifically many of the complex and long double functions are missing in FreeBSD. Cephes provides those functions that are missing from FreeBSD. The Makefiles have been modified so that it only adds those functions missing from the version of FreeBSD in which compilation is taking place. |
comment:34
New spkg with SPKG.txt including a note with what stephen posted. |
This comment has been minimized.
This comment has been minimized.
Spkg diff, for review only. |
comment:35
Attachment: cephes-2.8.p1.diff.gz |
Merged: sage-5.6.rc0 |
FreeBSD does not currently have a full C99 libm and therefore also needs cephes. The attached patch enables cephes on FreeBSD, enables error checking and renames the long double gamma() functions in line with C99. The latter two components are applicable to Cygwin as well as FreeBSD.
Spkg at http://boxen.math.washington.edu/home/jpflori/cephes-2.8.p1.spkg
Additional comments for perusal in the future:
A number of areas still need work - in particular some of the cephes self tests have been removed and some of the other self tests fail (at least some of the failures reflect bugs in cephes). Suitable self-tests and a spkg-check script need to be developed. It's possible mpfr could be used as a reference library.
CC: @mwhansen @jpflori
Component: porting: BSD
Keywords: cephes spkg cygwin freebsd
Author: Peter Jeremy, Jean-Pierre Flori
Reviewer: Stephen Montgomery-Smith, Karl-Dieter Crisman
Merged: sage-5.6.rc0
Issue created by migration from https://trac.sagemath.org/ticket/9543
The text was updated successfully, but these errors were encountered: