Unable to build sagelib on macOS arm64

131 views
Skip to first unread message

Mavin Hellman

unread,
Sep 15, 2024, 12:37:12 AM9/15/24
to sage-devel
Attempting to build Sage 10.5 beta on macOS Version 14.2.1 (23C71)

```
[sagelib-10.5.beta3] [spkg-install]     ld: illegal thread local variable reference to regular symbol __ZN3NTL8ZZ_pInfoE for architecture arm64
[sagelib-10.5.beta3] [spkg-install]     clang: error: linker command failed with exit code 1 (use -v to see invocation)
[sagelib-10.5.beta3] [spkg-install]     error: command '/usr/bin/g++' failed with exit code 1
[sagelib-10.5.beta3] [spkg-install]     error: subprocess-exited-with-error
[sagelib-10.5.beta3] [spkg-install]    
[sagelib-10.5.beta3] [spkg-install]     × python setup.py develop did not run successfully.
[sagelib-10.5.beta3] [spkg-install]     │ exit code: 1
[sagelib-10.5.beta3] [spkg-install]     ╰─> See above for output.
[sagelib-10.5.beta3] [spkg-install]    
[sagelib-10.5.beta3] [spkg-install]     note: This error originates from a subprocess, and is likely not a problem with pip.
[sagelib-10.5.beta3] [spkg-install]     full command: /Users/mavin/Downloads/sage-10.5.beta3/local/var/lib/sage/venv-python3.9/bin/python3 -c '
[sagelib-10.5.beta3] [spkg-install]     exec(compile('"'"''"'"''"'"'
[sagelib-10.5.beta3] [spkg-install]     # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
[sagelib-10.5.beta3] [spkg-install]     #
[sagelib-10.5.beta3] [spkg-install]     # - It imports setuptools before invoking setup.py, to enable projects that directly
[sagelib-10.5.beta3] [spkg-install]     #   import from `distutils.core` to work with newer packaging standards.
[sagelib-10.5.beta3] [spkg-install]     # - It provides a clear error message when setuptools is not installed.
[sagelib-10.5.beta3] [spkg-install]     # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
[sagelib-10.5.beta3] [spkg-install]     #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
[sagelib-10.5.beta3] [spkg-install]     #     manifest_maker: standard file '"'"'-c'"'"' not found".
[sagelib-10.5.beta3] [spkg-install]     # - It generates a shim setup.py, for handling setup.cfg-only projects.
[sagelib-10.5.beta3] [spkg-install]     import os, sys, tokenize
[sagelib-10.5.beta3] [spkg-install]    
[sagelib-10.5.beta3] [spkg-install]     try:
[sagelib-10.5.beta3] [spkg-install]         import setuptools
[sagelib-10.5.beta3] [spkg-install]     except ImportError as error:
[sagelib-10.5.beta3] [spkg-install]         print(
[sagelib-10.5.beta3] [spkg-install]             "ERROR: Can not execute `setup.py` since setuptools is not available in "
[sagelib-10.5.beta3] [spkg-install]             "the build environment.",
[sagelib-10.5.beta3] [spkg-install]             file=sys.stderr,
[sagelib-10.5.beta3] [spkg-install]         )
[sagelib-10.5.beta3] [spkg-install]         sys.exit(1)
[sagelib-10.5.beta3] [spkg-install]    
[sagelib-10.5.beta3] [spkg-install]     __file__ = %r
[sagelib-10.5.beta3] [spkg-install]     sys.argv[0] = __file__
[sagelib-10.5.beta3] [spkg-install]    
[sagelib-10.5.beta3] [spkg-install]     if os.path.exists(__file__):
[sagelib-10.5.beta3] [spkg-install]         filename = __file__
[sagelib-10.5.beta3] [spkg-install]         with tokenize.open(__file__) as f:
[sagelib-10.5.beta3] [spkg-install]             setup_py_code = f.read()
[sagelib-10.5.beta3] [spkg-install]     else:
[sagelib-10.5.beta3] [spkg-install]         filename = "<auto-generated setuptools caller>"
[sagelib-10.5.beta3] [spkg-install]         setup_py_code = "from setuptools import setup; setup()"
[sagelib-10.5.beta3] [spkg-install]    
[sagelib-10.5.beta3] [spkg-install]     exec(compile(setup_py_code, filename, "exec"))
[sagelib-10.5.beta3] [spkg-install]     '"'"''"'"''"'"' % ('"'"'/Users/mavin/Downloads/sage-10.5.beta3/src/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' --no-user-cfg develop --no-deps
[sagelib-10.5.beta3] [spkg-install]     cwd: /Users/mavin/Downloads/sage-10.5.beta3/src/
[sagelib-10.5.beta3] [spkg-install] error: subprocess-exited-with-error
[sagelib-10.5.beta3] [spkg-install]
[sagelib-10.5.beta3] [spkg-install] × python setup.py develop did not run successfully.
[sagelib-10.5.beta3] [spkg-install] │ exit code: 1
[sagelib-10.5.beta3] [spkg-install] ╰─> See above for output.
[sagelib-10.5.beta3] [spkg-install]
[sagelib-10.5.beta3] [spkg-install] note: This error originates from a subprocess, and is likely not a problem with pip.
[sagelib-10.5.beta3] [spkg-install] *************************************************************************************************
[sagelib-10.5.beta3] [spkg-install] Error installing sagelib-10.5.beta3
[sagelib-10.5.beta3] [spkg-install] *************************************************************************************************
[sagelib-10.5.beta3] ************************************************************************
[sagelib-10.5.beta3] Error installing package sagelib-10.5.beta3
[sagelib-10.5.beta3] ************************************************************************
[sagelib-10.5.beta3] Please email sage-devel (http://groups.google.com/group/sage-devel)
[sagelib-10.5.beta3] explaining the problem and including the log files
[sagelib-10.5.beta3]   /Users/mavin/Downloads/sage-10.5.beta3/logs/pkgs/sagelib-10.5.beta3.log
[sagelib-10.5.beta3] and
[sagelib-10.5.beta3]   /Users/mavin/Downloads/sage-10.5.beta3/config.log
[sagelib-10.5.beta3] Describe your computer, operating system, etc.
[sagelib-10.5.beta3] If you want to try to fix the problem yourself, *don't* just cd to
[sagelib-10.5.beta3] /Users/mavin/Downloads/sage-10.5.beta3/local/var/lib/sage/venv-python3.9/var/tmp/sage/build/sagelib-10.5.beta3 and type 'make' or whatever is appropriate.
[sagelib-10.5.beta3] Instead, the following commands setup all environment variables
[sagelib-10.5.beta3] correctly and load a subshell for you to debug the error:
[sagelib-10.5.beta3]   (cd '/Users/mavin/Downloads/sage-10.5.beta3/local/var/lib/sage/venv-python3.9/var/tmp/sage/build/sagelib-10.5.beta3' && '/Users/mavin/Downloads/sage-10.5.beta3/sage' --buildsh)
[sagelib-10.5.beta3] When you are done debugging, you can type "exit" to leave the subshell.
[sagelib-10.5.beta3] ************************************************************************
[sagelib-10.5.beta3] real 1m34.240s user 1m29.080s sys 0m4.457s
make[4]: *** [sagelib-SAGE_VENV-no-deps] Error 1
make[3]: *** [/Users/mavin/Downloads/sage-10.5.beta3/local/var/lib/sage/venv-python3.9/var/lib/sage/installed/sagelib-10.5.beta3] Error 2
make[2]: *** [all-start] Error 2
***************************************************************
Error building Sage.

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

* package:         m4ri-20200125
  last build time: Sep 14 10:39
  log file:        /Users/mavin/Downloads/sage-10.5.beta3/logs/pkgs/m4ri-20200125.log

* package:         sagelib-10.5.beta3
  last build time: Sep 14 12:32
  log file:        /Users/mavin/Downloads/sage-10.5.beta3/logs/pkgs/sagelib-10.5.beta3.log

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.

real 1m36.324s user 1m30.335s sys 0m5.100s
make[1]: *** [all-start] Error 1
make: *** [all] Error 2
mavin@Mac-Studio sage-10.5.beta3 %
``` 

