Compile from source fails on Ubuntu
I tried to compile sage from source. I did
git clone github.com/sagemath/sage.git /math/sage
cd /math/sage
make configure
./configure --enable-editable
make -j4
,but it didn't complete, returning after ~30minutes the following error :
[sagelib-9.7.beta6] error: subprocess-exited-with-error
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] × python setup.py develop did not run successfully.
[sagelib-9.7.beta6] │ exit code: 1
[sagelib-9.7.beta6] ╰─> See above for output.
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] note: This error originates from a subprocess, and is likely not a problem with pip.
[sagelib-9.7.beta6] full command: /math/sage/local/var/lib/sage/venv-python3.10/bin/python3 -c '
[sagelib-9.7.beta6] exec(compile('"'"''"'"''"'"'
[sagelib-9.7.beta6] # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
[sagelib-9.7.beta6] #
[sagelib-9.7.beta6] # - It imports setuptools before invoking setup.py, to enable projects that directly
[sagelib-9.7.beta6] # import from `distutils.core` to work with newer packaging standards.
[sagelib-9.7.beta6] # - It provides a clear error message when setuptools is not installed.
[sagelib-9.7.beta6] # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
[sagelib-9.7.beta6] # setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
[sagelib-9.7.beta6] # manifest_maker: standard file '"'"'-c'"'"' not found".
[sagelib-9.7.beta6] # - It generates a shim setup.py, for handling setup.cfg-only projects.
[sagelib-9.7.beta6] import os, sys, tokenize
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] try:
[sagelib-9.7.beta6] import setuptools
[sagelib-9.7.beta6] except ImportError as error:
[sagelib-9.7.beta6] print(
[sagelib-9.7.beta6] "ERROR: Can not execute `setup.py` since setuptools is not available in "
[sagelib-9.7.beta6] "the build environment.",
[sagelib-9.7.beta6] file=sys.stderr,
[sagelib-9.7.beta6] )
[sagelib-9.7.beta6] sys.exit(1)
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] __file__ = %r
[sagelib-9.7.beta6] sys.argv[0] = __file__
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] if os.path.exists(__file__):
[sagelib-9.7.beta6] filename = __file__
[sagelib-9.7.beta6] with tokenize.open(__file__) as f:
[sagelib-9.7.beta6] setup_py_code = f.read()
[sagelib-9.7.beta6] else:
[sagelib-9.7.beta6] filename = "<auto-generated setuptools caller>"
[sagelib-9.7.beta6] setup_py_code = "from setuptools import setup; setup()"
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] exec(compile(setup_py_code, filename, "exec"))
[sagelib-9.7.beta6] '"'"''"'"''"'"' % ('"'"'/math/sage/src/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' --no-user-cfg develop --no-deps
[sagelib-9.7.beta6] cwd: /math/sage/src/
[sagelib-9.7.beta6] error: subprocess-exited-with-error
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] × python setup.py develop did not run successfully.
[sagelib-9.7.beta6] │ exit code: 1
[sagelib-9.7.beta6] ╰─> See above for output.
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] note: This error originates from a subprocess, and is likely not a problem with pip.
[sagelib-9.7.beta6]
[sagelib-9.7.beta6] real 0m25,129s
[sagelib-9.7.beta6] user 0m22,528s
[sagelib-9.7.beta6] sys 0m2,610s
make[4]: *** [Makefile:3002 : sagelib-SAGE_VENV-no-deps] Erreur 1
make[3]: *** [Makefile:3002 : /math/sage/local/var/lib/sage/venv-python3.10/var/lib/sage/installed/sagelib-9.7.beta6] Erreur 2
make[2]: *** [Makefile:2561 : all-start] Erreur 2
make[2] : on quitte le répertoire « /math/sage/build/make »
real 0m25,475s
user 0m22,867s
sys 0m2,665s
***************************************************************
Error building Sage.
The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):
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]: *** [Makefile:40 : all-start] Erreur 1
make[1] : on quitte le répertoire « /math/sage »
make: *** [Makefile:13 : all] Erreur 2
enter code here
I don't know what to do, I tried several times, it never complete.
Thank you for any help
Welcome to ask.sagemath. The error is before the part you posted; check the file logs/pkgs/ sagelib-9.7.beta6.log. Also, when you ran
./configure --enable-editable
, it probably ended with suggestions about Ubuntu packages that you could install; did you follow those suggestions?