MacOS 10.15.1: gfortran does not compile in sage-8.9

89 views
Skip to first unread message

Rob Gross

unread,
Oct 30, 2019, 4:57:03 PM10/30/19
to sage-devel
Hi,

I tried both upgrading to sage-8.9 and compiling from scratch, and both times gfortran would not compile.  I cannot attach the entire log file without an error.  I attach the first few lines and the last few lines, and of course I can e-mail anyone with as much information as needed.

Here is the first error message in the log file:

libtool: compile:  /Users/gross/sage-8.9/local/var/tmp/sage/build/gfortran-7.4.0/gcc-build/./gcc/xgcc -B/Users/gross/sage-8.9/local/var/tmp/sage/build/gfortran-7.4.0/gcc-build/./gcc/ -B/Users/gross/sage-8.9/local/x86_64-apple-darwin19.0.0/bin/ -B/Users/gross/sage-8.9/local/x86_64-apple-darwin19.0.0/lib/ -isystem /Users/gross/sage-8.9/local/x86_64-apple-darwin19.0.0/include -isystem /Users/gross/sage-8.9/local/x86_64-apple-darwin19.0.0/sys-include -DHAVE_CONFIG_H -I. -I../../../src/libssp -Wall -g -O2 -MT gets-chk.lo -MD -MP -MF .deps/gets-chk.Tpo -c ../../../src/libssp/gets-chk.c  -fno-common -DPIC -o .libs/gets-chk.o
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: In function 'getiopolicy_np':
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:34: error: expected declaration specifiers before '__OSX_AVAILABLE_STARTING'
 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:449:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__OSX_AVAILABLE_STARTING'
 int     setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);

Any ideas?

Thanks.--Rob

start-of-log.txt
end-of-log.txt

John H Palmieri

