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

Issue installing RCall #102

Closed
rszoh opened this Issue Apr 18, 2016 · 13 comments

Comments

Projects
None yet
3 participants
@rszoh
Copy link

rszoh commented Apr 18, 2016

I am trying to use RCall on the Linux server. I get the following error however and I am not sure what it is.

ERROR: InitError: cglobal: could not find symbol R_NilValue in library
in init at /data/rszoh/.julia/v0.4/RCall/src/setup.jl:113
in _require_from_serialized at loading.jl:84
in _require_from_serialized at ./loading.jl:109
in require at ./loading.jl:235
during initialization of module RCall

@rszoh rszoh changed the title Another issue Issue intalling RCall Apr 18, 2016

@rszoh rszoh changed the title Issue intalling RCall Issue installing RCall Apr 18, 2016

@simonbyrne

This comment has been minimized.

Copy link
Member

simonbyrne commented Apr 19, 2016

What version of R are you using?

@rszoh

This comment has been minimized.

Copy link
Author

rszoh commented Apr 19, 2016

I am using : R version 3.2.2 (2015-08-14) -- "Fire Safety"

@simonbyrne

This comment has been minimized.

Copy link
Member

simonbyrne commented Apr 19, 2016

Hmm, that's odd.

Can you give more details on:

  • system & OS
  • Julia version (the output of versioninfo())
  • the R location by running,
    • R RHOME at the shell,
    • R.home() in R, and
    • Base.compilecache("RCall") in Julia
@rszoh

This comment has been minimized.

Copy link
Author

rszoh commented Apr 19, 2016

Here there are:

Julia Version 0.4.6-pre+24
Commit d939abb (2016-04-17 03:57 UTC)
Platform Info:
System: Linux (x86_64-redhat-linux)
CPU: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.3

R.home()
[1] "/share/apps/R-latest/lib64/R"

[rszoh@compute-1-14 ~]$ R RHOME
/share/apps/R-latest/lib64/R

I should mentioned that to start R on the server, I have to do:
[rszoh@compute-1-14 ~]$ module load R-latest

julia> Base.compilecache("RCall")
R installation found at "/share/apps/R-latest/lib64/R"
"/data/rszoh/.julia/v0.4/lib/v0.4/RCall.ji"

@simonbyrne

This comment has been minimized.

Copy link
Member

simonbyrne commented Apr 19, 2016

I should mentioned that to start R on the server, I have to do:
[rszoh@compute-1-14 ~]$ module load R-latest

Ah, this could be the issue. Do you know what's in that modulefile?

@rszoh

This comment has been minimized.

Copy link
Author

rszoh commented Apr 19, 2016

I have no clue. How do I find that out?

@rszoh

This comment has been minimized.

Copy link
Author

rszoh commented Apr 20, 2016

As I keep trying I get this (maybe that helps):

julia> Pkg.build("RCall")

julia> using RCall
ERROR: InitError: cglobal: could not find symbol R_NilValue in library
in init at /data/rszoh/.julia/v0.4/RCall/src/setup.jl:113
in _require_from_serialized at loading.jl:84
in _require_from_serialized at ./loading.jl:109
in require at ./loading.jl:235
during initialization of module RCall

julia> using RCall

julia> reval("1+2")
ERROR: ccall: could not find function Rf_mkCharLen in library
in reval at /data/rszoh/.julia/v0.4/RCall/src/iface.jl:40

@simonbyrne

This comment has been minimized.

Copy link
Member

simonbyrne commented Apr 20, 2016

I have no clue. How do I find that out?

I've never used modules, so can't be much help, but you could try:

module display R-latest

this article might also be useful:
http://www.admin-magazine.com/HPC/Articles/Environment-Modules

@rszoh

This comment has been minimized.

Copy link
Author

rszoh commented Apr 20, 2016

ok one more question:
I am not sure what is this line doing in the setup.jl (line 38)
const libR = Libdl.find_library(["libR"],[joinpath(Rhome,"lib")])

@dmbates

This comment has been minimized.

Copy link
Contributor

dmbates commented Apr 20, 2016

Ultimately everything in RCall package ends up calling a C function or obtaining a C global value in the shared object (DLL, dynamic library - whatever the preferred term is) called libR. The RCall package needs to know the location of that library on your system, Your error messages like not finding the function Rf_mkCharLen in the library means that the dynamic library that was found didn't have the expected symbols in it.

The call Libdl.find_library(["libR"]) by itself looks on the directories in the ld configuration. (This is the Linux term, I don't know about Windows and OS X).

$ ldconfig -p | egrep libR.so
        libR.so (libc6,x86-64) => /usr/lib/libR.so

In my case, that's enough information to find it.

$ julia -e 'println(Libdl.find_library(["libR"]))'
libR

Sometimes the way R is installed doesn't put it on the default paths. Instead it is in the lib subdirectory of Rhome which is determined in the previous line. Usually running R RHOME in the shell will return the desired value.

@rszoh

This comment has been minimized.

Copy link
Author

rszoh commented Apr 20, 2016

Issue resolved! but I got more
@dmbates Thank you so much for pointing us to the right direction! So after creating a libR.so file in $R_HOME/lib and recompiling things work - but not quiet perfectly. How do I make julia use my personal R packages file?

@simonbyrne

This comment has been minimized.

Copy link
Member

simonbyrne commented Apr 28, 2016

@simonbyrne

This comment has been minimized.

Copy link
Member

simonbyrne commented Apr 29, 2016

Please reopen if there is anything else to be done here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.