gcc 编译器无法识别 -fno-plt 选项

2023-12-29

我正在尝试使用 Amazon Linux AMI 在 Amazon EC2 实例上编译 QuantLib Python SWIG 绑定。我已成功编译 QuantLib 本身,但是,当尝试编译 anaconda python swig 绑定时,我收到 -fno-plt 选项错误。我已经将gcc编译器版本升级到5.4.0,原来是4.8

首先我配置如下:

sudo ./configure --disable-perl --disable-ruby --disable-mzscheme --disable-guile --disable-csharp --disable-ocaml --disable-r --disable-java  PYTHON=/opt/anaconda/anaconda2/bin/python

然后我做如下:

make -C Python

我收到错误:

make: Entering directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'
make  all-am

make[1]: Entering directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'
CXXFLAGS="-O3 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings" CC="gcc" CXX="g++" /opt/anaconda/anaconda2/bin/python setup.py build

running build

running build_py

running build_ext

building 'QuantLib._QuantLib' extension

gcc -fno-strict-aliasing -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda/anaconda2/include/python2.7 -I/usr/local/include -c QuantLib/quantlib_wrap.cpp -o build/temp.linux-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused -O3 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare -Wno-write-strings

gcc: error: unrecognized command line option ‘-fno-plt’

error: command 'gcc' failed with exit status 1

make[1]: *** [.build-stamp] Error 1

make[1]: Leaving directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'

make: *** [all] Error 2

make: Leaving directory `/home/ec2-user/downloads/QuantLib-SWIG-1.8/Python'

我对此很陌生,不知道编译时是否可以删除 -fno-plt 选项,如果可以,如何删除?


您需要升级 GCC 版本。

The GCC 6 的变更日志页面 https://gcc.gnu.org/gcc-6/changes.html says:

选项 -fno-plt 现在功能齐全。

因此,从GCC 6你可以使用它。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

gcc 编译器无法识别 -fno-plt 选项 的相关文章

随机推荐