OS X build failure: "Error installing package gfortran-7.2.0"

221 views
Skip to first unread message

Jeremy Martin

unread,
Aug 15, 2018, 3:51:50 PM8/15/18
to sage-devel
I am trying to install sage 8.3 from source, running MacOS 10.13.6 High Sierra.  A snippet of the output is below.  I'm attaching the full logfile.  I don't know what this means, so any help would be greatly appreciated!

Thanks,
Jeremy Martin

----------------------------------------------------cut here----------------------------------------------------

[gfortran-7.2.0] The directory that should contain system headers does not exist:
[gfortran-7.2.0]   /usr/include
[gfortran-7.2.0] make[6]: *** [stmp-fixinc] Error 1
[gfortran-7.2.0] make[5]: *** [all-gcc] Error 2
[gfortran-7.2.0] make[4]: *** [all] Error 2
[gfortran-7.2.0] ********************************************************************************
[gfortran-7.2.0] Error building gfortran-7.2.0
[gfortran-7.2.0] ********************************************************************************
[gfortran-7.2.0]
[gfortran-7.2.0] real 15m38.488s
[gfortran-7.2.0] user 11m15.916s
[gfortran-7.2.0] sys 1m42.868s
[gfortran-7.2.0] ************************************************************************
[gfortran-7.2.0] Error installing package gfortran-7.2.0
[gfortran-7.2.0] ************************************************************************
[gfortran-7.2.0] Please email sage-devel (http://groups.google.com/group/sage-devel)
[gfortran-7.2.0] explaining the problem and including the log file
[gfortran-7.2.0]   /Users/jlmartin/Downloads/sage-8.3/logs/pkgs/gfortran-7.2.0.log
[gfortran-7.2.0] Describe your computer, operating system, etc.
[gfortran-7.2.0] If you want to try to fix the problem yourself, *don't* just cd to
[gfortran-7.2.0] /Users/jlmartin/Downloads/sage-8.3/local/var/tmp/sage/build/gfortran-7.2.0 and type 'make' or whatever is appropriate.
[gfortran-7.2.0] Instead, the following commands setup all environment variables
[gfortran-7.2.0] correctly and load a subshell for you to debug the error:
[gfortran-7.2.0]   (cd '/Users/jlmartin/Downloads/sage-8.3/local/var/tmp/sage/build/gfortran-7.2.0' && '/Users/jlmartin/Downloads/sage-8.3/sage' --sh)
[gfortran-7.2.0] When you are done debugging, you can type "exit" to leave the subshell.
[gfortran-7.2.0] ************************************************************************
make[3]: *** [/Users/jlmartin/Downloads/sage-8.3/local/var/lib/sage/installed/gfortran-7.2.0] Error 1
make[2]: *** [all-start] Error 2

real 71m31.729s
user 32m26.705s
sys 7m9.172s
***************************************************************
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):

* package: gfortran-7.2.0
  log file: /Users/jlmartin/Downloads/sage-8.3/logs/pkgs/gfortran-7.2.0.log
  build directory: /Users/jlmartin/Downloads/sage-8.3/local/var/tmp/sage/build/gfortran-7.2.0

The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.

make[1]: *** [all-start] Error 1
make: *** [all] Error 2
gfortran-7.2.0.log

François Bissey

unread,
Aug 15, 2018, 4:14:39 PM8/15/18
to sage-...@googlegroups.com
That looks like a symptom of not installing (or re-installing after an upgrade) the
xcode command line tools.

François
> --
> 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 post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
> <gfortran-7.2.0.log>

Jeremy Martin

unread,
Aug 16, 2018, 5:36:40 PM8/16/18
to sage-devel
Thanks, François!  That seems to have fixed it.

-Jeremy

Michael Frey

unread,
Oct 10, 2018, 10:47:45 PM10/10/18
to sage-devel
I get the same error with MAcOS Mojave and Xcode 10.0.  The release notes for Xcode 10 state that /usr/include is being relocated to /Library/Developer//CommandLineTools/SDKs/MacOSX.sdk/usr/include/.  See the Xcode 10 release notes: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes.  There is a temporary workaround by installing /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg.


Jeremy Martin

unread,
Mar 2, 2019, 8:09:45 AM3/2/19
to sage-devel
I just had to reinstall Sage (now running Mojave).  I got the same error as I had reported earlier, even though the command line tools were installed.  I followed Michael's suggestions and the build proceeded fine.  Thank you!
-Jeremy

Josh Haberman

unread,
May 11, 2019, 10:12:12 AM5/11/19
to sage-devel
I just got the same error. I can attempt the workaround also, but is there a more permanent fix that would avoid the need for the workaround? Why is gfortran looking for this specific directory?

Dima Pasechnik

unread,
May 11, 2019, 10:21:19 AM5/11/19
to sage-devel


