unable to build sage 8.9 on osx 10.14.6

48 views
Skip to first unread message

Robert Baertsch

unread,
May 11, 2020, 3:15:10 PM5/11/20
to sage-devel
[gcc-7.4.0] In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/sysctl.h:83:0,
[gcc-7.4.0]                  from ../../src/gcc/config/darwin-driver.c:30:
[gcc-7.4.0] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/ucred.h:94:2: error: '_Atomic' does not name a type
[gcc-7.4.0]   _Atomic u_long          cr_ref;  /* reference count */
[gcc-7.4.0]   ^~~~~~~
[gcc-7.4.0] make[6]: *** [darwin-driver.o] Error 1
[gcc-7.4.0] make[5]: *** [all-stage2-gcc] Error 2
[gcc-7.4.0] make[4]: *** [stage2-bubble] Error 2
[gcc-7.4.0] make[3]: *** [all] Error 2

Justin C. Walker

unread,
May 11, 2020, 5:17:45 PM5/11/20
to SAGE Development
FWIW, I built sage 8.9 on 10.14.6 without problems, and sage’s gcc was not built. I have Xcode 10.2.1 installed, and gcc tells me that it’s

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

The fact that the installation is trying to build gcc means that either you don’t have it installed, or it’s way out of date. I think gcc 7.4 is way old for macOS 10.14.

You could try installing the command-line tools for Xcode 10.2.1 and see what happens.

HTH

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds
--------
If you're not confused,
You're not paying attention
--------



Samuel Lelievre

unread,
May 11, 2020, 8:22:25 PM5/11/20
to sage-devel
> Date: Mon 2020-05-11 19:15:10 UTC
> From: Robert Baertsch
> Subject: unable to build sage 8.9 on osx 10.14.6

<snip>

> [gcc-7.4.0] make[3]: *** [all] Error 2


Unless there is a strong reason to build SageMath 8.9,
I would advise to build SageMath 9.0 or even 9.1.rc4.

On macOS the absolute prerequisite is to install
Apple's Command Line Tools for Developers. Installing
the full Xcode can be done too but is not required.

One can additionally install Homebrew. Many packages
needed by Sage can then be installed precompiled via
Homebrew. This can decrease SageMath's build time by
a fair amount.

To install Homebrew follow the instructions at


Then after getting and extracting the SageMath sources,
change to the extracted SageMath directory, and run

    $ make configure
    $ CC=clang CXX=clang++ FC=gfortran \
      OBJC=clang OBJCXX=clang++ \
      ./configure

The "./configure" output will end by recommending
some packages to install with Homebrew. Follow
these recommendations.

Samuel

Robert Baertsch

unread,
May 12, 2020, 1:19:11 PM5/12/20
to sage-...@googlegroups.com
Hmm. my gcc / clang version is 11.0 is newer. I wonder why it is trying to install gcc?

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

> --
> 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/7A7D01F2-FB68-48B8-99C2-62D261603A87%40mac.com.

Dima Pasechnik

unread,
May 12, 2020, 1:56:11 PM5/12/20
to sage-devel
Could you post config.log ?
Apparently clang failed a test....


Robert Baertsch

unread,
May 12, 2020, 6:05:24 PM5/12/20
to sage-...@googlegroups.com
configure:5529: checking how to run the C preprocessor
configure:5560: clang -E  conftest.c
configure:5560: $? = 0
configure:5574: clang -E  conftest.c
conftest.c:11:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
configure:5574: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Sage"

Dima Pasechnik

unread,
May 12, 2020, 6:10:26 PM5/12/20
to sage-devel
On Tue, May 12, 2020 at 11:05 PM Robert Baertsch
<robert....@skytran.com> wrote:
>
> configure:5529: checking how to run the C preprocessor
> configure:5560: clang -E conftest.c
> configure:5560: $? = 0
> configure:5574: clang -E conftest.c
> conftest.c:11:10: fatal error: 'ac_nonexistent.h' file not found
> #include <ac_nonexistent.h>
> ^~~~~~~~~~~~~~~~~~
> 1 error generated.
> configure:5574: $? = 1
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME "Sage"
>
> On May 12, 2020, at 10:55 AM, Dima Pasechnik <dim...@gmail.com> wrote:
>
> Could you post config.log ?
> Apparently clang failed a test....

The complete file, please.
Thai little fragment is totally fine (it actually merely tests whether
-E is a correct switch :-))
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/D0D10492-4DFA-474B-B878-5C2758C5BECC%40skytran.com.

Robert Baertsch

unread,
May 12, 2020, 6:33:30 PM5/12/20
to sage-...@googlegroups.com
sorry about that here is the whole file

config.log

Matthias Koeppe

unread,
May 12, 2020, 8:24:24 PM5/12/20
to sage-devel
On Tuesday, May 12, 2020 at 3:33:30 PM UTC-7, Robert Baertsch wrote:
sorry about that here is the whole file

From the log, it looks like you have a conda environment activated. 
Sage 8.9 does not support this.
Deactivate it to compile Sage, or try with the 9.1 release candidate. 


Reply all
Reply to author
Forward
0 new messages