When I have a “simple” fortran program with a singular module, I can reference the symbols simply by copying the symbol name from the result of the nm
command:
x = ccall((:__mod_julfort_MOD_dot, "path/to/my/lib.so"),
Float64,
(Ref{Int64}, Ptr{Float64}, Ptr{Float64}),
l, arrx, arry)
However, I have a larger library with many different modules, so nm instead returns something like
00000000000ef4e0 T __my_mod_name.my_MOD_function_name
Simply copying __my_mod_name.my_MOD_function_name
doesn’t work because the .
is not a recognized syntax, and replacing .
with _
like
x = ccall((:__my_mod_name_my_MOD_function_name, "path/to/my/lib.so"),
...
Returns the error
Error: ErrorException("could not load symbol \"__my_mod_name_my_MOD_function_name\":\n../path/to/my/lib.so: undefined symbol: __my_mod_name_my_MOD_function_name")
How do I correctly call this function using ccall
?