unread,
Oct 30, 2019, 5:36:31 PM10/30/19
to sage-devel
I also had problems with Sage's gfortran package with OS X Catalina. I instead installed homebrew (https://brew.sh), and used homebrew to install their gcc package. This should install gfortran, which Sage will find as part of its configure process, thereby bypassing Sage's gfortran package. One benefit: Sage will never try to install gfortran again, which saves a good chunk of time. (Installing homebrew's gcc will also create /usr/local/bin/gcc-9.2.0 but not /usr/local/bin/gcc. It is important not to have /usr/local/bin/gcc, since Sage wants to use the pre-existing /usr/bin/gcc.)

  John

Dima Pasechnik

unread,
Oct 30, 2019, 6:04:50 PM10/30/19
to sage-devel
I think at the moment most people who tried cannot build Sage on MacOS
10.15 with Xcode 11.1 (the latest one).
Regarding gfortran, perhaps one can try installing Homebrew and use
gfortram from there.

If you just need a working Sage, your best bet on MacOS 10.15 might be
the one from conda-forge.
https://anaconda.org/conda-forge/sage
> --
> 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/b557aad7-51f6-469b-9dac-bac679275400%40googlegroups.com.

François Bissey

unread,
Oct 30, 2019, 6:21:58 PM10/30/19
to sage-...@googlegroups.com
I suspect gcc/gfortran shipped with sage is too old to build on 10.15.
Upgrading to 9.x may help.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq3LG%2Bj6eWxrYtJ7K%3Dc__PTtC%3DkNyWX9J8ywNY-u%3DPeugA%40mail.gmail.com.

John H Palmieri

unread,
Oct 30, 2019, 6:40:34 PM10/30/19
to sage-devel
I tried building several version of gfortran by hand on 10.15, but I couldn't succeed, whereas I could with 10.14. I didn't try just upgrading Sage's gfortran/gcc package to 9.x.
>> To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/b557aad7-51f6-469b-9dac-bac679275400%40googlegroups.com.
>
> --
> 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-...@googlegroups.com.

David Joyner

unread,
Oct 31, 2019, 6:31:23 PM10/31/19
to sage-devel
On Wed, Oct 30, 2019 at 6:04 PM Dima Pasechnik <dim...@gmail.com> wrote:
I think at the moment most people who tried cannot build Sage on MacOS
10.15 with Xcode 11.1 (the latest one).
Regarding gfortran, perhaps one can try installing Homebrew and use
gfortram from there.

If you just need a working Sage, your best bet on MacOS 10.15 might be
the one from conda-forge.
https://anaconda.org/conda-forge/sage


This doesn't seem to work for me either.
anaconda installed but
conda install -c conda-forge sage
(and friends) returned lots of "Solving environment: failed ..."
lines.

 


On Wed, Oct 30, 2019 at 10:57 PM Rob Gross <robert.g...@gmail.com> wrote:
>
> Hi,
>
> I tried both upgrading to sage-8.9 and compiling from scratch, and both times gfortran would not compile.  I cannot attach the entire log file without an error.  I attach the first few lines and the last few lines, and of course I can e-mail anyone with as much information as needed.
>
> Here is the first error message in the log file:
>
> libtool: compile:  /Users/gross/sage-8.9/local/var/tmp/sage/build/gfortran-7.4.0/gcc-build/./gcc/xgcc -B/Users/gross/sage-8.9/local/var/tmp/sage/build/gfortran-7.4.0/gcc-build/./gcc/ -B/Users/gross/sage-8.9/local/x86_64-apple-darwin19.0.0/bin/ -B/Users/gross/sage-8.9/local/x86_64-apple-darwin19.0.0/lib/ -isystem /Users/gross/sage-8.9/local/x86_64-apple-darwin19.0.0/include -isystem /Users/gross/sage-8.9/local/x86_64-apple-darwin19.0.0/sys-include -DHAVE_CONFIG_H -I. -I../../../src/libssp -Wall -g -O2 -MT gets-chk.lo -MD -MP -MF .deps/gets-chk.Tpo -c ../../../src/libssp/gets-chk.c  -fno-common -DPIC -o .libs/gets-chk.o
> 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: In function 'getiopolicy_np':
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h:443:34: error: expected declaration specifiers before '__OSX_AVAILABLE_STARTING'
>  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:449:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__OSX_AVAILABLE_STARTING'
>  int     setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
>
> Any ideas?
>
> Thanks.--Rob
>
> --
> 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/b557aad7-51f6-469b-9dac-bac679275400%40googlegroups.com.

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

Isuru Fernando

unread,
Oct 31, 2019, 9:58:28 PM10/31/19
to sage-devel
Try installing sage to a new environment instead of an existing one.

David Joyner

unread,
Nov 1, 2019, 7:07:30 AM11/1/19
to sage-devel
On Thu, Oct 31, 2019 at 9:58 PM Isuru Fernando <isu...@gmail.com> wrote:
Try installing sage to a new environment instead of an existing one.


This seemed to work, at least it installed the sage scripts in
/Volumes/Transcend/wooster/computer-algebra/anaconda3/envs/mac1015-env/bin
(the environment is called mac1015-env). The sage script doesn't run
since I don't know where to set SAGE_ROOT. I don't see any binaries.
I think I managed to activate the new environment since it modified the
.zshrc file but adding that directory to the PATH.
 

Isuru Fernando

unread,
Nov 1, 2019, 1:25:17 PM11/1/19
to sage-devel
You need to activate the sage environment which would set SAGE_ROOT.

`conda activate mac1015-env`

Isuru

David Joyner

unread,
Nov 1, 2019, 2:39:55 PM11/1/19
to sage-devel
On Fri, Nov 1, 2019 at 1:25 PM Isuru Fernando <isu...@gmail.com> wrote:
You need to activate the sage environment which would set SAGE_ROOT.

`conda activate mac1015-env`


This gives me an error with the zsh shell not being initialized, while

conda init zsh

lists things like

no change     /Users/wdj/.zshrc
No action taken.

I also tried switching to the bash shell, but that did not work
either.

 

Isuru Fernando

unread,
Nov 1, 2019, 2:51:59 PM11/1/19
to sage-devel
Can you do `source /Volumes/Transcend/wooster/computer-algebra/anaconda3/bin/activate -p /Volumes/Transcend/wooster/computer-algebra/anaconda3/envs/mac1015-env` ?

David Joyner

unread,
Nov 1, 2019, 3:00:53 PM11/1/19
to sage-devel
On Fri, Nov 1, 2019 at 2:51 PM Isuru Fernando <isu...@gmail.com> wrote:
Can you do `source /Volumes/Transcend/wooster/computer-algebra/anaconda3/bin/activate -p /Volumes/Transcend/wooster/computer-algebra/anaconda3/envs/mac1015-env` ?

Without the -p, yes. As given, it returns 

activate does not accept more than one argument.

 

Volker Braun

unread,
Nov 2, 2019, 5:05:27 PM11/2/19
to sage-devel
Xcode 11 contains once again broken system headers so compiling any version of gcc/gfortran fails. This is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90835

Xcode 11 is now also pushed to Mojave so OSX 10.14 is now broken as well. 

Presumably you can work around it by manually installing Xcode 10 (and the corresponding commandline tools)

I've made https://trac.sagemath.org/ticket/28691 to track this issue.
Reply all
Reply to author
Forward
0 new messages