I got an error in R when building the rPython package, specifically the part that links against libpython2.7:
gcc -std=gnu99 -I/foo/bar/R-3.1.1/lib64/R/include -DNDEBUG -I/usr/local/include \
-I/foo/bar/Python-2.7.6/include/python2.7 -I/foo/bar/Python-2.7.6/include/python2.7 \
-D PYTHONLIBFILE=libpython2.7.so -fpic -g -O2 -c pycall.c -o pycall.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o rPython.so pycall.o \
-lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic
/usr/bin/ld: error: cannot find -lpython2.7
The problem seems to be that while R (or rPython) understood which -I rules to compile with my Python installation, it did not add the corresponding linker flags. I don't know why, suppose it's a bug.
I had also the same problem and I could solve it simply by installing python-dev package, I saw it in some forums to be honest.
You can install this from the terminal using:
sudo apt-get install python-dev
and then re-try to install rPython again.
It worked for me!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With