On Sat, 11 May 2019 15:12 Josh Haberman, <jhab...@gmail.com> wrote:
I just got the same error. I can attempt the workaround also, but is there a more permanent fix that would avoid the need for the workaround? Why is gfortran looking for this specific directory?

every sane Unix system, except MacOS 10.14, has system header files in /usr/include

It could be that the newer versions of gcc have a fix. Anyhow, 
you could also install Homebrew and have gfortran, gmp, yasm, and a number of other Sage packages installed there, then they won't even need to be built...

On Saturday, March 2, 2019 at 7:09:45 AM UTC-6, Jeremy Martin wrote:
I just had to reinstall Sage (now running Mojave).  I got the same error as I had reported earlier, even though the command line tools were installed.  I followed Michael's suggestions and the build proceeded fine.  Thank you!
-Jeremy

On Wednesday, October 10, 2018 at 9:47:45 PM UTC-5, Michael Frey wrote:
I get the same error with MAcOS Mojave and Xcode 10.0.  The release notes for Xcode 10 state that /usr/include is being relocated to /Library/Developer//CommandLineTools/SDKs/MacOSX.sdk/usr/include/.  See the Xcode 10 release notes: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes.  There is a temporary workaround by installing /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg.


--
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 post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.

Josh Haberman

unread,
May 11, 2019, 10:55:04 AM5/11/19
to sage-devel
On Saturday, May 11, 2019 at 9:21:19 AM UTC-5, Dima Pasechnik wrote:
On Sat, 11 May 2019 15:12 Josh Haberman, <jhab...@gmail.com> wrote:
I just got the same error. I can attempt the workaround also, but is there a more permanent fix that would avoid the need for the workaround? Why is gfortran looking for this specific directory?

every sane Unix system, except MacOS 10.14, has system header files in /usr/include

Right but you don't usually need to specifically look for this directory or pass -I to find files there. A regular invocation of the compiler will look in the system header directories. I am curious why the build system is specifically inspecting this directory.
 
It could be that the newer versions of gcc have a fix. Anyhow, 
you could also install Homebrew and have gfortran, gmp, yasm, and a number of other Sage packages installed there, then they won't even need to be built...

I tried installing gcc (which includes gfortran) from Homebrew, and then I set "export SAGE_INSTALL_GCC=no" but it tried (and failed) building gfortran anyway. Maybe I need to unset "SAGE_KEEP_BUILT_SPKGS=yes" so it starts over from scratch? Or maybe I need to make the brew "gcc" available as "gcc" instead of "gcc-9", which is what it got installed as.

Also I tried the workaround of installing /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg but then the build of gfortran fails with:

"strip: invalid option -- c"

I think this is because it found the Homebrew-installed GNU /usr/local/bin/strip instead of the macOS /usr/bin/strip.

On Saturday, March 2, 2019 at 7:09:45 AM UTC-6, Jeremy Martin wrote:
I just had to reinstall Sage (now running Mojave).  I got the same error as I had reported earlier, even though the command line tools were installed.  I followed Michael's suggestions and the build proceeded fine.  Thank you!
-Jeremy

On Wednesday, October 10, 2018 at 9:47:45 PM UTC-5, Michael Frey wrote:
I get the same error with MAcOS Mojave and Xcode 10.0.  The release notes for Xcode 10 state that /usr/include is being relocated to /Library/Developer//CommandLineTools/SDKs/MacOSX.sdk/usr/include/.  See the Xcode 10 release notes: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes.  There is a temporary workaround by installing /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg.


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

Dima Pasechnik

unread,
May 11, 2019, 11:05:51 AM5/11/19
to sage-devel
On Sat, May 11, 2019 at 3:55 PM Josh Haberman <jhab...@gmail.com> wrote:
>
> On Saturday, May 11, 2019 at 9:21:19 AM UTC-5, Dima Pasechnik wrote:
>>
>> On Sat, 11 May 2019 15:12 Josh Haberman, <jhab...@gmail.com> wrote:
>>>
>>> I just got the same error. I can attempt the workaround also, but is there a more permanent fix that would avoid the need for the workaround? Why is gfortran looking for this specific directory?
>>
>>
>> every sane Unix system, except MacOS 10.14, has system header files in /usr/include
>
>
> Right but you don't usually need to specifically look for this directory or pass -I to find files there. A regular invocation of the compiler will look in the system header directories. I am curious why the build system is specifically inspecting this directory.
>
>>
>> It could be that the newer versions of gcc have a fix. Anyhow,
>> you could also install Homebrew and have gfortran, gmp, yasm, and a number of other Sage packages installed there, then they won't even need to be built...
>
>
> I tried installing gcc (which includes gfortran) from Homebrew, and then I set "export SAGE_INSTALL_GCC=no" but it tried (and failed) building gfortran anyway. Maybe I need to unset "SAGE_KEEP_BUILT_SPKGS=yes" so it starts over from scratch? Or maybe I need to make the brew "gcc" available as "gcc" instead of "gcc-9", which is what it got installed as.

