Beta 12 not building (Homebrew singular issue?)

138 views
Skip to first unread message

Zachary Scherr

unread,
Sep 9, 2020, 9:49:36 PM9/9/20
to sage-devel
Hi All,

   I tried to build the most recent beta version of sage and it would appear that it's taking issue with the fact that I have singular installed on my Mac 10.15.6 through homebrew.  Homebrew's version is singular 4.1.3p2 and when I try to build sage I get errors like:

"In file included from build/cythonized/sage/rings/polynomial/plural.cpp:684:
/usr/local/include/singular/Singular/libsingular.h:15:10: fatal error: 'polys/shiftop.h' file not found
#include "polys/shiftop.h"

   So even though make builds Singular 4.1.1p2.p0, it tries to use my newer singular homebrew libraries.  If I brew uninstall singular then sage builds without any problems.

   I've included config.log, and a dropbox link to the build log (it is 8M) https://www.dropbox.com/s/dr9qnf18wh4ft51/sagelib-9.2.beta12.log?dl=0
config.log

Matthias Koeppe

unread,
Sep 9, 2020, 10:57:18 PM9/9/20
to sage-devel
On Wednesday, September 9, 2020 at 6:49:36 PM UTC-7, Zachary Scherr wrote:
   I tried to build the most recent beta version of sage and it would appear that it's taking issue with the fact that I have singular installed on my Mac 10.15.6 through homebrew.  Homebrew's version is singular 4.1.3p2 and when I try to build sage I get errors like:

"In file included from build/cythonized/sage/rings/polynomial/plural.cpp:684:
/usr/local/include/singular/Singular/libsingular.h:15:10: fatal error: 'polys/shiftop.h' file not found
#include "polys/shiftop.h"


Could you run the following please:
./sage -sh -c 'pkg-config --cflags singular'


Matthias Koeppe

unread,
Sep 9, 2020, 11:04:16 PM9/9/20
to sage-devel
Also could you post the output of "env"? 
(Do you use .homebrew-build-env to set environment variables?)

Zachary Scherr

unread,
Sep 9, 2020, 11:52:07 PM9/9/20
to sage-devel
Hi Matthias,

   Running ./sage -sh -c 'pkg-config --cflags singular' with home-brew's singular installed gives:

-DSING_NDEBUG -DOM_NDEBUG -DSING_NDEBUG -DOM_NDEBUG -DSING_NDEBUG -DOM_NDEBUG -DSING_NDEBUG -DOM_NDEBUG -I/Users/zscherr/sage/develop/local/include/singular

my env is a mess, but I do source .homebrew-build-env, here is what I think are the relevant variables:

PATH=/usr/local/opt/gettext/bin:/Users/zscherr/perl5/bin:/usr/local/sbin:/usr/local/Cellar/modules/4.5.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin
PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/openblas/lib/pkgconfig:/usr/local/lib/pkgconfig:
LIBRARY_PATH=/usr/local/opt/gcc@9/lib/gcc/9:/usr/local/opt/readline/lib:/usr/local/lib
CPATH=/usr/local/opt/readline/include:/usr/local/include
ACLOCAL_PATH=/usr/local/opt/gettext/share/aclocal:

As expected, if I brew uninstall singular then running ./sage -sh -c 'pkg-config --cflags singular' gives

-DSING_NDEBUG -DOM_NDEBUG -DSING_NDEBUG -DOM_NDEBUG -DSING_NDEBUG -DOM_NDEBUG -DSING_NDEBUG -DOM_NDEBUG -I/Users/zscherr/sage/develop/local/include/singular

I was able to build beta 11 so I can try to git bisect if you think that would be useful.

Matthias Koeppe

unread,
Sep 10, 2020, 12:44:28 AM9/10/20
to sage-devel
You don't happen to set CFLAGS or CPPFLAGS by any chance? 

