JuliaCall icon indicating copy to clipboard operation
JuliaCall copied to clipboard

`julia_setup()` cannot find `libjulia.1.dylib` when Julia is installed via `juliaup`

Open gadenbuie opened this issue 3 years ago • 8 comments

I've also run into the issues described in https://github.com/JuliaLang/juliaup/issues/262

Here's what I did on macOS on a machine where Julie was not yet installed:

brew install juliaup
juliaup add release
#> Installing Julia 1.7.2+0 (x64).

Then when trying to knit an Rmd with a julia engine, I see the equivalent of the following (edited for readability).

JuliaCall:::julia_setup()
#> Julia version 1.7.2 at location /Users/garrick/.julia/juliaup/julia-1.7.2+0~x64/bin will be used.
#> ERROR: could not load library "libjulia.1.dylib"
#> dlopen(libjulia.1.dylib, 0x0001): tried: 
#> '/Users/garrick/.julia/juliaup/julia-1.7.2+0~x64/lib/julia/libjulia.1.dylib' (no such file), 'libjulia.1.dylib' (no such file), 
#> '/Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libjulia.1.dylib' (no such file), 
#> '/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjulia.1.dylib' (no such file), 
#> '/Users/garrick/libjulia.1.dylib' (no such file)

In RStudio this causes a segfault.

gadenbuie avatar May 10 '22 19:05 gadenbuie

I was also having this issue but I was able to do the setup after installing the development version via devtools::install_github("Non-Contradiction/JuliaCall")

fazepher avatar Jul 18 '22 14:07 fazepher

@fazepher Thanks for the feedback! I will try to release the development version on CRAN soon. @gadenbuie Would you check if the development version solves the problem?

Non-Contradiction avatar Jul 18 '22 20:07 Non-Contradiction

I have encounter the following after updating R-studio. Currently I have reinstalled R, S-Studio (4.3.1) and julia (1.9). But the troubble is remaine the same as after updating the software. So kindly see the isuue below and suggest me something JuliaCall

Faraz564 avatar Jun 22 '23 11:06 Faraz564

Just to confirm, I also see the same error as @Faraz564 when I run the reprex code in my OP:

JuliaCall:::julia_setup()
#> Julia version 1.9.1 at location /Users/garrick/.julia/juliaup/julia-1.9.1+0.aarch64.apple.darwin14/bin will be used.
#> Loading setup script for JuliaCall...
#> LoadError("/Users/garrick/Library/R/arm64/4.3/library/JuliaCall/julia/setup.jl", 16, LoadError("/Users/garrick/Library/R/arm64/4.3/library/JuliaCall/julia/JuliaObject.jl", 75, ErrorException("syntax: Global method definition around /Users/garrick/Library/R/arm64/4.3/library/JuliaCall/julia/JuliaObject.jl:77 needs to be placed at the top level, or use \"eval\"."))) Error in .julia$cmd(paste0(Rhomeset, "Base.include(Main,\"", system.file("julia/setup.jl",  :
#>   Error happens when you try to execute command ENV["R_HOME"] = "/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources";Base.include(Main,"/Users/garrick/Library/R/arm64/4.3/library/JuliaCall/julia/setup.jl") in Julia.
#>                         To have more helpful error messages,
#>                         you could considering running the command in Julia directly

gadenbuie avatar Jun 22 '23 17:06 gadenbuie

@gadenbuie @Faraz564 I'm also seeing the same issue with the same error message. Some guidance would very much be appreciated, @Non-Contradiction.

FabianBarrett avatar Jul 27 '23 20:07 FabianBarrett

I ran into the same issue using JuliaCall version 0.17.5, R version 4.1.2, Julia 1.8.5. Installing the github version of JuliaCall with all dependencies resolved the issue for me.

vh94 avatar Aug 10 '23 14:08 vh94

@vh94 Thank you for the pointer; installing via devtools::install_github("Non-Contradiction/JuliaCall") also resolved the issue for me.

FabianBarrett avatar Aug 16 '23 08:08 FabianBarrett

I was also having this issue but I was able to do the setup after installing the development version via devtools::install_github("Non-Contradiction/JuliaCall")

Hi could you please share the code how you solve this error, How you change the version? Thank You

Shafique313 avatar Sep 23 '23 04:09 Shafique313