Opened 8 years ago

Closed 8 years ago

#16751 closed defect (fixed)

Singular build fail OSX109

Reported by: Volker Braun Owned by:
Priority: critical Milestone: sage-6.3
Component: packages: standard Keywords: FLINT MacOS
Cc: Jan Keitel, François Bissey, Jeroen Demeyer Merged in:
Authors: Volker Braun Reviewers: Jan Keitel, Leif Leonhardy
Report Upstream: N/A Work issues:
Branch: fa75ea6 (Commits, GitHub, GitLab) Commit: fa75ea6c03a9bcf856d5f3cf9af6eab4fcd939d2
Dependencies: Stopgaps:

Status badges

Description


Attachments (2)

conftest.c (2.5 KB) - added by Leif Leonhardy 8 years ago.
Failing configure test (checking for FLINT).
conftest.i (127.0 KB) - added by Jan Keitel 8 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 8 years ago by Volker Braun

Component: PLEASE CHANGEpackages: standard
Priority: majorcritical
Type: PLEASE CHANGEdefect

comment:2 Changed 8 years ago by Jan Keitel

Cc: Jan Keitel added

comment:3 Changed 8 years ago by Volker Braun

Branch: u/vbraun/singular_build_fail_osx109

comment:4 Changed 8 years ago by Volker Braun

Cc: François Bissey added
Commit: d5b8fa660cb0aafef769c257a575e547bbb1b618

There was a --without-flint in the libfac configuration, that doesn't sound right.


New commits:

d5b8fa6remove stray without-flint

comment:5 Changed 8 years ago by Jan Keitel

Hi Volker,

that alone doesn't work yet. Wasn't Francois on the right track? The Singular config.log keeps saying

/Users/kabel/sage/sage/local/include/flint/flint.h:74:2: error: #error GMP 5.0.0 or MPIR 2.6.0 or later are required
/Users/kabel/sage/sage/local/include/flint/flint.h:78:2: error: #error MPFR 3.0.0 or later is required

The whole (new) config.log file is here: http://wwwth.mpp.mpg.de/members/jkeitel/config2.log

comment:6 Changed 8 years ago by git

Commit: d5b8fa660cb0aafef769c257a575e547bbb1b618fa75ea6c03a9bcf856d5f3cf9af6eab4fcd939d2

Branch pushed to git repo; I updated commit sha1. New commits:

fa75ea6Do not add /usr/local/{lib,include} to paths

comment:7 Changed 8 years ago by Volker Braun

Status: newneeds_review

Yes, looking at the configure its pretty clear that this is bad. New commit should fix it. This is gone in Singular-4 as far as I can tell.

comment:8 Changed 8 years ago by Leif Leonhardy

Reposting here, since apparently G00gle doesn't like it (meanwhile tried twice):

Jan Keitel wrote:
> Okay, found them:
>
> gmp: 4.3.1
> mpfr: 2.4.1
> mpc: 0.8.1

These shouldn't get picked up (in this case, only the header files matter anyway),
since $SAGE_LOCAL/{include,lib} come first in the -I and -L directives:

configure:8898: gcc -o conftest -O2 -g  -fPIC -I/Users/kabel/sage/sage/local/include/flint -I/Users/kabel/sage/sage/local/include -I/Users/kabel/sage/sage/local/include -I/Users/kabel/sage/sage/local/include  -I/usr/local/include -L/Users/kabel/sage/sage/local/lib -L/Users/kabel/sage/sage/local/lib -L/usr/local/lib conftest.c -lntl -lgmp -lreadline -ltermcap -lm -L/Users/kabel/sage/sage/local/lib -lflint -lmpfr -lmpir >&5
In file included from /Users/kabel/sage/sage/local/include/flint/fmpz.h:38:0,
                 from conftest.c:94:
/Users/kabel/sage/sage/local/include/flint/flint.h:74:2: error: #error GMP 5.0.0 or MPIR 2.6.0 or later are required
/Users/kabel/sage/sage/local/include/flint/flint.h:78:2: error: #error MPFR 3.0.0 or later is required
configure:8898: $? = 1


It would be interesting to see GCC's verbose output (in particular, the list of
include folders) as well as the preprocessed source of that conftest.c, but I
guess it's not that easy to add the appropriate flags there.


