Closed mkoeppe closed 4 years ago
Description changed:
---
+++
@@ -1 +1,10 @@
+This broke `homebrew-macos-minimal`, `gfortran`:
+```
+Checking LIBRARY_PATH variable... contains current directory
+configure: error:
+*** LIBRARY_PATH shouldn't contain the current directory when
+*** building gcc. Please change the environment variable
+*** and run configure again.
+```
+
Description changed:
---
+++
@@ -1,4 +1,4 @@
-This broke `homebrew-macos-minimal`, `gfortran`:
+#29562 broke `homebrew-macos-minimal`, `gfortran`:
Checking LIBRARY_PATH variable... contains current directory
Dependencies: #29562
Description changed:
---
+++
@@ -1,4 +1,4 @@
-#29562 broke `homebrew-macos-minimal`, `gfortran`:
+#29562 broke the `gfortran` build in `homebrew-macos-minimal` (https://github.com/mkoeppe/sage/runs/624417033):
Checking LIBRARY_PATH variable... contains current directory
Author: Matthias Koeppe
New commits:
e74c6c2 | .homebrew-build-env: Set CPATH, LIBRARY_PATH instead of CPPFLAGS, LDFLAGS |
3371465 | Merge branch 't/29562/_homebrew_build_env__set_cpath_instead_of_cppflags' into t/29607/another_fixup_for__homebrew_build_env_setting_cpath__library_path |
c1002b6 | .homebrew-build-env: Do not accidentally put the current directory in CPATH, LIBRARY_PATH |
Tests at https://github.com/mkoeppe/sage/actions/runs/89771836
This works for me, with or without gfortran
. With just #29562, gfortran
does indeed fail. This branch doesn't apply cleanly on top of #29562, I think, but I don't know if that matters.
Reviewer: John Palmieri
Thanks! Actually this is fast-forward from #29562
Seems to need more work, to fix a problem with singular on homebrew.
Branch pushed to git repo; I updated commit sha1. New commits:
f593e66 | src/bin/sage-env: Add to beginning, not end of CPATH, LIBRARY_PATH |
Description changed:
---
+++
@@ -8,3 +8,6 @@
*** and run configure again.
+
+#29562 also broke singular
on homebrew
, leading to doctest errors and segfaults
+
Description changed:
---
+++
@@ -9,5 +9,37 @@
-#29562 also broke singular
on homebrew
, leading to doctest errors and segfaults
+#29562 also broke singular
on homebrew
, leading to doctest errors and segfaults such as this one:
+``` +File "src/sage/combinat/posets/posets.py", line 3816, in sage.combinat.posets.posets.FinitePoset.coxeter_smith_form +Failed example:
cc'ing some of our singular experts
But Sage doesn't use the system's Singular. I don't understand.
No, but some dependencies of Singular are coming from the system.
Do you know which packages? I haven't seen these doctest failures, but I could install more homebrew packages to try to reproduce them.
The error can be reproduced in the standard homebrew environment set up by tox -e local-homebrew-macos-standard -- ptest
.
I am now trying with EXTRA_CONFIGURE_ARGS="--with-mp=mpir" tox -e local-homebrew-macos-standard -- ptest
to disable use of homebrew's GMP.
Any help with debugging this would be very welcome!
The failures can be seen, for example, in https://github.com/mkoeppe/sage/runs/628776278
Looks like failures in the pexpect interface to singular if I read those logs correctly and I haven't missed anything. This make readline
the number one suspect amongst singular
's dependencies (ntl
, gmp
, cddlib
, flint
).
I'll try tox -e local-homebrew-macos-standard -- ptest
. In my current setup (in which I don't see any failures), the hints at the end of running ./configure
only suggest installing cmake
, which implies (?) that I have everything in homebrew-macos-standard
already. (The comment in tox.ini
says "Install all known system packages equivalent to standard packages that have spkg-configure.m4", but it must actually require both an spkg-configure.m4 and distros/homebrew.txt, right?)
Replying to @jhpalmieri:
I'll try
tox -e local-homebrew-macos-standard -- ptest
. In my current setup (in which I don't see any failures), the hints at the end of running./configure
only suggest installingcmake
, which implies (?) that I have everything inhomebrew-macos-standard
already.
Note that tox installs its own copy of homebrew, independent of the one in /usr/local.
(The comment in
tox.ini
says "Install all known system packages equivalent to standard packages that have spkg-configure.m4", but it must actually require both an spkg-configure.m4 and distros/homebrew.txt, right?)
Right, with this clarification it describes correctly the behavior for the docker-....
environments. For local-homebrew
, however, the implementation cheats a little bit (fixing this is one of the tasks of #29146). See line 323 of tox.ini
to see how the system package list is determined:
homebrew-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/homebrew.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
So it really just installs every package listed in any homebrew.txt
Replying to @kiwifb:
Looks like failures in the pexpect interface to singular if I read those logs correctly and I haven't missed anything. This make
readline
the number one suspect amongstsingular
's dependencies (ntl
,gmp
,cddlib
,flint
).
Thanks, yes, that should be the top suspect!
Replying to @jhpalmieri:
In my current setup (in which I don't see any failures), the hints at the end of running
./configure
only suggest installingcmake
, which implies (?) that I have everything inhomebrew-macos-standard
already.
Yes, I think so
Replying to @mkoeppe:
The error can be reproduced in the standard homebrew environment set up by
tox -e local-homebrew-macos-standard -- ptest
.
The error also shows in local-homebrew-macos-python2-standard
.
On the other hand: local-homebrew-macos-python3_pythonorg-minimal
(https://github.com/mkoeppe/sage/runs/628776310) and local-homebrew-macos-python2-minimal
are clean.
Replying to @mkoeppe:
I am now trying with
EXTRA_CONFIGURE_ARGS="--with-mp=mpir" tox -e local-homebrew-macos-standard -- ptest
to disable use of homebrew's GMP.
This build does not have the failure
EXTRA_CONFIGURE_ARGS="--without-system-readline" tox -e local-homebrew-macos-standard -- ptest
has the failure
Hum, I guess that could have predicted on the fact that only singular displayed the failure. Still, there is something fishy happening in sage/interface/singular.py
. Incidentally, after scanning the singular libraries, it appears that mpfr
is a direct dependency of singular
- not just through flint
. I certainly need to update the dependency list in Gentoo.
I'm testing EXTRA_CONFIGURE_ARGS="--without-system-mpfr" tox -e local-homebrew-macos-standard -- ptest
at the moment
Replying to @mkoeppe:
I'm testing
EXTRA_CONFIGURE_ARGS="--without-system-mpfr" tox -e local-homebrew-macos-standard -- ptest
at the moment
... which has the failure.
Here's a self-contained interaction with Singular in the bad build:
$ Singular
SINGULAR / Development
A Computer Algebra System for Polynomial Computations / version 4.1.1
0<
by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \ Feb 2018
FB Mathematik der Universitaet, D-67653 Kaiserslautern \
> ring sage7=0,(x,y),dp;
> def sage8=9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 +9*x^6*y^4 + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 -9*x^12*y^3 - 18*x^13*y^2 + 9*x^16;
> def sage9=factorize(sage8);
Singular : signal 11 (v: 4112):
current line:>>def sage9=factorize(sage8);<<
Segment fault/Bus error occurred (r:1588272268)
please inform the authors
trying to restart...
Self-contained command line test:
echo "ring sage7=0,(x,y),dp; factorize(9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 +9*x^6*y^4 + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 -9*x^12*y^3 - 18*x^13*y^2 + 9*x^16); " | .tox/local-homebrew-macos-standard/local/bin/Singular | fgrep -q '[2]:'
I can't even get Sage to build with tox -e local-homebrew-macos-standard -- ptest
with this branch or without: the Sage library fails with
In file included from build/cythonized/sage/tests/stl_vector.cpp:663:
./sage/libs/ntl/ntlwrap.h:5:10: fatal error: 'NTL/ZZ.h' file not found
#include <NTL/ZZ.h>
Sage builds fine and passes tests (except for those at #29493) with make ptestlong
.
Could you attach a log of the tox run?
I also see a testsuite segfault for FLINT
[flint-2.5.2.p5] make[3]: *** [../build/nmod_poly_mat/test/t-concat_vertical_RUN] Segmentation fault: 11
Replying to @jhpalmieri:
I can't even get Sage to build with
tox -e local-homebrew-macos-standard -- ptest
with this branch or without: the Sage library fails withIn file included from build/cythonized/sage/tests/stl_vector.cpp:663: ./sage/libs/ntl/ntlwrap.h:5:10: fatal error: 'NTL/ZZ.h' file not found #include <NTL/ZZ.h>
Sage builds fine and passes tests (except for those at #29493) with
make ptestlong
.
Do you happen to have NTL from homebrew installed in /usr/local
(brew info ntl
)?
Replying to @mkoeppe:
Replying to @jhpalmieri:
I can't even get Sage to build with
tox -e local-homebrew-macos-standard -- ptest
with this branch or without: the Sage library fails withIn file included from build/cythonized/sage/tests/stl_vector.cpp:663: ./sage/libs/ntl/ntlwrap.h:5:10: fatal error: 'NTL/ZZ.h' file not found #include <NTL/ZZ.h>
Sage builds fine and passes tests (except for those at #29493) with
make ptestlong
.Do you happen to have NTL from homebrew installed in
/usr/local
(brew info ntl
)?
Yes, I do.
Could you attach a log of the tox run?
Which file do you want? One of the ones in logs
?
-rw-r--r-- 1 palmieri staff 275651 Apr 30 12:17 config.log
-rw-r--r-- 1 palmieri staff 103409 Apr 30 13:17 install.log
-rw-r--r-- 1 palmieri staff 914 Apr 30 10:26 local-homebrew-macos-standard-0.log
-rw-r--r-- 1 palmieri staff 268 Apr 30 10:26 local-homebrew-macos-standard-1.log
drwxr-xr-x 153 palmieri staff 4896 Apr 30 13:08 pkgs
Or should I just uninstall homebrew's ntl?
Just the terminal output if you still have it, otherwise install.log
please
There is a problem with /usr/local
interaction. FLINT's configure script is severely broken (that's not exactly news, but...): it puts /usr/local/include/
in as explicit defaults and stuff there can override what we have in $SAGE_LOCAL.
For flint, adding --with-gmp=$SAGE_LOCAL
is fine even if gmp is not there and is found from the system.
Replying to @isuruf:
For flint, adding
--with-gmp=$SAGE_LOCAL
is fine even if gmp is not there and is found from the system.
Yes, this is the fix that I am using now
Replying to @jhpalmieri:
Replying to @mkoeppe:
Replying to @jhpalmieri:
I can't even get Sage to build with
tox -e local-homebrew-macos-standard -- ptest
with this branch or without: the Sage library fails withIn file included from build/cythonized/sage/tests/stl_vector.cpp:663: ./sage/libs/ntl/ntlwrap.h:5:10: fatal error: 'NTL/ZZ.h' file not found #include <NTL/ZZ.h>
Sage builds fine and passes tests (except for those at #29493) with
make ptestlong
.Do you happen to have NTL from homebrew installed in
/usr/local
(brew info ntl
)?
From your log:
[sagelib-9.1.rc2] g++ -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -L/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/tox/sage-9.1.rc2/.tox/local-homebrew-macos-standard/local/lib -Wl,-rpath,/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/tox/sage-9.1.rc2/.tox/local-homebrew-macos-standard/local/lib build/temp.macosx-10.15-x86_64-3.7/build/cythonized/sage/symbolic/substitution_map.o -L/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/tox/sage-9.1.rc2/.tox/local-homebrew-macos-standard/local/lib -L/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/tox/sage-9.1.rc2/.tox/local-homebrew-macos-standard/homebrew/lib -L/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/tox/sage-9.1.rc2/.tox/local-homebrew-macos-standard/homebrew/opt/openssl@1.1/lib -L/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/tox/sage-9.1.rc2/.tox/local-homebrew-macos-standard/homebrew/opt/sqlite/lib -lgmp -lpynac -lstdc++ -o build/lib.macosx-10.15-x86_64-3.7/sage/symbolic/substitution_map.cpython-37m-darwin.so
2400 [sagelib-9.1.rc2] In file included from build/cythonized/sage/tests/stl_vector.cpp:663:
2401 [sagelib-9.1.rc2] ./sage/libs/ntl/ntlwrap.h:5:10: fatal error: 'NTL/ZZ.h' file not found
2402 [sagelib-9.1.rc2] #include <NTL/ZZ.h>
2403 [sagelib-9.1.rc2] ^~~~~~~~~~
This is an interesting variant of the failure mode of #29000, #29448 - where ./configure
finds a library but then the package needing it does not. In this case, Homebrew's NTL in /usr/local
is found by ./configure
. But we compile Python modules using g++ -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
, where the -isysroot
disables the use of /usr/local
.
Branch pushed to git repo; I updated commit sha1. New commits:
0b5d19e | build/pkgs/flint/spkg-install.in: Always pass --with-{gmp,mpfr,ntl}=$SAGE_LOCAL to get rid of /usr/local |
Replying to @mkoeppe:
Replying to @isuruf:
For flint, adding
--with-gmp=$SAGE_LOCAL
is fine even if gmp is not there and is found from the system.Yes, this is the fix that I am using now
... in the commit above.
Probably the spkg-install
of other packages with the same build system as FLINT need to be changed in the same way.
29562 broke the
gfortran
build inhomebrew-macos-minimal
(https://github.com/mkoeppe/sage/runs/624417033):29562 also broke
flint
/singular
onhomebrew
when conflicting versions of libraries are in/usr/local
, leading to doctest errors and segfaults such as this one:Depends on #29562
CC: @jhpalmieri @dimpase @slel @kiwifb @isuruf @antonio-rojas @mwageringel @thierry-FreeBSD @vbraun
Component: build
Author: Matthias Koeppe
Branch/Commit:
fcfbc10
Reviewer: John Palmieri, Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/29607