标签:end hat build gcc conf lock 默认 link htm
参考网址:
https://docs.python.org/3/using/unix.html#on-linux
安装GCC toolchain
apt-get install build-essential
安装编译库
libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev
设置编译后文件安装位置,默认/usr/
prefix --- Python模块位置,
${prefix}/lib/pythonversion
exec_prefix --- Python执行位置,${exec_prefix}/bin/python3
默认prefix与exec_prefix相同
使用优化的设置进行编译
configure --enable-optimizations
启用Link Time Optimization
--with-lto, LTO当构建最终的可执行文件或共享库以获得额外的性能收益时,LTO利用最近编译器工具链的优势,跨越任意的.o文件边界进行优化。
并存安装
If you intend to install multiple versions using the same prefix you must decide which version (if any) is your "primary" version. Install that version using
make install. Install all other versions usingmake altinstall.
安装
make -j n
n为指定的编译线程数
make install
标签:end hat build gcc conf lock 默认 link htm
原文地址:https://www.cnblogs.com/li1234yun/p/9848998.html