The problem in the failing compile command from your log is that "-I/Users/zscherr/sage/develop/local/include" appears after "-I/usr/local/include". It should appear before. 

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I./sage/cpython -I/Users/zscherr/sage/develop/local/include/singular -I/Users/zscherr/sage/develop/build/pkgs/sagelib/src -I/Users/zscherr/sage/develop/build/pkgs/sagelib/src/sage/ext -I/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I/Users/zscherr/sage/develop/local/lib/python3.8/site-packages/numpy/core/include -Ibuild/cythonized -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/zscherr/sage/develop/local/include -I/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c build/cythonized/sage/algebras/letterplace/free_algebra_element_letterplace.cpp -o build/temp.macosx-10.15-x86_64-3.8/build/cythonized/sage/algebras/letterplace/free_algebra_element_letterplace.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -DSING_NDEBUG -DOM_NDEBUG -I/Users/zscherr/sage/develop/local/include/singular -std=c++11

Zachary Scherr

unread,
Sep 10, 2020, 12:58:02 PM9/10/20
to sage-devel
Nope, my workflow for checking out the latest beta was just:

./bootstrap
source .homebrew-build-env
./configure
make -j8 V=0 build

Obviously this is not a big deal since I can just brew uninstall singular and then it builds successfully, but I've been wanting to contribute to sage development so I'm going to take this as an opportunity to try to track down what's going on. 

Matthias Koeppe

unread,
Sep 10, 2020, 1:07:27 PM9/10/20
to sage-devel
On Thursday, September 10, 2020 at 9:58:02 AM UTC-7, Zachary Scherr wrote:

Obviously this is not a big deal since I can just brew uninstall singular and then it builds successfully, but I've been wanting to contribute to sage development so I'm going to take this as an opportunity to try to track down what's going on. 


Yes, this is much appreciated. So far I can't reproduce the error here (after installing homebrew's singular), unfortunately. 

Could you post install.log please?

Zachary Scherr

unread,
Sep 10, 2020, 4:20:37 PM9/10/20
to sage-devel
Hi Matthias,

   It's attached to this message.

Best,
Zach
install.log

Dima Pasechnik

unread,
Sep 11, 2020, 5:11:23 AM9/11/20
to sage-devel
[sagelib-9.2.beta12] installing. Log file: /Users/zscherr/sage/develop/logs/pkgs/sagelib-9.2.beta12.log
  [sagelib-9.2.beta12] error installing, exit status 1. End of log file:
  [sagelib-9.2.beta12]   /usr/local/include/singular/Singular/libsingular.h:15:10: fatal error: 'polys/shiftop.h' file not found
  [sagelib-9.2.beta12]   #include "polys/shiftop.h"
  [sagelib-9.2.beta12]            ^~~~~~~~~~~~~~~~~

the include path looks funny with its "singular/Singular/"
I don't know what brew does here, maybe it drops "singular/" bit?


--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/3c9f01e9-ded6-43bd-8861-301d1e97a06an%40googlegroups.com.

Dima Pasechnik

unread,
Sep 11, 2020, 5:45:00 AM9/11/20
to sage-devel
On Fri, Sep 11, 2020 at 10:11 AM Dima Pasechnik <dim...@gmail.com> wrote:
[sagelib-9.2.beta12] installing. Log file: /Users/zscherr/sage/develop/logs/pkgs/sagelib-9.2.beta12.log
  [sagelib-9.2.beta12] error installing, exit status 1. End of log file:
  [sagelib-9.2.beta12]   /usr/local/include/singular/Singular/libsingular.h:15:10: fatal error: 'polys/shiftop.h' file not found
  [sagelib-9.2.beta12]   #include "polys/shiftop.h"
  [sagelib-9.2.beta12]            ^~~~~~~~~~~~~~~~~

the include path looks funny with its "singular/Singular/"
I don't know what brew does here, maybe it drops "singular/" bit?

no, in fact it's all fine, it's just include flags that need to be adjusted.
Note that you still have -I/Users/zscherr/sage/develop/local/include/singular
in the failing gcc call, which seems to indicate you didn't use


