Unable for the life of me to install rpy2 - gcc error

I got so many different installation / build errors when trying to set up rpy2 on my Ubuntu 14.04 server in a virtual environment that I lost. This is the final step in setting up my iPython server, but I've been stuck on installing rpy2 for a few days now. I've tried a lot of different things, some of which I'm sure conflict with each other and make my life more difficult (like installing with a dual R version), but I give up trying to do it without help.

Various things I've done:

  • Installed python-dev and setuptools
  • Installed and updated protocol
  • Gcc installed and updated
  • Build and install the newest version of R from source
  • Build and install R development version (r-devel) from source using Dirk Eddelbuetel Docker file
  • [sudo] pip install rpy2 with stable R and R development
  • build rpy2 from source with stable R and R development (with --ignore-check-rversion option )
  • easy_install rpy2
  • install and install source code with and without R_HOME set to stable R (current default R is the unstable development version)

If anyone has any ideas what I can do to get this to work, besides starting from scratch in a clean environment, then please let me know - that would be greatly appreciated. Thank!

The current error I'm getting looks like this:

(.venv)zacp@contentvalue:~/rpy2-2.6.0$ python setup.py build_ext --ignore-check-rversion install
R Under development (unstable) (2015-06-16 r68524) -- "Unsuffered Consequences"
setup.py:196: UserWarning: R did not seem to have the minimum required version number
  warnings.warn("R did not seem to have the minimum required version number")
/usr/local/lib/R/bin/R CMD config --ldflags
R was not built as a library
/usr/local/lib/R/bin/R CMD config --cppflags
R was not built as a library
setup.py:211: UserWarning: No include specified
  warnings.warn('No include specified')
setup.py:222: UserWarning: No libraries as -l arguments to the compiler.
  warnings.warn('No libraries as -l arguments to the compiler.')

    Compilation parameters for rpy2 C components:
        include_dirs    = []
        library_dirs    = []
        libraries       = []
        extra_link_args = []

running build_ext
R Under development (unstable) (2015-06-16 r68524) -- "Unsuffered Consequences"
setup.py:77: UserWarning: R did not seem to have the minimum required version number
  warnings.warn("R did not seem to have the minimum required version number")
building 'rpy2.rinterface._rinterface' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -I./rpy/rinterface -I/usr/local/lib/python2.7.9/include/python2.7 -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-2.7/./rpy/rinterface/_rinterface.o
In file included from /usr/local/lib/python2.7.9/include/python2.7/Python.h:8:0,
                 from ./rpy/rinterface/_rinterface.c:55:
/usr/local/lib/python2.7.9/include/python2.7/pyconfig.h:1182:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
 #define _POSIX_C_SOURCE 200112L
 ^
In file included from /usr/include/signal.h:28:0,
                 from ./rpy/rinterface/_rinterface.c:51:
/usr/include/features.h:230:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from ./rpy/rinterface/_rinterface.c:58:0:
./rpy/rinterface/_rinterface.h:8:15: fatal error: R.h: No such file or directory
 #include <R.h>
               ^
compilation terminated.
error: command 'gcc' failed with exit status 1

      

+3


source to share


2 answers


I am assuming that the R version I installed with apt-get is out of date. R 3.0 is "probably OK" according to the documentation , and I guess I misinterpreted the warnings. Oops!



0


source


According to pip - Failed to install rpy2 on Ubuntu 14.04, missing R_ext / Rallocators.h: - Ask Ubuntu , you need something newer than R version 3.0. 2, and version 3.2 was fairly recent. This seems to be true, for example. for version 2.8.5 rpy2.



0


source







All Articles