stakaz
June 26, 2018, 9:04am
1
Hello, I am trying to use ccall in julia for the first time and I can’t make a simple call to libgsl:
ccall((:gsl_sf_gamma_inc_Q, :libgsl), Cdouble, (Cdouble, Cdouble), 0.2, 0.2)
returns:
ERROR: LoadError: error compiling anonymous: could not load library "libgsl"
/usr/lib/libgsl.so: undefined symbol: cblas_ctrmv
What is the problem here? I have cblas installed…
Thanks for help.
1 Like
It could be that your /usr/lib/libgsl.so
has its library dependencies set up incorrectly so it doesn’t know where an appropriate cblas is (ldd /usr/lib/libgsl.so
). You could try calling Libdl.dlopen
on an appropriate cblas library before the ccall
.
stakaz
June 27, 2018, 8:51am
3
I tried
Libdl.dlopen(:libgslcblas)
and
Libdl.dlopen(:libcblas)
But that did not solve the problem. However, I don’t know, how to determine, which library contains cblas_ctrmv
.
Try dlopening with the RTLD_LAZY|RTLD_DEEPBIND|RTLD_GLOBAL
flags.
2 Likes
stakaz
June 28, 2018, 12:05pm
5
Sorry, I don’t know how the dlopen call should look like with this flags. Could you help me with that?
Edit:just tried and was successful with
Libdl.dlopen(:libgslcblas, Libdl.RTLD_GLOBAL)
ccall((:gsl_sf_gamma_inc_Q, :libgsl), Cdouble, (Cdouble, Cdouble), 0.2, 0.3)
1 Like