【记录】Ubuntu 18.04编译Python 3.7.5源码并安装所用configure命令

  configure命令:


sudo ./configure  --enable-shared   --enable-profiling  --enable-optimizations    --enable-loadable-sqlite-extensions   --enable-big-digits  --with-universal-archs=all --with-pydebug  --with-assertions    --with-lto   --with-hash-algorithm=fnv    --with-system-ffi     --with-doc-strings --with-pymalloc  --with-c-locale-coercion  --with-valgrind  --with-computed-gotos --with-ensurepip=upgrade  --with-openssl=/usr/local/ssl   --with-ssl-default-suites=openssl --with-gcc=/usr/local/bin/gcc

  发现:configure时,--with-address-sanitizer --with-memory-sanitizer不能同時指定,否则在使用clang做编译器进行make时,会报如下错误(我最终使用gcc做为编译器):


clang: error: invalid argument '-fsanitize=address' not allowed with '-fsanitize=memory'

  具体原因,这条链接里面有老外給了解释,具体是否正确就不知道了。另外,单单使用--with-memory-sanitizer而后make时也会报错(clang做编译器),只能用--with-address-sanitizer


  configure时加这么多选项,也不知后面会不会在使用时出什么稀奇古怪的错误,反正maketest阶段有很多failed,有的话到时候再换另一个吧。之前倒是遇到过,用Python编译某些项目的代码时,提示必须开启某某选项,而这个选项(貌似,吧)得在make前的configure时就启用。


  本次所用gcc版本为10.2.0,具体信息如下所示:


Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)

你可能感兴趣的:(Python,Linux学习,来自高山,手动编译,Python,3.7.5,gcc,10.2.0,Ubuntu,18.04)