Failure to build Sage 9.4 on Monterey

126 views
Skip to first unread message

Jeremy Martin

unread,
Jan 28, 2022, 2:03:53 PM1/28/22
to sage-devel
I am on a brand-new Apple M1 running Monterey 12.0.1.  I just tried to build Sage 9.4 from source.  After installing XCode, command-line tools, Homebrew, I get the following (complete log files attached).

........
[gmp-6.2.0] configure: error: Oops, mp_limb_t is 64 bits, but the assembler code
[gmp-6.2.0] in this configuration expects 32 bits.
[gmp-6.2.0] Error configuring GMP (with CFLAGS unset).
[gmp-6.2.0] Consult /Applications/sage-9.4/local/var/tmp/sage/build/gmp-6.2.0/src/config.log for for details.
[gmp-6.2.0]
[gmp-6.2.0] real        0m13.729s
[gmp-6.2.0] user        0m5.814s
[gmp-6.2.0] sys        0m4.358s
[gmp-6.2.0] ************************************************************************
[gmp-6.2.0] Error installing package gmp-6.2.0
[gmp-6.2.0] ************************************************************************
[gmp-6.2.0] Please email sage-devel (http://groups.google.com/group/sage-devel)
[gmp-6.2.0] explaining the problem and including the log files
[gmp-6.2.0]   /Applications/sage-9.4/logs/pkgs/gmp-6.2.0.log
[gmp-6.2.0] and
[gmp-6.2.0]   /Applications/sage-9.4/config.log
[gmp-6.2.0] Describe your computer, operating system, etc.
[gmp-6.2.0] If you want to try to fix the problem yourself, *don't* just cd to
[gmp-6.2.0] /Applications/sage-9.4/local/var/tmp/sage/build/gmp-6.2.0 and type 'make' or whatever is appropriate.
[gmp-6.2.0] Instead, the following commands setup all environment variables
[gmp-6.2.0] correctly and load a subshell for you to debug the error:
[gmp-6.2.0]   (cd '/Applications/sage-9.4/local/var/tmp/sage/build/gmp-6.2.0' && '/Applications/sage-9.4/sage' --buildsh)
[gmp-6.2.0] When you are done debugging, you can type "exit" to leave the subshell.
[gmp-6.2.0] ************************************************************************
make[4]: *** [gmp-SAGE_LOCAL-no-deps] Error 1
make[3]: *** [/Applications/sage-9.4/local/var/lib/sage/installed/gmp-6.2.0] Error 2
make[2]: *** [toolchain-deps] Error 2

real        0m44.133s
user        0m18.589s
sys        0m14.489s
***************************************************************
Error building Sage.

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

* package:         gmp-6.2.0
  last build time: Jan 28 12:11
  log file:        /Applications/sage-9.4/logs/pkgs/gmp-6.2.0.log
  build directory: /Applications/sage-9.4/local/var/tmp/sage/build/gmp-6.2.0

It is safe to delete any log files and build directories, but they
contain information that is helpful for debugging build problems.
WARNING: If you now run 'make' again, the build directory of the
same version of the package will, by default, be deleted. Set the
environment variable SAGE_KEEP_BUILT_SPKGS=yes to prevent this.

make[1]: *** [all-start] Error 1
make: *** [all] Error 2
gmp-6.2.0.log
config.log

Dima Pasechnik

unread,
Jan 28, 2022, 4:12:29 PM1/28/22
to sage-devel
9.4 is not known to run on M1.
Try the latest, 9.5.rc4, instead.

--
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/cd3795e6-775e-4603-a5d4-b51b0034e8fcn%40googlegroups.com.

Jeremy Martin

unread,
Jan 28, 2022, 5:30:59 PM1/28/22
to sage-devel
Apologies if I'm missing something, but 9.4 appears to be the current version available on sagemath.org and all its mirrors.
-JLM

Dima Pasechnik

unread,
Jan 28, 2022, 6:17:30 PM1/28/22
to sage-devel


On Fri, 28 Jan 2022, 22:31 Jeremy Martin, <jeremy....@gmail.com> wrote:
Apologies if I'm missing something, but 9.4 appears to be the current version available on sagemath.org and all its mirrors.

Jeremy Martin

unread,
Jan 28, 2022, 8:34:59 PM1/28/22
to sage-...@googlegroups.com

Thanks, Dima.  I'm looking for a stable version to use every day, so I guess I need to wait until the official release of 9.5?

I'm no expert on reading install logs but the problem looks like it is about a specific package.

-Jeremy

You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/NiP5jIfHusI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq1Gs3U-pYdDNXL01RExWO61cO%3DYscFtYeZRgGR%2B39bSww%40mail.gmail.com.

Dima Pasechnik

unread,
Jan 29, 2022, 5:13:53 AM1/29/22
to sage-devel


On Sat, 29 Jan 2022, 01:35 Jeremy Martin, <jeremy....@gmail.com> wrote:

Thanks, Dima.  I'm looking for a stable version to use every day, so I guess I need to wait until the official release of 9.5?

I'm no expert on reading install logs but the problem looks like it is about a specific package.


here is a ticket we have for M1 support.
Even with 9.5 you will need some packages from Homebrew to be able to build on M1 



Matthias Koeppe

unread,
Jan 29, 2022, 12:26:32 PM1/29/22
to sage-devel
Hi Jeremy,
It depends on what you mean by "every day".
If today is included, there is no version that is both a "stable release" and supports the Apple M1.
If "every day" starts at on a day in the future when Sage 9.5 is released, then Sage 9.5 will satisfy your criteria.
More information on platform support of Sage versions - https://wiki.sagemath.org/ReleaseTours
Matthias

Samuel Lelievre

unread,
Jan 29, 2022, 5:39:53 PM1/29/22
to sage-devel
Jeremy,

Installing Sage 9.4 on macOS 12 on a Mac with an Apple M1
processor might work using sagemath-forge.

To try it:
```
INSTALL_LOCATION=$HOME  # or your choice of location
SITE='https://github.com'
DIRS='isuruf/sagemath-forge/releases/latest/download'
FILE="sagemath-forge-$(uname)-$(uname -m).sh"
cd $INSTALL_LOCATION
curl -L -O $SITE/$DIRS/$FILE
bash $FILE
```

The script then asks a few questions; answering "yes"
each time might work well.

Once sagemath-forge is installed, the underlying Conda can
be activated or deactivated; activating it changes the PATH to
include `/path/to/sagemath-forge/bin` where the executables
installed by Conda are located.

So, to use the version of Sage installed via Conda:
```
$ conda activate

$ which sage
/path/to/sagemath-forge/bin/sage

$ sage
│ SageMath version 9.4, Release Date: 2021-08-22
│ Using Python 3.8.12. Type "help()" for help.
sage: %colors Linux
sage: 2 * 3 * 337
2022
sage: quit
Exiting Sage (CPU time 0m0.12s, Wall time 0m16.08s).

$ conda deactivate
```

To start Jupyter notebook or JupyterLab:
```
$ conda activate
$ jupyter notebook
$ jupyter lab
$ conda deactivate
```

To make Conda always active, add the line
```
conda activate
```
to a file that gets sourced every time you start a shell
(e.g. in `$HOME/.bash_profile` if you use bash, or in the
zsh corresponding file if you use zsh as your shell).

Hope that works for you.   --Samuel

Marc Culler

unread,
Jan 29, 2022, 5:49:23 PM1/29/22
to sage-devel
The binary release of SageMath 9.4 for Intel Macs is reported to work fine with Rosetta.

- Marc

On Friday, January 28, 2022 at 3:12:29 PM UTC-6 dim...@gmail.com wrote:

Jeremy Martin

unread,
Jan 31, 2022, 6:03:26 PM1/31/22
to sage-devel
Thank you for the suggestions.  I will keep trying to install from source and may post again with more questions.
-Jeremy

Jeremy Martin

unread,
Feb 1, 2022, 5:22:42 PM2/1/22
to sage-devel
Samuel,

Thanks - that worked.  I appreciate the help.

-Jeremy

Reply all
Reply to author
Forward
0 new messages