Why an unknown gcc is required to compile spaCy? - python

When installing spaCy under Ubuntu, but I got the following compile error.
The installation code is simply using pip install spacy.
/opt/rh/devtoolset-2/root/usr/bin/gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/mnt/nfs/lijin/local/opt/include/python2.7 -I/tmp/pip-install-ikyFEg/spacy/include -I/mnt/nfs/lijin/local/opt/include/python2.7 -c spacy/parts_of_speech.cpp -o build/temp.linux-x86_64-2.7/spacy/parts_of_speech.o -O2 -Wno-strict-prototypes -Wno-unused-function
unable to execute '/opt/rh/devtoolset-2/root/usr/bin/gcc': No such file or directory
error: command '/opt/rh/devtoolset-2/root/usr/bin/gcc' failed with exit status 1
My system has a /usr/bin/gcc but not in /opt/rh/xxx. Can anyone help fix this problem? Thank you.

Related

g++ doesn't support "-ffast-math -march=native" arguments when I try to run python2 file in conda environment

I am trying to run a GitHub repository that is about SNNs. But, when I run the python script, I get a compiler error from the weave package.
Link: https://github.com/djsaunde/lm-snn/blob/master/code/train/csnn_pc_mnist.py
The code generates neuron groups and after that tried to apply STDP backpropagation algorith to them but brian.STDP object couldn't be generated beacuse of the compiler error.
Error
weave.build_tools.CompileError: error: Command "/home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/bin/x86_64-conda_cos6-linux-gnu-c++ -fno-strict-aliasing -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -DNDEBUG -fwrapv -O3 -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/include -fPIC -I/home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/lib/python2.7/site-packages/weave -I/home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/lib/python2.7/site-packages/weave/scxx -I/home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/lib/python2.7/site-packages/numpy/core/include -I/home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/include/python2.7 -c /home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/lib/python2.7/site-packages/weave/scxx/weave_imp.cpp -o /tmp/weave-mzp7-UMTCud/python27_intermediate/compiler_7d6a1f80b8499f1aba77652aa8d9d6d7/home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/lib/python2.7/site-packages/weave/scxx/weave_imp.o -MMD -MF /tmp/weave-mzp7-UMTCud/python27_intermediate/compiler_7d6a1f80b8499f1aba77652aa8d9d6d7/home/mzp7/workspace/DSNN/Examples/lm-snn/miniconda2/lib/python2.7/site-packages/weave/scxx/weave_imp.o.d -O3 -ffast-math -march=native" failed with exit status 1
x86_64-conda_cos6-linux-gnu-c++: error: unrecognized command line option '-ffast-math -march=native'; did you mean '-fsso-struct=native'?
I use the miniconda2 environment.
Conda package: libgcc
Pip packages:
numpy
matplotlib
scipy
brian
weave
sympy
networkx
pandas
sklearn
brian2
Thank you.

set compile flags when installing Python + C++ project