> Is there a way to force the sage installation not to use the globally
> installed versions?

It shouldn't at all.  You could move or remove them temporarily though.

comment:9 Changed 8 years ago by Jan Keitel

Well, if there's any other information that I can provide, please let me know. In the meantime I've pulled the updated branch and am compiling again. So far it's looking good.

comment:10 in reply to:  9 Changed 8 years ago by Leif Leonhardy

Replying to jkeitel:

Well, if there's any other information that I can provide, please let me know. In the meantime I've pulled the updated branch and am compiling again. So far it's looking good.

Provided Volker's patch solves the issue, probably not worth the effort.

Otherwise I'd say it's a compiler bug, if we can trust what's in config.log (i.e., the shown command line leading to the failure).

comment:11 Changed 8 years ago by Jan Keitel

Yep, it works. Thank you!

I'd like to give this a positive review, but I don't think I'm the right guy to do that, because I can't tell whether it breaks something else. Francois, leif? ;-)

comment:12 in reply to:  11 ; Changed 8 years ago by Leif Leonhardy

Authors: Volker Braun
Reviewers: Jan Keitel, Leif Leonhardy
Status: needs_reviewpositive_review

Replying to jkeitel:

I'd like to give this a positive review, but I don't think I'm the right guy to do that, because I can't tell whether it breaks something else. Francois, leif? ;-)

