Hello,
Is there anybody around who could help to debug the following error:
ufechner@TUD277255:~/00Software/mexjulia$ matlab
fatal: error thrown and no exception handler available.
Base.InitError(mod=:Sys, error=ErrorException("could not load symbol "jl_array_cconvert_cstring":
/usr/local/MATLAB/R2016b/bin/glnxa64/MATLAB: undefined symbol: jl_array_cconvert_cstring"))
rec_backtrace at /home/ufechner/julia/src/stackwalk.c:84
record_backtrace at /home/ufechner/julia/src/task.c:232
jl_throw at /home/ufechner/julia/src/task.c:550
jl_errorf at /home/ufechner/julia/src/builtins.c:78
jl_dlerror at /home/ufechner/julia/src/dlload.c:69 [inlined]
jl_dlsym at /home/ufechner/julia/src/dlload.c:24
Hello,
I do not really understand, how your answer relates to my question. I am not using RTLD_GLOBAL. I want to rephrase my question:
I am trying to call Julia from Matlab on Ubuntu;
this crashes Matlab with the error message “undefined symbol: jl_array_cconvert_cstring”;
as far as I understand, it works fine on Mac and Windows.
What I do NOT understand:
why should the version of the C++ standard library that is linked to Matlab/ Julia should create any problem? If a pure C function interface is used, this should not matter.
Does anybody understand, what could be the reason for this problem?
Any comments welcome.
Uwe
Not sure what you are talking about. You need to make sure libjulia is dlopen’d with RTLD_GLOBAL since otherwise you’ll get the error you see. This is not a julia issue at all but a MATLAB issue. You need to figure out how to embed something into MATLAB cleanly.
Perhaps try this suggestion in the thread linked earlier?
It means to make this call: dlopen("[...]/libjulia", RTLD_GLOBAL) from the mexfile before doing anything else with libjulia.
Accurate, sadly: much of “keeping the lights on” in modern computer systems ends up as a fight against build systems and concepts like “symbol coalescing” and “side-by-side assemblies” and “duplicate typeinfo”.