When pip-installing a Python project with C++ parts,
pip3 install . --verbose --user
the typical compile line will be something like
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/eigen3/ -I/usr/local/include/python3.7 -I/home/nschloe/.local/include/python3.7m -I/usr/include/python3.7m -c src/generate.cpp -o build/temp.linux-x86_64-3.7/src/generate.o
Explicitly setting CFLAGS like
OPT="" CFLAGS="" pip3 install . --verbose --user
results in
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/eigen3/ -I/usr/local/include/python3.7 -I/home/nschloe/.local/include/python3.7m -I/usr/include/python3.7m -c src/generate.cpp -o build/temp.linux-x86_64-3.7/src/generate.o
retaining most of the flags.
Question: Where are all the compiler options set? More specifically: How can I remove -g? (It's eating too much memory.)

Intel Galileo - greenlet.h:8:20: fatal error: Python.h: No such file or directory

I'm running Linux dev-tools image (link at the end) on my intel galileo. I tried to install greenlet but I got an error stating python.h no such file.
root#clanton:/media/realroot/greenlet-0.4.2# python setup.py install
running install
running build
running build_ext
creating /tmp/tmpuKbWhk/tmp
creating /tmp/tmpuKbWhk/tmp/tmpuKbWhk
i586-poky-linux-uclibc-gcc -m32 -march=i586 -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -fno-tree-dominator-opts -I/usr/include/python2.7 -c /tmp/tmpuKbWhk/simple.c -o /tmp/tmpuKbWhk/tmp/tmpuKbWhk/simple.o
/tmp/tmpuKbWhk/simple.c:1:6: warning: function declaration isn't a prototype [-Wstrict-prototypes]
building 'greenlet' extension
creating build
creating build/temp.linux-i586-2.7
i586-poky-linux-uclibc-gcc -m32 -march=i586 -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -fno-tree-dominator-opts -I/usr/include/python2.7 -c greenlet.c -o build/temp.linux-i586-2.7/greenlet.o
In file included from greenlet.c:5:0:
greenlet.h:8:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'i586-poky-linux-uclibc-gcc' failed with exit status 1**
I know there are many posts with the same python.h error but my problem is the Linux image I have can't run sudo or apt commands
I need to setup python-dev environment onto my Linux image running on Galileo board.
Link to the Linux dev-tools image I'm using is here below.
http://telekinect.media.mit.edu/galileo/image-devtools-1.0.1-2.tar.bz2
p.s. it has gcc and python2.7 already.

Errors while compiling Python with SSL support

I'm trying to compile Python 2.7.3 on Centos6. Almost everything works ok, except the thing I really need ^^.
When I type make, I'm getting the error:
building '_ssl' extension
gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/local/include -I/root/Python-2.7.3/Include -I/root/Python-2.7.3 -c /root/Python-2.7.3/Modules/_ssl.c -o build/temp.linux-i686-2.7/root/Python-2.7.3/Modules/_ssl.o
gcc -pthread -shared build/temp.linux-i686-2.7/root/Python-2.7.3/Modules/_ssl.o -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-i686-2.7/_ssl.so
*** WARNING: renaming "_ssl" since importing it failed: build/lib.linux-i686-2.7/_ssl.so: undefined symbol: krb5_auth_con_getrcache
And at the end I'm getting a message that the build failed for module _ssl (something like this).
Have you ever faced this problem? I have installed both OpenSSL (0.9.8e fips) and OpenSSL-dev.
Make sure the right paths to openssl-dev (lib and include) are in your Makefile

How to set CFLAGS and LDFLAGS to compile pycrypto

I am trying to install the fabric library to an old machine. There are some legacy libraries in /usr/lib, such as libgmp.
(py27)[qrtt1#hcservice app]$ ls /usr/lib|grep gmp
libgmp.a
libgmp.so
libgmp.so.3
libgmp.so.3.3.3
libgmpxx.a
libgmpxx.so
libgmpxx.so.3
libgmpxx.so.3.0.5
I have compiled the libgmp 5.x in my $HOME/app, and then am trying to install pycrypto (it is the dependency of fab):
CFLGAS=-I/home/qrtt1/app/include LDFLGAS=-L/home/qrtt1/app/lib pip install pycrypto
I observed that none of my include or lib directories are in the in the compilation / linking options:
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/home/qrtt1/app/include/python2.7 -c src/_fastmath.c -o build/temp.linux-i686-2.7/src/_fastmath.o
gcc -pthread -shared build/temp.linux-i686-2.7/src/_fastmath.o -lgmp -o build/lib.linux-i686-2.7/Crypto/PublicKey/_fastmath.so
building 'Crypto.Hash._MD2' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/home/qrtt1/app/include/python2.7 -c src/MD2.c -o build/temp.linux-i686-2.7/src/MD2.o
gcc -pthread -shared build/temp.linux-i686-2.7/src/MD2.o -o build/lib.linux-i686-2.7/Crypto/Hash/_MD2.so
building 'Crypto.Hash._MD4' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/home/qrtt1/app/include/python2.7 -c src/MD4.c -o build/temp.linux-i686-2.7/src/MD4.o
gcc -pthread -shared build/temp.linux-i686-2.7/src/MD4.o -o build/lib.linux-i686-2.
How do I assign the CFLAGS and LDFLAGS correctly for building pycrypto ?
I try to download pycrypto-2.5 and install it:
(py27)[qrtt1#hcservice pycrypto-2.5]$ CFLGAS=-I/home/qrtt1/app/include LDFLGAS=-L/home/qrtt1/app/lib python setup.py install
No CFLAGS or LDFLAGS set up with it. May be the pycrypto-2.5 going wrong ?
Please check what you have typed :
CFLAGS=-I/home/qrtt1/app/include LDFLAGS=-L/home/qrtt1/app/lib pip install pycrypto
it should be CFLAGS

Categories