我正在尝试在 Ubuntu 16.04 上编译 Sage。我下载了二进制文件并安装了一个包。我在 Sage 目录中运行“make”,结果如下:
> [maxima-5.35.1.p2] Now installing the Maxima library as
> '/home/davidk/Desktop/SageMath/local/lib/ecl//maxima.fas'...
> [maxima-5.35.1.p2] [maxima-5.35.1.p2] real 5m8.176s
> [maxima-5.35.1.p2] user 4m31.916s [maxima-5.35.1.p2] sys 0m20.496s
> [maxima-5.35.1.p2] Successfully installed maxima-5.35.1.p2
> [maxima-5.35.1.p2] Deleting temporary build directory
> [maxima-5.35.1.p2]
> /home/davidk/Desktop/SageMath/local/var/tmp/sage/build/maxima-5.35.1.p2
> [maxima-5.35.1.p2] Finished installing maxima-5.35.1.p2.spkg cd ../..
> && sage-logger -p './sage --docbuild --no-pdf-links all html '
> logs/dochtml.log [dochtml]
> /home/davidk/Desktop/SageMath/local/bin/python:
> /home/davidk/Desktop/SageMath/local/lib/libstdc++.so.6: version
> `GLIBCXX_3.4.21' not found (required by
> /home/davidk/Desktop/SageMath/local/lib/libbrial.so.0);
> 'sage_setup.docbuild' is a package and cannot be directly executed
> Makefile:1023: recipe for target 'doc-html' failed make[2]: ***
> [doc-html] Error 1 make[2]: Leaving directory
> '/home/davidk/Desktop/SageMath/build/make' Makefile:846: recipe for
> target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving
> directory '/home/davidk/Desktop/SageMath/build/make'
>
> real 110m50.466s user 102m18.460s sys 5m7.284s
> *************************************************************** Error building Sage.
>
下列软件包可能未能构建(不一定在此次运行“make all”期间):
构建目录可能包含配置文件和其他可能有用的信息。警告:如果您现在再次运行“make”,则默认情况下将删除构建目录。将环境变量 SAGE_KEEP_BUILT_SPKGS 设置为“yes”以防止这种情况发生。
Makefile:16:目标“全部”的配方失败:*** [全部] 错误 1
按照错误信息中的建议,我更改了我的环境变量,如下所示(我添加了第二行):
~/Desktop/SageMath$ cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" export SAGE_KEEP_BUILT_SPKGS=yes
然后,按照建议这里我执行了下列操作:
sudo apt-get 安装 libstdc++6
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get 更新
sudo apt-get 升级
当我运行“make”时,仍然出现以下错误:
> [sagelib-7.3] [sagelib-7.3] real 0m4.203s [sagelib-7.3] user 0m3.516s
> [sagelib-7.3] sys 0m0.460s cd ../.. && sage-logger -p './sage
> --docbuild --no-pdf-links all html ' logs/dochtml.log [dochtml] /home/davidk/Desktop/SageMath/local/bin/python:
> /home/davidk/Desktop/SageMath/local/lib/libstdc++.so.6: version
> `GLIBCXX_3.4.21' not found (required by
> /home/davidk/Desktop/SageMath/local/lib/libbrial.so.0);
> 'sage_setup.docbuild' is a package and cannot be directly executed
> Makefile:1023: recipe for target 'doc-html' failed make[2]: ***
> [doc-html] Error 1 make[2]: Leaving directory
> '/home/davidk/Desktop/SageMath/build/make' Makefile:846: recipe for
> target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving
> directory '/home/davidk/Desktop/SageMath/build/make'
>
> real 0m6.692s user 0m5.536s sys 0m0.800s
> *************************************************************** Error building Sage.
>
> The following package(s) may have failed to build (not necessarily
> during this run of 'make all'):
>
> The build directory may contain configuration files and other
> potentially helpful information. WARNING: if you now run 'make' again,
> the build directory will, by default, be deleted. Set the environment
> variable SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.
>
> Makefile:16: recipe for target 'all' failed make: *** [all] Error 1
有人能提供建议吗?任何建议都将不胜感激。谢谢!
答案1
验证您当前的 libstdc++ 是否具有
GLIBCXX_3.4.21
:strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.21
创建符号链接如下:
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 /home/davidk/Desktop/SageMath/local/lib/libstdc++.so.6
make