You don't need SAGE_INSTALL_GCC - gcc should be recongnised
automatically and not installed. Do

make distclean

and start from scratch.

>
> Also I tried the workaround of installing /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg but then the build of gfortran fails with:
>
> "strip: invalid option -- c"
>
> I think this is because it found the Homebrew-installed GNU /usr/local/bin/strip instead of the macOS /usr/bin/strip.
>
>>> On Saturday, March 2, 2019 at 7:09:45 AM UTC-6, Jeremy Martin wrote:
>>>>
>>>> I just had to reinstall Sage (now running Mojave). I got the same error as I had reported earlier, even though the command line tools were installed. I followed Michael's suggestions and the build proceeded fine. Thank you!
>>>> -Jeremy
>>>>
>>>> On Wednesday, October 10, 2018 at 9:47:45 PM UTC-5, Michael Frey wrote:
>>>>>
>>>>> I get the same error with MAcOS Mojave and Xcode 10.0. The release notes for Xcode 10 state that /usr/include is being relocated to /Library/Developer//CommandLineTools/SDKs/MacOSX.sdk/usr/include/. See the Xcode 10 release notes: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes. There is a temporary workaround by installing /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg.
>>>>>
>>>>>
>>> --
>>> 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.
>>> To post to this group, send email to sage-...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/sage-devel.
>>> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/8a4caf26-93cb-432d-beab-91469828e627%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/f52807f3-8303-459e-a839-642a101243dc%40googlegroups.com.

Dima Pasechnik

unread,
May 11, 2019, 11:07:36 AM5/11/19
to sage-devel
On Sat, May 11, 2019 at 4:05 PM Dima Pasechnik <dim...@gmail.com> wrote:
>
> On Sat, May 11, 2019 at 3:55 PM Josh Haberman <jhab...@gmail.com> wrote:
> >
> > On Saturday, May 11, 2019 at 9:21:19 AM UTC-5, Dima Pasechnik wrote:
> >>
> >> On Sat, 11 May 2019 15:12 Josh Haberman, <jhab...@gmail.com> wrote:
> >>>
> >>> I just got the same error. I can attempt the workaround also, but is there a more permanent fix that would avoid the need for the workaround? Why is gfortran looking for this specific directory?
> >>
> >>
> >> every sane Unix system, except MacOS 10.14, has system header files in /usr/include
> >
> >
> > Right but you don't usually need to specifically look for this directory or pass -I to find files there. A regular invocation of the compiler will look in the system header directories. I am curious why the build system is specifically inspecting this directory.
> >
> >>
> >> It could be that the newer versions of gcc have a fix. Anyhow,
> >> you could also install Homebrew and have gfortran, gmp, yasm, and a number of other Sage packages installed there, then they won't even need to be built...
> >
> >
> > I tried installing gcc (which includes gfortran) from Homebrew, and then I set "export SAGE_INSTALL_GCC=no" but it tried (and failed) building gfortran anyway. Maybe I need to unset "SAGE_KEEP_BUILT_SPKGS=yes" so it starts over from scratch? Or maybe I need to make the brew "gcc" available as "gcc" instead of "gcc-9", which is what it got installed as.
>
> You don't need SAGE_INSTALL_GCC - gcc should be recongnised
> automatically and not installed. Do
>
> make distclean
>
> and start from scratch.

I always run configure first, as follows:

CC=clang CXX=clang++ ./configure

- this makes sure that gcc C/C++ is not used.

Josh Haberman

unread,
May 13, 2019, 2:34:57 AM5/13/19
to sage-...@googlegroups.com
On Sat, May 11, 2019 at 8:07 AM Dima Pasechnik <dim...@gmail.com> wrote:
On Sat, May 11, 2019 at 4:05 PM Dima Pasechnik <dim...@gmail.com> wrote:
> On Sat, May 11, 2019 at 3:55 PM Josh Haberman <jhab...@gmail.com> wrote:
> > I tried installing gcc (which includes gfortran) from Homebrew, and then I set "export SAGE_INSTALL_GCC=no" but it tried (and failed) building gfortran anyway. Maybe I need to unset "SAGE_KEEP_BUILT_SPKGS=yes" so it starts over from scratch? Or maybe I need to make the brew "gcc" available as "gcc" instead of "gcc-9", which is what it got installed as.
>
> You don't need SAGE_INSTALL_GCC - gcc should be recongnised
> automatically and not installed. Do
>
> make distclean
>
> and start from scratch.

I always run configure first, as follows:

CC=clang CXX=clang++ ./configure

- this makes sure that gcc C/C++ is not used.

That did the trick, thanks!
Reply all
Reply to author
Forward
0 new messages