Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load dynamic library #15

Closed
ntthung opened this issue Oct 27, 2020 · 2 comments
Closed

Unable to load dynamic library #15

ntthung opened this issue Oct 27, 2020 · 2 comments

Comments

@ntthung
Copy link

ntthung commented Oct 27, 2020

Hi Dirk,

I am using the package Rfast, which imports RcppZiggurat. I got the following error when running Rfast on a Linux cluster (Red Hat 6.10)

unable to load shared object '/home/users/sutd/R/x86_64-pc-linux-gnu-library/3.6/RcppZiggurat/libs/RcppZiggurat.so':
  libgsl.so.0: cannot open shared object file: No such file or directory

The packages are installed on my local directory. Edited: I've done some diagnostic and found that this only happens when the Rfast functions are being called in parallel, in a foreach() loop. When they are called directly it is OK.

Below are something I've tried but failed:

I know that libgsl.so is located in /usr/lib64/, so I've added the following line at the beginning of my R script

Sys.setenv(LD_LIBRARY_PATH=paste("/usr/lib64/", Sys.getenv("LD_LIBRARY_PATH"), sep = ":"))

I have also try to do dyn.load('/usr/lib64/libgsl.so') but I get the following error

 Error in dyn.load("/usr/lib64/libgsl.so") :
  unable to load shared object '/usr/lib64/libgsl.so':
  /usr/lib64/libgsl.so: undefined symbol: cblas_ctrmv

On Windows everything works fine.

Is this an issue or am I doing something wrong?

Thank you so much.

@eddelbuettel
Copy link
Owner

eddelbuettel commented Oct 27, 2020

I fear that is between you and your RHEL machine as CRAN is happy (and has generally been):

image

Same of course on, say, my local box (running standard Ubuntu):

edd@rob:~$ ldd /usr/local/lib/R/site-library/RcppZiggurat/libs/RcppZiggurat.so | grep gsl
        libgsl.so.23 => /usr/lib/x86_64-linux-gnu/libgsl.so.23 (0x00007fa8fed3f000)
        libgslcblas.so.0 => /usr/lib/x86_64-linux-gnu/libgslcblas.so.0 (0x00007fa8fe314000)
edd@rob:~$ dpkg -S /usr/lib/x86_64-linux-gnu/libgsl.so.23
libgsl23:amd64: /usr/lib/x86_64-linux-gnu/libgsl.so.23
edd@rob:~$ 

i.e. the standard GSL shared library from the standard GSL package (I happen to be the Debian maintainer for it too) is used.

It really only affects an example, so you could take the scissors to the package and #ifdef out the GSL use.

@eddelbuettel
Copy link
Owner

And Crossposted to StackOverflow which seems to indicate you did not set up your parallel code right. I think Rui is correct and you need to register the cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants