Closed pcarbo closed 6 years ago
Thank you for your report. I will look into it. It sounds like it has something to do with the first load of the package, where the pre-compiling happens. Perhaps, on linux, julia does not want the R process to write to the julia library.
This replicates on linux for me.
@phaverty I still have an error, e.g., on my MacBook Pro:
> j2r("using LowRankApprox;")
could not spawn `/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia -Ccore2 -J/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib --compile=yes --depwarn=yes -O0 --output-ji /Users/pcarbo/.julia/lib/v0.6/LowRankApprox.ji --output-incremental=yes --startup-file=no --history-file=no --color=no --eval 'while !eof(STDIN)
eval(Main, deserialize(STDIN))
end
'`: permission denied (EACCES)
As before, running using LowRankApprox
in Julia resolves the issue.
Aha! This is related to an issue in julia 6.0: https://github.com/JuliaLang/julia/issues/14577 This is fixed on julia master, but does not appear to have made it to the list for 6.1 The JuliaCall package has addressed this by having a special function for loading julia packages. Their function does a system call to a new julia process that load the package, precompiles and quits. Then they can call "using Package" without error. We could do the same. Hmm.
I have followed JuliaCall's example and forced precompilation in a second julia process before loading the package in the julia process that is linked to the user's R session.
@phaverty I think it works! At least I did not get an error when I did this:
library(rjulia)
jDo("using LowRankApprox")
# Doing 'using LowRankApprox' in a separate thread to force precompilation ...
# NULL
Great! I've checked that I can subsequently use the loaded package. Sorry that took me a while to figure out.
I am using rjulia 0.10-1 with R 3.4.1 and Julia 0.6.0 in Linux (Scientific Linux 7). We have found rjulia to be very useful (albeit a bit unstable probably due to substantial changes to Julia).
After installing a package, I discovered that I have to run the
using
command in Julia before it is accessible in R; e.g.,If I don't do this, I get an error something like this:
This seems to be a Linux-specific bug; I don't get this problem on a Mac.