armgong / rjulia

R package which integrating R and Julia
GNU General Public License v2.0
146 stars 23 forks source link

rjulia.so not found #21

Closed st-lenk86 closed 8 years ago

st-lenk86 commented 8 years ago

Hi,

I am trying to install RJulia under Ubuntu 15.04 (64 bit). My installed Julia version is 0.3.11 and my R version is 3.2.2. Everything goes just fine until R tests if the new package can be loaded, Then R is apparently not able to find rjulia.so . The error message looks like this:

** R
** demo
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'rjulia', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: cannot load shared object '~/R/x86_64-pc-linux-gnu-library/3.2/rjulia/libs/rjulia.so':
  libjulia.so: Cannot load shared object file: File or directory not found
Error: Loading failed
Execution halted
ERROR: loading failed
* removing ‘~/R/x86_64-pc-linux-gnu-library/3.2/rjulia’
E: Command failed (1)

What is going wrong? Help is very much appreciated.

armgong commented 8 years ago

i don't have Ubuntu 15.04 right now ,but the error message show libjulia.so not loaded. could you run this command in tty and give me the output julia -E 'abspath(Sys.dlpath("libjulia"))'

st-lenk86 commented 8 years ago

The command returned:

/usr/lib/x86_64-linux-gnu/julia/libjulia.so
armgong commented 8 years ago

try these lines in R console ,and see what happens

.juliaLib <- function() gsub("\"", "", system('julia -E "abspath(Sys.dlpath(\"libjulia\"))"', intern = TRUE))

.ldjulia <<- .juliaLib() .ldjulia dyn.load(.ldjulia, local = FALSE)

st-lenk86 commented 8 years ago

I entered these lines into the R console and tried to install RJulia again, but it fails with the same error as before.

armgong commented 8 years ago

I install ubuntu 15.04 in docker ,and R is 3.1.2 julia is 0.3.10 , install ok,but when julia_init() there are problem, because jl_init() in julia api have some bug( I will try to fix this). as a temp fix you can ln -s /usr/lib/x86_64-linux-gnu/julia/libjulia.so /usr/lib/libjulia.so ln -s /usr/lib/x86_64-linux-gnu/julia /usr/lib/julia

armgong commented 8 years ago

after try Julia 0.4 RC and 0.5 nightly and rjulia on ubuntu 15.04 ,they are both run smooth , I will not fix this bug on 0.3 ( so please use the temp fix) . julia 0.4 will release soon ,after that rjulia will not support 0.3 anymore.

btw, I also suggest you use julia 0.4, the last nightly on ubutun 15.04 is https://launchpad.net/~staticfloat/+archive/ubuntu/julianightlies/+files/julia_0.4.0-2664~ubuntu15.04.1_amd64.deb

st-lenk86 commented 8 years ago

Thank you for your help. Now it is working.