Dima Pasechnik

unread,
Sep 15, 2024, 10:55:03 AM9/15/24
to sage-...@googlegroups.com
it appears that m4ri was not successfully built.
Please post the corresponding log file, logs/pkgs/m4ri*.log
> --
> 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/82d90787-0725-481b-ab51-f581b4b9df12n%40googlegroups.com.

Mavin Hellman

unread,
Sep 18, 2024, 11:06:37 PM9/18/24
to sage-devel
Hello, 

I was able to get sage to build (I had to do a lot of switching back and forth of the CXXFLAGS and LDFLAGS to my MacPorts installation. I encountered another error though I can't seem to get past and that is in relation to sage-doc-html.

[sagemath_doc_html-none] [spkg-install] /sage-develop/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020

Is there a version that is easier to build than the beta or a prebuilt version that allows packages to be installed?

Dima Pasechnik

unread,
Sep 19, 2024, 9:41:05 AM9/19/24
to sage-...@googlegroups.com, mavin....@gmail.com
Hello,

you might have better luck using a prebuilt python, e.g. the one supplied by python.org
At least this would avoid all these ssl shenanigans.

Dima

G. M.-S.

unread,
Sep 19, 2024, 2:01:32 PM9/19/24
to sage-...@googlegroups.com

Hi Mavin.

Just in case, I encountered this problem too on macOS, but with Homebrew.
For ./configure to pick Homebrew Python (instead of /usr/bin/python3, giving "NotOpenSSLWarning") I had to
brew install python-setuptools

Guillermo
Reply all
Reply to author
Forward
0 new messages