JuliaInterop / JuliaCall

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

juliacall fails in julia 1.11 with `undefined symbol: jl_stdout_obj` #234

Open schlichtanders opened 2 months ago

schlichtanders commented 2 months ago

Hi there, I just tried out julia 1.11 because it has support for caching compile files. Unfortunately R-JuliaCall fails with some problems. Trying to replicate it in a mwe, I found this incompatbility.

julia> import Pkg; Pkg.add("CondaPkg")

julia> using CondaPkg

julia> CondaPkg.add("r"); CondaPkg.add("r-juliacall")

julia> envdir = CondaPkg.envdir()
"/root/.julia/environments/v1.11/.CondaPkg/env"

julia> localpreferences = """
       [RCall]
       Rhome = "$envdir/lib/R"
       libR = "$envdir/lib/R/lib/libR.so"
       """

julia> write(joinpath(dirname(Base.active_project()), "LocalPreferences.toml"), localpreferences)

julia> import Pkg; Pkg.add("RCall")

julia> using RCall

julia> reval("""
       library(JuliaCall)
       julia_setup(installJulia=TRUE)
       """)
┌ Warning: CHOLMOD version incompatibility
│ 
│ Julia was compiled with CHOLMOD version 4.0.4. It is
│ currently linked with version 5.2.1.
│ This might cause Julia to terminate when working with
│ sparse matrix factorizations, e.g. solving systems of
│ equations with \.
│ 
│ It is recommended that you use Julia with the same major
│ version of CHOLMOD as the one used during the build, or
│ download the generic binaries from www.julialang.org,
│ which ship with the correct versions of all dependencies.
└ @ SparseArrays.CHOLMOD ~/.julia/environments/v1.11/.CondaPkg/env/share/julia/stdlib/v1.10/SparseArrays/src/solvers/cholmod.jl:206
Segmentation fault (core dumped)

restarting julia after this segmenation fault and running the below, gives another error:

julia> using RCall

julia> reval("""
       library(JuliaCall)
       julia_setup(installJulia=TRUE)
       """)
ERROR: REvalError: Julia version 1.11.0-rc3 at location /usr/local/julia/bin will be used.
Error: jl_stdout_obj - /usr/local/julia/bin/../lib/libjulia.so.1.11: undefined symbol: jl_stdout_obj
edwardlavender commented 3 weeks ago

Any updates or suggestions regarding this issue? I am running into the same error! Thanks!

schlichtanders commented 2 weeks ago

I tested it now again with julia 1.11 and part of the issue is still there unfortunately... for me now it fails immediately with the error undefined symbol: jl_stdout_obj

The conda pkg r-juliacall still depends on the conda julia 1.10. Maybe it is because of this. It would be great, if it already supports julia 1.11 even thouth julia 1.11 is not yet available via conda-forge.

@Non-Contradiction can you look into this issue? Now with julia 1.11 being released, potentially a lot of people may run into this issue

PallHaraldsson commented 1 week ago

FYI: See my alternative fix proposal (partial revert in Julia) at: https://github.com/JuliaLang/julia/pull/53250#issuecomment-2429275901

I could make such a PR, I want to see first about a response there, since I can't actually merge anyway there or here... so nothing is fully in my hands (nor my responsibility...).