Sage 9.2 fails to build because of cysignals on macos 10.15.7

99 views
Skip to first unread message

Pierre Vanhove

unread,
Dec 14, 2020, 5:07:11 AM12/14/20
to sage-devel
Hello,

Sage 9.2 fails to build because of cysignals on macos 10.15.7

Error installing package cysignals-1.10.2

I had been able to build Sage 9.2 from source when it came out. 

Then I tried to install the optional package sirocco, the -i optional failed, so I used -p and tried to rebuild sage from source. Now, I'm getting this compilation failure.

What should I do?

Thank you for your help,
Pierre Vanhove
cysignals-1.10.2.log

John H Palmieri

unread,
Dec 14, 2020, 7:02:49 PM12/14/20
to sage-devel
Maybe something is going wrong with using the homebrew version of Python — some conflict somewhere — so could you try

make distclean
./configure --with-system-python3=no
make

(I'm having different problems with the system python: see my posts about MACOSX_DEPLOYMENT_TARGET.)

--
John

John H Palmieri

unread,
Dec 14, 2020, 11:19:44 PM12/14/20
to sage-devel
Actually, I can't recommend having Sage build its own Python. I get failures with several packages (gmpy2, markupsafe, cython) of this sort:

Successfully built gmpy2
...
ERROR: gmpy2-2.1.0b5-cp38-cp38-macosx_10_9_x86_64.whl is not a supported wheel on this platform.

Dima Pasechnik

unread,
Dec 15, 2020, 4:30:36 AM12/15/20
to sage-devel
the error is

gcc -bundle -undefined dynamic_lookup -L/usr/local/lib -isysroot
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
-L/Users/pierre/local/sage-9.2/local/lib
-Wl,-rpath,/Users/pierre/local/sage-9.2/local/lib
-Wp,-U_FORTIFY_SOURCE
build/temp.macosx-10.15-x86_64-3.9/build/src/cysignals/signals.o
-L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib
-L/usr/local/opt/sqlite/lib -o
build/lib.macosx-10.15-x86_64-3.9/cysignals/signals.cpython-39-darwin.so
-lpari -pthread
ld: illegal thread local variable reference to regular symbol
_PARI_SIGINT_block for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)

so this is something to do with multi- vs single-threaded Pari, I guess.
It seems that Pari is built single-threaded, but cysignals does not know it.
> --
> 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/ec07ba9b-8b4e-4ed9-918a-5b2286b3bd91n%40googlegroups.com.

Pierre Vanhove

unread,
Dec 15, 2020, 7:40:17 AM12/15/20
to sage-devel
hi

Since no compilation was succesfull I tried sage-9.3-beta4.

My homebrew version is 

% brew  --version
Homebrew 2.6.2
Homebrew/homebrew-core (git revision 9d75f; last commit 2020-12-15)
Homebrew/homebrew-cask (git revision 152f2; last commit 2020-12-15)

 Despite doing 

source /Users/pierre/local/sage-9.3.beta4/.homebrew-build-env

then

./configure --enable-sirocco --enable-jupyterlab_widgets

still does not find the installed package. In particular ntl which fails to compile.

What should be done now?

I'm attaching the config.log 

thanks, Pierre

config.log

Dima Pasechnik

unread,
Dec 15, 2020, 7:46:14 AM12/15/20
to sage-devel
You have weird stuff in /usr/local, e.g. what's

/usr/local/include/stdio.h

I see in your log? No wonder it can break things.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/f380bdc2-be50-421b-9600-f37ade174d8fn%40googlegroups.com.

Pierre Vanhove

unread,
Dec 15, 2020, 7:47:21 AM12/15/20
to sage-...@googlegroups.com
no idea ? Should I remove this? I don’t know how this came in.


========================================================






Dima Pasechnik

unread,
Dec 15, 2020, 7:55:04 AM12/15/20
to sage-devel
On Tue, Dec 15, 2020 at 12:47 PM Pierre Vanhove
<vanhove...@gmail.com> wrote:
>
> no idea ? Should I remove this? I don’t know how this came in.

This is only a symptom of something going on wrongly.

Do you by any chance try to use Brew's gcc and g++?
What is the output of

ls -l /usr/local/include/stdio.h
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/AF3DDC38-B279-4EEC-96DB-30A092E46C80%40gmail.com.

Pierre Vanhove

unread,
Dec 15, 2020, 8:01:22 AM12/15/20
to sage-...@googlegroups.com
Hi 

Do you by any chance try to use Brew's gcc and g++?

no as I remember.

What is the output of

ls -l /usr/local/include/stdio.h

% ls -l /usr/local/include/stdio.h
lrwxr-xr-x 1 root admin 71 déc 14 17:11 /usr/local/include/stdio.h -> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h


