Sage 8.9 build fails on macOS Catalina

105 views
Skip to first unread message

Clayton Cafiero

unread,
Dec 21, 2019, 3:40:34 PM12/21/19
to sage-devel
macOS Catalina 10.15.2 (19C57)

Tried downloading and installing binary (sage-8.9-OSX_10.14.6-x86_64.dmg) but when run macOS complained bitterly about every file Sage tried to load when starting with

“python2.7” cannot be opened because the developer cannot be verified."


If I use System Preferences > Security & Privacy to allow python2.7, then another warning appears:


“libpython2.7.dylib” cannot be opened because the developer cannot be verified."


...I had patience for about the first 100 files (_locale.so, zlib.so, _collections.so, blah, blah, blah), then I threw in the towel and tried to build.


% xcodebuild -version                                       
    Xcode 11.2
    Build version 11B52

Downloaded Sage 8.9 source from mirror. Followed instructions in README.md, specifically

* __OS X:__
       * Make sure you have installed the most recent version
       of Xcode which you can install for free from the App Store.
       * You also need to install the "command line tools". When
       using OS X Mavericks, after installing Xcode, run
       `xcode-select --install` from a terminal window:
       Then click "Install" in the pop-up window.
       When using OS X Mountain Lion or earlier, you need to install the
       command line tools from Xcode: run Xcode; then from the File
       menu, choose "Preferences", then the "Downloads" tab, and then
       "Install" the Command Line Tools. You might also have Homebrew or
       a similar "Apple's missing package manager" system installed, with
       and libraries such gfortran, gmp, etc installed. (However, this
       is still experimental as of May 2019).

...

Extract the tarball

       tar zxvf sage-*.tar.gz

cd into the Sage directory and type make

       cd sage-*/
       make

This ran for quite a while and then failed, informing me to check /Users/myname/Downloads/sage-8.9/logs/pkgs/gfortran-7.4.0.log for more information. This file has over 500k lines and ends with

../../../src/libssp/gets-chk.c:59:13: error: storage class specified for parameter '__chk_fail'
 extern void __chk_fail (void) __attribute__((__noreturn__));
             ^~~~~~~~~~
../../../src/libssp/gets-chk.c:63:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 {
 ^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h:110:0,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:66,
                 from ../../../src/libssp/gets-chk.c:39:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:447:9: error: old-style parameter declarations in prototyped function definition
 int     getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
         ^~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:447:1: error: parameter name omitted
 int     getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
 ^~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:447:1: error: parameter name omitted
../../../src/libssp/gets-chk.c:92:1: error: expected '{' at end of input
 }
 ^
../../../src/libssp/gets-chk.c:92:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make[7]: *** [gets-chk.lo] Error 1
make[6]: *** [all] Error 2
make[5]: *** [all-target-libssp] Error 2
make[4]: *** [all] Error 2
************************************************************************************************
Error building gfortran-7.4.0
************************************************************************************************

Zip of this complete file is attached. 

Any suggestions? Please advise. TYVVM.




gfortran-7.4.0.log.zip

Dima Pasechnik

unread,
Dec 21, 2019, 4:22:40 PM12/21/19
to sage-devel
Probably the easiest would be to install Sage from conda:
http://doc.sagemath.org/html/en/installation/conda.html
(provided they already have it for MacOS 10.15 - they do for 10.14,
not sure about 10.15)

To build from source, you might be on your own, as Sage 8.9 did not
support 10.15 - after all it was released before MacOS 10.15 was
released.
You may have better luck with the latest beta, Sage 9.0.beta9.
In this case you might like to minimise the trouble by using tools
from Homebrew or a similar "missing package manager" - e.g.
then you'd already have gfortran available, you won't need to build it yourself.

HTH,
Dmitrii
> --
> 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/49affd15-db6a-4014-939f-3a01ae524a77%40googlegroups.com.

Clayton Cafiero

unread,
Dec 21, 2019, 4:34:17 PM12/21/19
to sage-devel
I'd like to be able to build packages for Sage (e.g., Conjecturing) and this doesn't work when installing with conda. I may try the beta, that's a good suggestion. Thanks.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.

Dima Pasechnik

unread,
Dec 21, 2019, 5:26:50 PM12/21/19
to sage-devel
On Sun, Dec 22, 2019 at 12:34 AM Clayton Cafiero <cbca...@gmail.com> wrote:
>
> I'd like to be able to build packages for Sage (e.g., Conjecturing) and this doesn't work when installing with conda.

one can build Sage in conda environment, as described in
https://git.sagemath.org/sage.git/diff?id=a596dec9240295b25cd1b48c4092d7eef4d60aed
on https://trac.sagemath.org/ticket/28745 (which is, admittedly, work
in progress).

Then one should able to build packages etc.
> 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/c54d1cd1-c3d4-48e4-a133-ceb2304e7506%40googlegroups.com.

Isuru Fernando

unread,
Dec 21, 2019, 5:44:11 PM12/21/19
to sage-devel
You can install gfortran from conda (conda install fortran-compiler) or homebrew (brew install gcc) and sage would pick it up.

Isuru

Clayton Cafiero

unread,
Dec 21, 2019, 6:34:05 PM12/21/19
to sage-devel
Oh great. Thanks to both. I'll give this a try.

David Roe

unread,
Dec 23, 2019, 9:04:08 AM12/23/19
to sage-devel

Hi all,

I have a new laptop running OS X 10.15 and haven't been able to successfully build Sage 9.0.beta9 on it.  I used Apple's Migration Assistant to move everything from my old laptop (which was running a much older version of OS X), so I wouldn't be surprised if there were some leftover settings that are interfering (my old versions of Sage actually still run).  In particular, I'm confused at why python 2 paths are showing up below when I thought sage-9.0.beta9 uses python3 by default.  Any suggestions for how to clean out my environment appropriately would be appreciated.  I've reinstalled xcode, the command line tools and a few brew packages (though I haven't uninstalled+reinstalled Homebrew completely).



The build fails on singular and matplotlib, running with 8 cores (I've tried previously building with just one core, but didn't on the most recent attempt).


$ make distclean

$ CC=clang CXX=clang++ FC=gfortran ./configure

$ MAKE="make -j8" make build


I've included the ends of the singular and matplotlib logs below, and posted config.log.




/bin/bash ../../../libtool  --tag=CXX   --mode=link clang++ -std=gnu++11 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -O2 -g  -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-threadsafe-statics -funroll-loops -fno-delete-null-pointer-checks -fno-rtti -Qunused-arguments   -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g  -F/Library/Frameworks -u _PyMac_Error Python.framework/Versions/2.7/Python    -module -export-dynamic -avoid-version -flat_namespace -weak_reference_mismatches weak -undefined dynamic_lookup  -L/Users/roed/sage/sage-9.0.beta9/local/lib -Wl,-rpath,/Users/roed/sage/sage-9.0.beta9/local/lib  -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-threadsafe-statics -funroll-loops -fno-delete-null-pointer-checks -Qunused-arguments  -rdynamic -flat_namespace -Wl,-bind_at_load -Wl,-undefined,dynamic_lookup -o pyobject.la -rpath /Users/roed/sage/sage-9.0.beta9/local/libexec/singular/MOD pyobject_la-pyobject.lo  -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g  -F/Library/Frameworks -u _PyMac_Error Python.framework/Versions/2.7/Python    -lreadline -lncurses -lmpfr
libtool: link: clang++ -std=gnu++11 -Wl,-undefined -Wl,dynamic_lookup -o .libs/pyobject.so -bundle  .libs/pyobject_la-pyobject.o   -L/Users/roed/sage/sage-9.0.beta9/local/lib -lreadline -lncurses -lmpfr  -O2 -g -g0 -O3 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -F/Library/Frameworks -Wl,-rpath -Wl,/Users/roed/sage/sage-9.0.beta9/local/lib -g0 -O3 -Wl,-bind_at_load -Wl,-undefined -Wl,dynamic_lookup -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -F/Library/Frameworks  
clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.6.sdk' [-Wmissing-sysroot]
ld: library not found for -lncurses
clang: error: linker command failed with exit code 1 (use -v to see invocation)




    BUILDING MATPLOTLIB
                matplotlib: yes [2.2.4]
                    python: yes [3.7.3 (default, Dec 23 2019, 00:02:12)  [Clang
                            11.0.0 (clang-1100.0.33.16)]]
                  platform: yes [darwin]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.16.1]
          install_requires: yes [handled by setuptools]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: yes [version 2.9.1]
                       png: no  [The C/C++ header for libpng (png.h) could not
                            be found.  You may need to install the development
                            package.]
                     qhull: yes [pkg-config information for 'libqhull' could not
                            be found. Using local copy.]

    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]

    OPTIONAL BACKEND EXTENSIONS
                    macosx: no  [skipping due to configuration]
                    qt5agg: no  [PySide2 not found; PyQt5 not found]
                    qt4agg: no  [PySide not found; PyQt4 not found]
                   gtk3agg: no  [Requires pygobject to be installed.]
                 gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
                    gtkagg: no  [skipping due to configuration]
                     tkagg: yes [installing; run-time loading from Python Tcl /
                            Tk]
                     wxagg: no  [skipping due to configuration]
                       gtk: no  [skipping due to configuration]
                       agg: yes [installing]
                     cairo: no  [cairocffi or pycairo not found]
                 windowing: no  [skipping due to configuration]

    OPTIONAL LATEX DEPENDENCIES
                    dvipng: yes [version 1.15]
               ghostscript: yes [version 9.19]
                     latex: yes [version 3.14159265]
                   pdftops: no

    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]

    ============================================================================
                            * The following required packages can not be built:
                            * png
                            * Try installing png with `brew install libpng` and
                            * pkg-config with `brew install pkg-config`
Cleaning up...
  Removing source in /private/var/folders/5z/00qw7rqx65qb3n_vn5_2ylxh0000gn/T/pip-req-build-1gyeljlc
