Stream: helpdesk (published)

Topic: Default library path for `ccall` and `llvmcall`


view this post on Zulip Brenhin Keller (Jul 24 2022 at 17:47):

Say I write something like

julia> ccall(:printf, Int, (Cstring,), "hello there!\n")
hello there!
13

i,e,. without explicitly specifying a path to a library… what determines the default set of paths Julia will search for the printf function?

view this post on Zulip Brenhin Keller (Jul 24 2022 at 17:48):

(x-posted on slack, will update either if I get an answer)

view this post on Zulip Sukera (Jul 24 2022 at 17:56):

it should check the usual library paths, since iirc it just delegates that to dlsym

view this post on Zulip Sukera (Jul 24 2022 at 17:56):

or LD_LIBRARY_PATH on linux, or the other usual places for libraries, which is system dependent

view this post on Zulip Sukera (Jul 24 2022 at 17:56):

e.g. Windows also checks the current directory, IIRC

view this post on Zulip Mosè Giordano (Jul 24 2022 at 17:57):

Symbols in libraries dlopened with RTLD_GLOBAL are available without specifying the library (which is also a good way to get clashes between different libraries providing same symbols)


Last updated: Oct 02 2023 at 04:34 UTC