gcc compiler not recognizing -fno-plt option

我与影子孤独终老i 提交于 2020-01-06 05:44:08

问题


I am trying to compile QuantLib Python SWIG bindings on Amazon's EC2 instance with Amazon Linux AMI. I have managed to compile QuantLib itself successfully, however, when trying to compile anaconda python swig bindings, I am getting an error with -fno-plt option. I have upgraded the gcc compiler version to 5.4.0, originally it was 4.8

First I configure as below:

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

Then I make as below:

make -C Python

I get the error :

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'

I am very new to this and do not know if I can remove -fno-plt option when compiling and if yes, how?


回答1:


You need to upgrade your GCC version.

The changelog page for GCC 6 says:

The option -fno-plt is now fully functional.

Thus, from GCC 6 you can use it.



来源:https://stackoverflow.com/questions/46504700/gcc-compiler-not-recognizing-fno-plt-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!