Removed file:///Users/roed/sage/sage-9.0.beta9/local/var/tmp/sage/build/matplotlib-2.2.4.p0/src from build tracker '/private/var/folders/5z/00qw7rqx65qb3n_vn5_2ylxh0000gn/T/pip-req-tracker-teeref1m'
Removed build tracker '/private/var/folders/5z/00qw7rqx65qb3n_vn5_2ylxh0000gn/T/pip-req-tracker-teeref1m'
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/5z/00qw7rqx65qb3n_vn5_2ylxh0000gn/T/pip-req-build-1gyeljlc/
Exception information:
Traceback (most recent call last):
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 318, in run
    resolver.resolve(requirement_set)
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/resolve.py", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
    self.require_hashes
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 298, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 126, in prep_for_dist
    self.req.run_egg_info()
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 473, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Users/roed/sage/sage-9.0.beta9/local/lib/python3.7/site-packages/pip/_internal/utils/misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/5z/00qw7rqx65qb3n_vn5_2ylxh0000gn/T/pip-req-build-1gyeljlc/
Error: installing with pip3 failed



Here's some configuration information for my computer:


$ sw_vers 

ProductName: Mac OS X

ProductVersion: 10.15.2

BuildVersion: 19C57

$ xcodebuild -version

Xcode 11.3

Build version 11C29

$ xcode-select --version

xcode-select version 2373.

$ brew list

autoconf gperftools libunistring python@2

automake icu4c mpfr readline

cloc isl nettle sqlite

emacs libdvdcss ninja sshuttle

freetype libevent node unbound

gcc libffi openssl wget

gdbm libidn2 openssl@1.1 xz

gettext libmpc p11-kit yasm

git libpng pcre2

gmp libtasn1 postgresql

gnutls libtool python

$ env

TMPDIR=/var/folders/5z/00qw7rqx65qb3n_vn5_2ylxh0000gn/T/

XPC_FLAGS=0x0

LaunchInstanceID=FA121E45-B0D4-4A9B-AC7B-3DA0BBD3E265

TERM=xterm-256color

LANG=en_US.UTF-8

SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.HSZ3ucXzaN/Listeners

SECURITYSESSIONID=186a8

XPC_SERVICE_NAME=0

TERM_PROGRAM=Apple_Terminal

TERM_PROGRAM_VERSION=433

TERM_SESSION_ID=AB48F780-8DBD-4585-84FF-E98A2E468EF9

SHELL=/bin/zsh

HOME=/Users/roed

LOGNAME=roed

USER=roed

PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

SHLVL=1

PWD=/Users/roed

OLDPWD=/Users/roed

EDITOR=emacs

SAGE_INSTALL_CCACHE=yes

_=/usr/bin/env


Thanks!

David


--
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.

Dima Pasechnik

unread,
Dec 23, 2019, 10:10:35 AM12/23/19
to sage-devel
how about following the advice below and

brew install pkg-config libpng 



Dima Pasechnik

unread,
Dec 23, 2019, 10:13:23 AM12/23/19
to sage-devel
needless to say you might want to check your Homebrew, perhaps installing more things.

there are now positively reviewed tickets that allow you to use, R, openblas, and gsl from homebrew.

Samuel Lelievre

unread,
Dec 23, 2019, 6:22:22 PM12/23/19
to sage-devel
Dima, what is the "brew install" command to type
that will allow to build the least possible number
of Sage components when building from source?

David, the reference to "MacOSX10.6.sdk" in this line:


  clang: warning: no such sysroot directory:
  '/Developer/SDKs/MacOSX10.6.sdk'
  [-Wmissing-sysroot]

is a bit surprising and might have to do with your
migrating from an old version of macOS.

Apple has since changed the location where
SDKs are stored, and you would probably now
need the 10.15 SDK.

Maybe get rid of "/Developer" and any old XCode,
and install the latest Apple Command Line Tools
and XCode?

The Apple Command Line Tools can be installed
on the command line:

    $ xcode-select --install

If they are already installed, you can perform all
software updates in the command line with:

    $ software-update -ia

After upgrading, it's sometimes necessary to
accept the terms and conditions, which can
be done either by opening XCode and clicking
"Accept", or on the command line:

    $ sudo xcodebuild -licence accept

Regarding Homebrew, I think the `brew update`
command can deal with a migrated system,
it will detect the new macOS version and get
everything in order to work with that version.

You could also run

    $ brew doctor

which usually gives good hints in case XCode
or Apple Command Line Tools are outdated,
and tells you how to fix things.

Volker Braun

unread,
Dec 26, 2019, 1:28:00 PM12/26/19
to sage-devel
The OSX code signing is a major annoyance. We can't notarize our binaries since we rewrite paths to shared libraries on start. But that modifies the binary and invalidates any signature. I think we can clear the quarantine flag, so you'd only get the gatekeeper warning dialog once. Maybe one of you can try out if this works, just run

xattr -rd com.apple.quarantine /path/to/sage

to recursively clear the quarantine flag. After that sage should start fine...
Reply all
Reply to author
Forward
0 new messages