- of if you did, you didn't run

make singular-clean

./bootstrap && ./configure

after putting that file
in build/pkgs/singular/




Try

CXXFLAGS="$CXXFLAGS -I//usr/local/include/singular/

Zachary Scherr

unread,
Sep 11, 2020, 10:10:21 AM9/11/20
to sage-devel
Hi Dima,

   Thanks! Downloading spkg-configure.m4 allowed me to build successfully.

Best,
Zach

Dima Pasechnik

unread,
Sep 11, 2020, 10:33:01 AM9/11/20
to sage-devel
I think there is at least one place elsewhere in the code that assumes that Singular is installed in $SAGE_LOCAL

at least I got an error of this sort while trying to build Sage's docs in this configuration.
I'll look into it once back at the keyboard

Dima Pasechnik

unread,
Sep 11, 2020, 1:15:17 PM9/11/20
to sage-devel
On Fri, Sep 11, 2020 at 3:32 PM Dima Pasechnik <dim...@gmail.com> wrote:
I think there is at least one place elsewhere in the code that assumes that Singular is installed in $SAGE_LOCAL

at least I got an error of this sort while trying to build Sage's docs in this configuration.
I'll look into it once back at the keyboard


The fix needs some programming - specifically, the code in singular.pyx calls dlopen on SINGULAR_SO,
which is computed by _get_shared_lib_filename dynamically in env.py, and assuming that it is in SAGE_LOCAL.
So this probably can instead by handled using cython_aliases from the same module (which does compute
all the needed info for Singular, it seems).
Or by fixing _get_shared_lib_filename so that it also searches elsewhere.

Dima Pasechnik

unread,
Sep 11, 2020, 6:47:23 PM9/11/20
to sage-devel
as an experiment, I hardcoded the necessary paths for using Homebrew's Singular here:
(the part for  src/sage/libs/singular/singular.pxd is probably not needed, but anyway)

running tests now.

Zachary Scherr

unread,
Oct 7, 2020, 10:33:32 AM10/7/20
to sage-devel
I was just curious as to what the status of this issue is, and if there was anything I could do to help with review.  I can build rc0 using Dima's suggested spkg-configure.m4 fix, but I can't build it otherwise unless I brew unlink singular first. 
Message has been deleted

Matthias Koeppe

unread,
Oct 8, 2020, 12:13:31 PM10/8/20
to sage-devel
I have opened https://trac.sagemath.org/ticket/30745 for this and the other error with ecl, which I think have a common cause. 

Zachary Scherr

unread,
Oct 8, 2020, 1:45:11 PM10/8/20
to sage-devel
Thank you Matthias.  I think I've learned my lesson about over installing homebrew packages.  I previously installed every single homebrew version of all Sage SPKGs in case I could speed up build time.  At some point I'd like to learn more about the sage build process so that I can contribute in fixing my own issues.

Samuel Lelievre

unread,
Oct 8, 2020, 2:42:11 PM10/8/20
to sage-devel
2020-10-08 17:45:11 UTC, Zachary Scherr:
>
> I think I've learned my lesson about over installing homebrew packages.
> I previously installed every single homebrew version of all Sage SPKGs
> in case I could speed up build time.

I did the same and got bitten too. Packages that gave me trouble:
arb, flint, gap, gcc, glpk, ntl, singular.

The gcc and glpk troubles are over and I brew installed them back,
as well as ntl which behaves ok for me. Currently uninstalled here:
arb, flint, gap, singular, but maybe I could reinstall some, not sure.

My go-to link for such questions is querying Trac for tickets whose
summary contains 'brew':


or browsing and searching sage-devel and sage-release.

Do we need a meta-ticket for Homebrew package problems?

> At some point I'd like to learn more about the sage build process
> so that I can contribute in fixing my own issues.

Great idea. I'm trying to learn more myself and enjoying it.
What questions do you have?

Reply all
Reply to author
Forward
0 new messages