In theory at least, the patch could of course break things on other systems (where pieces not shipped with Sage are located in /usr/local/, and in case that's not searched by default), but there are easy work-arounds for that case, and I think that'd be for another ticket if someone gets hit. (Probably the buildbots will also tell.)

I still don't get why apparently /usr/local/include/gmp.h gets included although -I${SAGE_LOCAL}/include precedes -I/usr/local/include, according to config.log...

Changed 8 years ago by Leif Leonhardy

Attachment: conftest.c added

Failing configure test (checking for FLINT).

comment:13 in reply to:  12 Changed 8 years ago by Leif Leonhardy

Replying to leif:

I still don't get why apparently /usr/local/include/gmp.h gets included although -I${SAGE_LOCAL}/include precedes -I/usr/local/include, according to config.log...

Jan, you may try whether

gcc -o conftest -O2 -g  -fPIC -I/Users/kabel/sage/sage/local/include/flint -I/Users/kabel/sage/sage/local/include -I/Users/kabel/sage/sage/local/include -I/Users/kabel/sage/sage/local/include  -I/usr/local/include -L/Users/kabel/sage/sage/local/lib -L/Users/kabel/sage/sage/local/lib  -L/usr/local/lib conftest.c -lntl -lomalloc_ndebug -lomalloc -lsingfac -lsingcf -lgmp -lreadline -ltermcap -lm   -L/Users/kabel/sage/sage/local/lib -lflint -lmpfr -lmpir

or simply

gcc -I/Users/kabel/sage/sage/local/include/flint -I/Users/kabel/sage/sage/local/include -I/usr/local/include -c conftest.c

also fails for you, in a Sage subshell (./sage --sh).

I've attached the corresponding conftest.c.

comment:14 Changed 8 years ago by Jan Keitel

Yep, they both do:

(sage-sh) kabel@Aloiss-MacBook-Air-2:sage$ gcc -o conftest -O2 -g  -fPIC -I/Users/kabel/sage/sage/local/include/flint -I/Users/kabel/sage/sage/local/include -I/Users/kabel/sage/sage/local/include -I/Users/kabel/sage/sage/local/include  -I/usr/local/include -L/Users/kabel/sage/sage/local/lib -L/Users/kabel/sage/sage/local/lib  -L/usr/local/lib conftest.c -lntl -lomalloc_ndebug -lomalloc -lsingfac -lsingcf -lgmp -lreadline -ltermcap -lm   -L/Users/kabel/sage/sage/local/lib -lflint -lmpfr -lmpir
In file included from /Users/kabel/sage/sage/local/include/flint/fmpz.h:38:0,
                 from conftest.c:99:
/Users/kabel/sage/sage/local/include/flint/flint.h:74:2: error: #error GMP 5.0.0 or MPIR 2.6.0 or later are required
/Users/kabel/sage/sage/local/include/flint/flint.h:78:2: error: #error MPFR 3.0.0 or later is required
kabel@Aloiss-MacBook-Air-2:sage$ gcc -I/Users/kabel/sage/sage/local/include/flint -I/Users/kabel/sage/sage/local/include -I/usr/local/include -c conftest.c
In file included from /Users/kabel/sage/sage/local/include/flint/fmpz.h:38:0,
                 from conftest.c:99:
/Users/kabel/sage/sage/local/include/flint/flint.h:74:2: error: #error GMP 5.0.0 or MPIR 2.6.0 or later are required
/Users/kabel/sage/sage/local/include/flint/flint.h:78:2: error: #error MPFR 3.0.0 or later is required

comment:15 in reply to:  14 Changed 8 years ago by Leif Leonhardy

Replying to jkeitel:

Yep, they both do.

Ouch. Could you paste the output of

gcc -v -save-temps -I/Users/kabel/sage/sage/local/include/flint -I/Users/kabel/sage/sage/local/include -I/usr/local/include -c conftest.c

and attach the generated conftest.i?

Changed 8 years ago by Jan Keitel

Attachment: conftest.i added

comment:16 Changed 8 years ago by Jan Keitel

Sure:

(sage-sh) kabel@Aloiss-MacBook-Air-2:sage$ gcc -v -save-temps -I/Users/kabel/sage/sage/local/include/flint -I/Users/kabel/sage/sage/local/include -I/usr/local/include -c conftest.c
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-apple-darwin13.3.0
Configured with: ../src/configure --prefix=/Users/kabel/sage/sage/local --with-local-prefix=/Users/kabel/sage/sage/local --with-gmp=/Users/kabel/sage/sage/local --with-mpfr=/Users/kabel/sage/sage/local --with-mpc=/Users/kabel/sage/sage/local --with-system-zlib --disable-multilib --disable-nls  
Thread model: posix
gcc version 4.7.3 (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9' '-v' '-save-temps' '-I' '/Users/kabel/sage/sage/local/include/flint' '-I' '/Users/kabel/sage/sage/local/include' '-I' '/usr/local/include' '-c' '-mtune=core2'
 /Users/kabel/sage/sage/local/libexec/gcc/x86_64-apple-darwin13.3.0/4.7.3/cc1 -E -quiet -v -I /Users/kabel/sage/sage/local/include/flint -I /Users/kabel/sage/sage/local/include -I /usr/local/include -D__DYNAMIC__ conftest.c -fPIC -mmacosx-version-min=10.9 -mtune=core2 -fpch-preprocess -o conftest.i
ignoring nonexistent directory "/Users/kabel/sage/sage/local/lib/gcc/x86_64-apple-darwin13.3.0/4.7.3/../../../../x86_64-apple-darwin13.3.0/include"
ignoring duplicate directory "/Users/kabel/sage/sage/local/include"
  as it is a non-system directory that duplicates a system directory
ignoring duplicate directory "/Users/kabel/sage/sage/local/include"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
 /Users/kabel/sage/sage/local/include/flint
 /usr/local/include
 /Users/kabel/sage/sage/local/lib/gcc/x86_64-apple-darwin13.3.0/4.7.3/include
 /Users/kabel/sage/sage/local/include
 /Users/kabel/sage/sage/local/lib/gcc/x86_64-apple-darwin13.3.0/4.7.3/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
In file included from /Users/kabel/sage/sage/local/include/flint/fmpz.h:38:0,
                 from conftest.c:99:
/Users/kabel/sage/sage/local/include/flint/flint.h:74:2: error: #error GMP 5.0.0 or MPIR 2.6.0 or later are required
/Users/kabel/sage/sage/local/include/flint/flint.h:78:2: error: #error MPFR 3.0.0 or later is required

comment:17 Changed 8 years ago by Leif Leonhardy

Cc: Jeroen Demeyer added
Keywords: FLINT MacOS added

Ah ok, thanks.

So it's pretty specific to "Sage's" GCC, which treats $SAGE_LOCAL/include as a system include folder, but not /usr/local/include.

One day we should [instead] fix the GCC spkg then... :P

comment:18 Changed 8 years ago by François Bissey

I like it when people figure things while I am sleeping :)

comment:19 Changed 8 years ago by Volker Braun

Branch: u/vbraun/singular_build_fail_osx109fa75ea6c03a9bcf856d5f3cf9af6eab4fcd939d2
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.