This looks like the standard MacOS distrib. 
I will try conda ….

thanks,
Pierre

Dima Pasechnik

unread,
Dec 15, 2020, 8:15:05 AM12/15/20
to sage-devel
On Tue, Dec 15, 2020 at 1:01 PM Pierre Vanhove <vanhove...@gmail.com> wrote:
>
> Hi
>
> Do you by any chance try to use Brew's gcc and g++?
>
>
> no as I remember.
>
> What is the output of
>
> ls -l /usr/local/include/stdio.h
>
>
> % ls -l /usr/local/include/stdio.h
> lrwxr-xr-x 1 root admin 71 déc 14 17:11 /usr/local/include/stdio.h -> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h
>
>
> This looks like the standard MacOS distrib.

yes, but on my system such a symbolic link does not exist.

What did one do yesterday just after 17:00 on the machine?
Updated Homebrew? Installed macOS command line tools?
A hacker attack? :-)

Your config.log is full of warnings like this:

configure:6160: checking whether we are cross compiling
configure:6168: gcc -o conftest conftest.c >&5
In file included from conftest.c:11:
In file included from /usr/local/include/stdio.h:64:
/usr/local/include/_stdio.h:93:16: warning: pointer is missing a
nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
[-Wnullability-completeness]
unsigned char *_base;
^
/usr/local/include/_stdio.h:93:16: note: insert '_Nullable' if the
pointer may be null
unsigned char *_base;
^
_Nullable
/usr/local/include/_stdio.h:93:16: note: insert '_Nonnull' if the
pointer should never be null
unsigned char *_base;

^

_Nonnull

/usr/local/include/_stdio.h:138:32: warning: pointer is missing a
nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
[-Wnullability-completeness]

int (* _Nullable _read) (void *, char *, int);

^

/usr/local/include/_stdio.h:138:32: note: insert '_Nullable' if the
pointer may be null

int (* _Nullable _read) (void *, char *, int);

^

_Nullable



It was always iffy whether just command line tools, without full
XCode, suffice to build Sage.
On my machine I have clang from the full-blown XCode

configure:5984: gcc --version >&5
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

But you have it in Command Lines Tools:

configure:5989: gcc --version >&5
Apple clang version 12.0.0 (clang-1200.0.32.27)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

You may try installing the latest XCode
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/455E66E2-7804-48B1-BF1B-71088B952C8F%40gmail.com.

Pierre Vanhove

unread,
Dec 15, 2020, 8:23:52 AM12/15/20
to sage-...@googlegroups.com
hi



What did one do yesterday just after 17:00 on the machine?
Updated Homebrew? Installed macOS command line tools?

yes I updated homebrew, but with a bad internet connection and the connection broke. I had to redo it.

But curiously, I have deleted the sage-9.2 folder downloaded a sage-9.3-beta4 and then worked from the new folder.

I will see if using the backup from my time machine solves the problem by going back in time.

Now that they have put sirocco on cocacl, I will work with that. And I will leave most of the sage coding to Andrey Novoseltsev then since locally I cannot work...

best, Pierre

Dima Pasechnik

unread,
Dec 15, 2020, 8:43:28 AM12/15/20
to sage-devel
On Tue, Dec 15, 2020 at 1:23 PM Pierre Vanhove <vanhove...@gmail.com> wrote:
>
> hi
>
>
> What did one do yesterday just after 17:00 on the machine?
> Updated Homebrew? Installed macOS command line tools?
>
>
> yes I updated homebrew, but with a bad internet connection and the connection broke. I had to redo it.
>
> But curiously, I have deleted the sage-9.2 folder downloaded a sage-9.3-beta4 and then worked from the new folder.
>
> I will see if using the backup from my time machine solves the problem by going back in time.

I'd suggest to install the full XCode. The fact that homebrew
apparently created that link indicates
that not all is well; I'd also erase the whole /usr/local and
reinstall Homebrew from scratch,
after XCode is installed.

macOS, Homebrew, XCode are moving targets, it's hard to keep up with them.

>
> Now that they have put sirocco on cocacl, I will work with that. And I will leave most of the sage coding to Andrey Novoseltsev then since locally I cannot work...
>
> best, Pierre
>
> ========================================================
> Pierre Vanhove (vanhove...@gmail.com) | web: http://sites.google.com/site/vanhovepierre/
>
>
>
>
>
>
> --
> 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/95B792F4-B444-4DBB-8E4B-2846A020C683%40gmail.com.

Zachary Scherr

unread,
Dec 15, 2020, 1:57:40 PM12/15/20
to sage-devel
Have you tried running "brew doctor"? Homebrew should complain loudly about all of the header files in /usr/local/include which could cause conflicts.  For example, if I touch stdio.h in my /usr/local/include and then I run brew doctor I get:

"Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/stdio.h"

I would start with running brew doctor and trying to fix the recommendations there.

Pierre Vanhove

unread,
Dec 15, 2020, 3:24:12 PM12/15/20
to sage-devel
hi

I have cleanup my /usr/local  - reinstalled a fresh brew  and Xcode.
I have run ./configure in sage-9.3-beta4 that complained about missing homebrew package. I have installed them.
% brew list
aom fribidi harfbuzz libheif little-cms2 pandoc srt
arb gcc icu4c libidn2 lzo pcre suite-sparse
bdw-gc gd igraph liblqr metis pcre2 tbb
boost gdbm ilmbase libmpc mpfi pixman tesseract
c-ares gettext imagemagick libogg mpfr pkg-config texinfo
cairo ghostscript isl libomp nauty ppl theora
cmake giflib jemalloc libpng nettle python@3.9 tox
coreutils glib jpeg libsamplerate nghttp2 r unbound
dav1d glpk lame libsndfile ninja rav1e webp
docbook gmp leptonica libsoxr ntl readline x264
docbook-xsl gnu-getopt libass libtasn1 openblas rtmpdump x265
ffmpeg gnutls libatomic_ops libtiff opencore-amr rubberband xmlto
flac gobject-introspection libbluray libtool openexr sdl2 xvid
flint gpatch libde265 libunistring openjpeg shared-mime-info xz
fontconfig graphite2 libev libvidstab openssl@1.1 snappy zeromq
freetype gsl libevent libvorbis opus speex
frei0r guile libffi libvpx p11-kit sqlite

my homebrew setup is clean 

% brew doctor
Your system is ready to brew.

then   boostrapping, sourcing brew environnement and rerun configure in sage, I still get the message

   $ brew install pandoc ffmpeg imagemagick texinfo


Pierre

Zachary Scherr

unread,
Dec 15, 2020, 3:31:23 PM12/15/20
to sage-devel
You can safely ignore that message.  I think there is some ongoing work being done on changing how sage handles recommended packages and that message is a byproduct.  If it's really bothering you then you can just type:

make _recommended

and I think that message should disappear.

Pierre Vanhove

unread,
Dec 16, 2020, 3:17:14 AM12/16/20
to sage-devel
Hi 

thanks for the tips.  So I have recompiled sage successfully 

touch "/Users/pierre/local/sage-9.3.beta4/local/var/lib/sage/installed/sagelib-9.3.beta4"
"/Users/pierre/local/sage-9.3.beta4/build/bin/sage-starts"

Testing that Sage starts...
[2020-12-16 01:46:39] SageMath version 9.3.beta4, Release Date: 2020-12-14
This looks like the first time you are running Sage.
Cleaning up, do not interrupt this.
Done cleaning.
Yes, Sage starts.

In a terminal window, I started sage.   Did 1+1 test. I quit sage, and launch it again, and sage crashes

ImportError: dlopen(/Users/pierre/local/lib/python3.9/site-packages/sage/matrix/matrix_mpolynomial_dense.cpython-39-darwin.so, 2): Library not loaded: /Users/pierre/local/lib/libSingular-4.1.1.dylib
  Referenced from: /Users/pierre/local/lib/python3.9/site-packages/sage/matrix/matrix_mpolynomial_dense.cpython-39-darwin.so
  Reason: image not found

I'm sending a crash report.

Pierre


Pierre Vanhove

unread,
Dec 16, 2020, 3:22:47 AM12/16/20
to sage-devel
Here is the crash report
Sage_crash_report.txt

Dima Pasechnik

unread,
Dec 16, 2020, 4:01:26 AM12/16/20
to sage-devel
It is not usual that the 1st run went ok, but the next one crashed on startup.
Could you try to move away ~/.sage/ and see if it helps?
(it tends to accumulate incompatible stuff and during updates cause
all sorts of issues)

If it doesn't help:

Could you provide the output of

otool -L /Users/pierre/local/lib/libSingular-4.1.1.dylib
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/f8466fc7-c21d-457e-8204-03c9ddc9fcd4n%40googlegroups.com.

Pierre Vanhove

unread,
Dec 16, 2020, 4:34:32 AM12/16/20
to sage-devel
Hi - so I've tried to recompile (after distclean etc. ) now I get another compilation error

Error installing package markupsafe-1.1.1
markupsafe-1.1.1.log

Dima Pasechnik

unread,
Dec 16, 2020, 4:51:19 AM12/16/20
to sage-devel
On Wed, Dec 16, 2020 at 9:34 AM Pierre Vanhove <vanhove...@gmail.com> wrote:
>
> Hi - so I've tried to recompile (after distclean etc. ) now I get another compilation error
>
> Error installing package markupsafe-1.1.1

