Sage cannot find gcc on OS X

158 views
Skip to first unread message

Michael Frey

unread,
Jan 10, 2017, 12:12:18 AM1/10/17
to sage-support
I am running the Sage app on OS X.  My code makes a call to cython.  When I execute the code I get an error:

gcc -fno-strict-aliasing -I/Users/buildslave-sage/slave/binary_pkg/build/source/SageMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidma/local/var/tmp/sage/build/python2-2.7.10.p3/include -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -I/Applications/SageMath-7.4.app/Contents/Resources/sage/local/include -I/Applications/SageMath-7.4.app/Contents/Resources/sage/local/include/python2.7 -I/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python2.7/site-packages/numpy/core/include -I/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python2.7/site-packages -I/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/ext -I/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/python2.7/site-packages/cysignals -I/Users/michael/.sage/temp/Michaels-MBP.freystuff.com/34036 -I/Applications/SageMath-7.4.app/Contents/Resources/sage/local/include/python2.7 -c _Users_michael__sage_temp_Michaels_MBP_freystuff_com_34036_tmp_81FKRa_spyx_0.c -o build/temp.macosx-10.9-x86_64-2.7/_Users_michael__sage_temp_Michaels_MBP_freystuff_com_34036_tmp_81FKRa_spyx_0.o -w -O2

In file included from /Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/gcc/x86_64-apple-darwin15.6.0/4.9.3/include-fixed/syslimits.h:7:0,
                 from /Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/gcc/x86_64-apple-darwin15.6.0/4.9.3/include-fixed/limits.h:34,
                 from /Applications/SageMath-7.4.app/Contents/Resources/sage/local/include/python2.7/Python.h:19,
                 from _Users_michael__sage_temp_Michaels_MBP_freystuff_com_34036_tmp_81FKRa_spyx_0.c:4:
/Applications/SageMath-7.4.app/Contents/Resources/sage/local/lib/gcc/x86_64-apple-darwin15.6.0/4.9.3/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
 #include_next <limits.h>  /* recurse down to the real one */
                                                             ^
compilation terminated.
error: command 'gcc' failed with exit status 1

The limits.h file exists:

pwd

/Applications/SageMath-7.4.app

Michaels-MBP:SageMath-7.4.app michael$ find . -type f -iname 'limits.h' -ls

1373529        8 -rw-r--r--    1 michael          admin                1214 Oct 19 16:11 ./Contents/Resources/sage/local/include/c++/4.9.3/tr1/limits.h

1376268       16 -rw-r--r--    1 michael          admin                5382 Oct 19 16:07 ./Contents/Resources/sage/local/lib/gcc/x86_64-apple-darwin15.6.0/4.9.3/include-fixed/limits.h

1376277       16 -rw-r--r--    1 michael          admin                5382 Oct 19 16:11 ./Contents/Resources/sage/local/lib/gcc/x86_64-apple-darwin15.6.0/4.9.3/install-tools/include/limits.h


Hopefully there is an easy fix for this.

Mike

Code:

Volker Braun

unread,
Jan 10, 2017, 2:48:42 AM1/10/17
to sage-support
You need xcode for various system headers.

Michael Frey

unread,
Jan 10, 2017, 6:54:16 AM1/10/17
to sage-support
Thank you for the quick reply.

I have xCode installed.  gcc is located at /Applications/Xcode.app/Contents/Developer/usr/bin/.

There about 50 versions of limits.h.  Which one is sage looking for?

Mike

Dima Pasechnik

unread,
Jan 10, 2017, 9:10:51 AM1/10/17
to sage-support


On Tuesday, January 10, 2017 at 11:54:16 AM UTC, Michael Frey wrote:
Thank you for the quick reply.

I have xCode installed.  gcc is located at /Applications/Xcode.app/Contents/Developer/usr/bin/.

this is not the gcc used to build Sage on OSX, as it is old and a bit broken. 
Sage builds its own gcc and uses it.
Have you built Sage from source? I guess not. Unfortunately binary builds of Sage are a bit flaky.
I'd suggest to build Sage from source and try your code then.

Dima Pasechnik

unread,
Jan 10, 2017, 9:16:02 AM1/10/17
to sage-support
Regarding building from source, you'd rather build the develop branch of
(which should be Sage 7.5.rc3), as 7.4 has known issues with latest OSX versions.

Jeroen Demeyer

unread,
Jan 10, 2017, 11:19:00 AM1/10/17
to sage-s...@googlegroups.com
On 2017-01-10 12:54, Michael Frey wrote:
> Which one is sage looking for?

The one in /usr/include
Reply all
Reply to author
Forward
0 new messages