JuliaInterop / JuliaCall

Embed Julia in R
https://non-contradiction.github.io/JuliaCall/index.html
Other
267 stars 36 forks source link

`julia_setup` unable to run the "global level startup file" #105

Closed sylvaticus closed 5 years ago

sylvaticus commented 5 years ago

julia_setup seems unable to run the "global level startup file" (???):

> library(JuliaCall)
> julia <- julia_setup()
sh: 1: Executing global level startup file../julia: not found
Error in system2(file.path(.julia$bin_dir, "julia"), shQuote(command),  : 
  error in running command

I have julia on my path and I did also try (with the same result) using:

> julia <- julia_setup(JULIA_HOME = "/home/lobianco/lib/julia-1.1.0/bin")
sh: 1: Executing global level startup file../julia: not found
Error in system2(file.path(.julia$bin_dir, "julia"), shQuote(command),  : 
  error in running command 

I have tried with Julia 0.7 and 1.0 with the same result.

Non-Contradiction commented 5 years ago

Thanks for the feedback.

What will happen if Julia is started directly? And what will happen if you execute Base.load_julia_startup() in Julia?

sylvaticus commented 5 years ago

Julia has two startup files, one at at [JULIA_HOME]/etc/julia/startup.jl for site-specific commands and one at ~/.julia/config/startup.jl for user-specific ones.

From my tests it is enough to set on any of them a simple println("Hello world") to trigger the error, i.e. JuliaCall seems to not work if the startup files of Julia are used:

image

Note that if I rather leave uncommented the workspace function definition and I remove the pritnln(s) it works.. it just JuliaCall doesn't like the prints in the setup files..

Non-Contradiction commented 5 years ago

Thanks for the brilliant observation! I think the problem is just the println function. JuliaCall uses the command line to get information about Julia, and println messes the command line output. So commenting println out is likely to solve the problem, and I'm also working on a solution now.

Non-Contradiction commented 5 years ago

The problem should be fixed on the master.