You seem to be trying with the same semi-broken Command Line Tools as
we discussed yesterday.
Could you please consider installing the latest XCode?

these errors get weirder and weirder.

Package 'markupsafe' is currently not installed
No legacy uninstaller found for 'markupsafe'; nothing to do
Installing markupsafe-1.1.1
Error: Tried to use Sage's Python which was not yet installed.
If this was called from an spkg-install script for another
package you should add $(PYTHON) as a dependency in
build/pkgs/<pkg>/dependencies
Error: could not determine package name

It says in effect that you need to add $(PYTHON) to
build/pkgs/markupsafe/dependencies

- but it is already there as far as I can see.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/2286952c-9ffb-4f68-9b60-9487fd7275cbn%40googlegroups.com.

Pierre Vanhove

unread,
Dec 16, 2020, 5:27:42 AM12/16/20
to sage-devel
Hi 
>You seem to be trying with the same semi-broken Command Line Tools as
>we discussed yesterday.
>Could you please consider installing the latest XCode?

I have done this and my version of Xcode is Version 12.3 (12C33)
and 
% xcode-select -v
xcode-select version 2373.

Now, compilation just fails at 

[setuptools_scm-4.1.2] Error installing package setuptools_scm-4.1.2

Pierre

Dima Pasechnik

unread,
Dec 16, 2020, 6:15:49 AM12/16/20
to sage-devel
On Wed, Dec 16, 2020 at 10:27 AM Pierre Vanhove
<vanhove...@gmail.com> wrote:
>
> Hi
> >You seem to be trying with the same semi-broken Command Line Tools as
> >we discussed yesterday.
> >Could you please consider installing the latest XCode?
>
> I have done this and my version of Xcode is Version 12.3 (12C33)
> and
> % xcode-select -v
> xcode-select version 2373.
>

Have you ungraded Homebrew and run

brew doctor

afterwards?

? I suspect you still have that dodgy headers in /usr/local/include
that we discussed yesterday.

(check out the top level config.log for this)
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/7381f769-dc73-46f0-9fbf-a57091267298n%40googlegroups.com.

Pierre Vanhove

unread,
Dec 16, 2020, 7:15:18 AM12/16/20
to sage-devel
no - brew doctor was clean.

Now it gives me this 


% brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/pierre/local/bin/givaro-config
  /Users/pierre/local/bin/fflas-ffpack-config
  /Users/pierre/local/bin/linbox-config
  /Users/pierre/local/bin/ecl-config

these files are produced by sage compilation. 


Dima Pasechnik

unread,
Dec 16, 2020, 7:27:19 AM12/16/20
to sage-devel
On Wed, Dec 16, 2020 at 12:15 PM Pierre Vanhove
<vanhove...@gmail.com> wrote:
>
> no - brew doctor was clean.
>
> Now it gives me this
>
>
> % brew doctor
> Please note that these warnings are just used to help the Homebrew maintainers
> with debugging if you file an issue. If everything you use Homebrew for is
> working fine: please don't worry or file an issue; just ignore this. Thanks!
>
> Warning: "config" scripts exist outside your system or Homebrew directories.
> `./configure` scripts often look for *-config scripts to determine if
> software packages are installed, and which additional flags to use when
> compiling and linking.
>
> Having additional scripts in your path can confuse software installed via
> Homebrew if the config script overrides a system or Homebrew-provided
> script of the same name. We found the following "config" scripts:
> /Users/pierre/local/bin/givaro-config
> /Users/pierre/local/bin/fflas-ffpack-config
> /Users/pierre/local/bin/linbox-config
> /Users/pierre/local/bin/ecl-config
>
> these files are produced by sage compilation.

This is wrong.
This can only happen if you've set some environment variable used
internally by Sage to some (wrong) values.

these files belong to <sage-root>/local/bin
and not to $HOME/local/bin

What is the output of

set | grep SAGE

(normally it's just empty, or perhaps has SAGE_CHECK there, but no more)

Are you by any chance trying to build Sage inside its shell, e.g.
./sage -sh
or
./sage -buildsh

?
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/fdd912d8-cb61-44d9-b20e-b1159b55127an%40googlegroups.com.

Pierre Vanhove

unread,
Dec 16, 2020, 3:19:08 PM12/16/20
to sage-devel
Hi 

everybody. Got sage running ok this time.

% sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.3.beta4, Release Date: 2020-12-14               │
│ Using Python 3.9.1. Type "help()" for help.                        │


I essentially had to 1) remove my /usr/local,  2) install a fresh brew,   3) install the latest Xcode and Command line, and 4) cleanup my .zshrc 

This is surprising as for the previous version of sage this worked relatively smoothly.

Thanks for all the tips - I have learned a lot.

Pierre
Reply all
Reply to author
Forward
0 new messages