Building R (cran) + rpy2 on ubuntu & # 8594; libRblas.so not found

I am trying to create R (tested 2.14.2 and 2.15) and rpy2 (2.2.6, python 2.7.1) on ubuntu (11.04, natty narwhal) to expand it into a user directory (in the following title / home / me / lib / R), since I do not have root access, but you need a newer version than the one available on the server.

Assembly details, etc. below, but even when running rpy2 tests, I always get the following error:

/home/me/lib/pythonlib/lib/python/rpy2/rinterface/__init__.py in <module>() ---> 87 from rpy2.rinterface._rinterface import * ImportError: libRblas.so: cannot open shared object file: No such file or directory WARNING: Failure executing file: <experiments/arrangement/test_smacof_arrange.py> 

I am sure that I am calling the correct rpy2 module (my custom built-in), which was created against a custom version of R. For this, I do the following:

  • I first create an ubuntu R base

     wget http://cran.r-project.org/bin/linux/ubuntu/natty/r-base_2.14.2.orig.tar.gz # untar and go to directory # enable-R-shblib flag is needed for rpy2 linking, enable-BLAS-shlib was included # because I hoped to solve the problem, which doesnt change anything however ./configure --enable-R-shlib --enable-BLAS-shlib --prefix=/home/me/lib/R make make install 
  • Then I create rpy2 for this R assembly

     wget http://pypi.python.org/packages/source/r/rpy2/rpy2-2.2.6.tar.gz # untar and go to directory # build rpy2, by providing the r-home-lib and r-home flags, and deploy to custom dir python setup.py build --r-home /home/me/lib/R --r-home-lib /home/me/lib/R/lib64/R/lib install --home /home/me/lib/pythonlib 

    I also adapted my pythonpath to search for modules in / home / me / lib / pythonlib, so there is no problem there. The python string returns the correct configuration (note that Rblas is displayed here!)

     Configuration for R as a library: include_dirs: ('/home/me/lib/R/lib64/R/include',) libraries: ('R', 'Rblas', 'Rlapack') library_dirs: ('/home/me/lib/R/lib64/R/lib',) extra_link_args: () 

I tried to track the error, but this is not the end. / home / me / lib / R / lib 64 / R / lib contains libRblas.so, but there is one thing that seems odd, however, that libRblas.so is not properly associated with libR.so, but I'm not sure if it is causes an error, and I don’t know how to fix it.

 >> ldd -d libR.so linux-vdso.so.1 => (0x00007fffcec58000) libRblas.so => not found libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007fe63d21d000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe63cf97000) ... 

Any help would be greatly appreciated!

+4
source share
2 answers

For others encountering this problem, I was able to solve it by adding the R libraries to my library path in bashrc:

 export LD_LIBRARY_PATH="R-install-location/lib65/R/lib:$LD_LIBRARY_PATH" 
+4
source

Short:

  • Why build R on Ubuntu? Just grab existing and current binaries from the CRAN repository according to the README at http://cran.r-project.org/bin/linux/ubuntu - these are the ports of existing Debian packages available through CRAN to overcome the normal Ubuntu publishing delay.

  • Whenever I need a newer (smaller) package on Ubuntu, I just take the Debian files and restore them to Ubuntu. The network should have enough HOWTO on how to create a package; minimum: a) down the triplet .orig.tar.gz, .diff.gz and .dsc and use dpkg-sourcepackage -x *.dsc to expand, and then b) change to the directory and run sudo debian/rules binary (if provided that you have everything Build- Depends: the packages are installed). You can even use apt-get to complete these steps, but that is a bit beyond the scope of this question ...

+2
source

Source: https://habr.com/ru/post/1415976/


All Articles