sage binary "base-toolchain" failed
I'm trying to use SageMath 8.3 binary for Ubuntu 16.04 LTS.
The binary does not work out of the box, it complains "RecursionError", which seems to be caused by Anaconda overriding the default python2.7 interpreter. So I temporarily comment out the Anaconda path, and the python interpreter is now the default 2.7.
Then there is this "bas-toolchain" error:
patching /home/abc/usr/SageMath/local/bin/g++ Traceback (most recent call last): File "./relocate-once.py", line 208, in <module> ch(3478673, 3478845).save() File "./relocate-once.py", line 113, in patch self.search_and_replace, self.filename File "./relocate-once.py", line 52, in __init__ super(FileBinaryPatch, self).__init__(search_and_replace, filename) File "./relocate-once.py", line 40, in __init__ self.st = os.stat(filename) OSError: [Errno 2] No such file or directory: '/home/abc/usr/SageMath/local/bin/g++' Makefile:31: recipe for target 'base-toolchain' failed make: *** [base-toolchain] Error 1
I created a symlink of g++
ln -sf /usr/bin/g++ ./local/bin/g++
but it doesn't work.
I have no idea what to do, please help. Thanks in advance!
Edit (10/20/2018):
The binary also reports error. Output of sudo ./sage
:
Traceback (most recent call last): File "/home/abc/usr/SageMath/relocate-once.py", line 208, in <module> ch(3478673, 3478845).save() File "/home/abc/usr/SageMath/relocate-once.py", line 113, in patch self.search_and_replace, self.filename File "/home/abc/usr/SageMath/relocate-once.py", line 52, in __init__ super(FileBinaryPatch, self).__init__(search_and_replace, filename) File "/home/abc/usr/SageMath/relocate-once.py", line 40, in __init__ self.st = os.stat(filename) OSError: [Errno 2] No such file or directory: '/home/abc/usr/SageMath/local/bin/g++' ERROR: The Sage installation tree has moved from /home/buildbot/slave/binary_pkg/build/source/SageMath/jc4b6yulaujayb9sr94ia88eourzeqip0oidmas391yaj2 to /home/abc/usr/SageMath This is not supported, and Sage will not work. To install Sage from a binary package: 1. Open the .tar.bz2 archive (or .dmg on OSX) 2. Move the SageMath folder/app to where you want it to be. You can also rename the directory now. 3. Start sage for the first time. This will then automatically patch paths in binaries. After starting Sage for the first time you cannot change the installation any more. To install Sage elsewhere, start over from the binary package. Or recompile Sage from scratch in the new location ("make distclean && make")
I also tried sudo sage --nodotsage
, same output.
It looks like the binary in the first run must call the make.
I suggest starting over completely, following the steps 1-3 in the output you quoted. Also in general you should not run sage with sudo, just run
./sage
.That works! It looks like one need to extract the .tar.bz2 again if the folder has been moved elsewhere after the execution of sage. And it does not require root privilege.