Can't pip install with gcc version 4.4.7
I'm trying to install asap3 with (python 2.7) pip, on the steno cluster at University of Copenhagen.
The compiler I have available is gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
.
When I run pip install --upgrade --user ase asap3
I get the following error
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -UNDEBUG -IBasics -IInterface -IBrenner -ITools -IPTM -IPTM/qcprot -IPTM/voronoi -I/kemi/falco/anaconda-2.1.0/lib/python2.7/site-packages/numpy/core/include -I/kemi/falco/anaconda-2.1.0/include/python2.7 -c Basics/AsapObject.cpp -o build/temp.linux-x86_64-2.7/Basics/AsapObject.o -std=c++11 -ffast-math -march=native -Wno-sign-compare -Wno-write-strings
cc1plus: error: unrecognized command line option "-std=c++11"
error: command 'gcc' failed with exit status 1
After googling for a bit, it turns out that -std=c++11
only works for newer gcc compilers (at least newer than 4.4).
See http://stackoverflow.com/questions/14674597/cc1plus-error-unrecognized-command-line-option-std-c11-with-g
I downloaded the source from PyPI and changed setup.py
line 71 to
extra_compile_args = ['-std=c++0x']
and installed with python setup.py install --user --with-mkl
.
This worked fine!