Hi - I recently updated from Julia v1.7 to v1.9. In using find_library from Libdl.jl package, get different behavior. In v1.7, find_library will work without specifying extension while in v1.9 it doesn’t. Both can find a specified library if extension added. Note that this is for a non-system library that is user created/compiled.
juliav1.7:
using Libdl
julia> find_library(“librtlsdr”)
“librtlsdr”
julia> find_library(“librtlsdr.so”)
“librtlsdr.so”
juliav1.9
julia> find_library(“librtlsdr”)
“”
julia> find_library(“librtlsdr.so”)
“librtlsdr.so”
In reviewing Libdl, it doesn’t look like anything has change. However, I did notice that OpenLibm_jll version changed from 0.7.5 to 0.8.1.
mkitti
June 19, 2023, 9:32pm
2
Run julia
with environment variable LD_DEBUG=libs
. For example,
$ LD_DEBUG=libs julia
...
julia> using Libdl
julia> find_library("libz")
91835: find library=libz [0]; searching
91835: search path=/home/mkitti/src/julia-1.9.0/bin/../lib/julia:/home/mkitti/src/julia-1.9.0/bin/../lib/julia/.. (RUNPATH from file julia)
91835: trying file=/home/mkitti/src/julia-1.9.0/bin/../lib/julia/libz
91835: trying file=/home/mkitti/src/julia-1.9.0/bin/../lib/julia/../libz
91835: search cache=/etc/ld.so.cache
91835: search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib (system search path)
91835: trying file=/lib/x86_64-linux-gnu/libz
91835: trying file=/usr/lib/x86_64-linux-gnu/libz
91835: trying file=/lib/libz
91835: trying file=/usr/lib/libz
91835:
91835: find library=libz.so [0]; searching
91835: search path=/home/mkitti/src/julia-1.9.0/bin/../lib/julia:/home/mkitti/src/julia-1.9.0/bin/../lib/julia/.. (RUNPATH from file julia)
91835: trying file=/home/mkitti/src/julia-1.9.0/bin/../lib/julia/libz.so
91835:
"libz"
Ok – see results below for Julia v1.9. Ran it to find librtlsdr
(unsuccessful) and librtlsdr.so
(successful). If need me to show results for Julia v1.7, let me know. For completeness, also ran ldconfig -p | grep librtlsdr
which resulted in librtlsdr.so.0 (libc6,x86-64) => /usr/local/lib/librtlsdr.so.0
and librtlsdr.so (libc6,x86-64) => /usr/local/lib/librtlsdr.so
julia> using Libdl
julia> find_library(“librtlsdr”)
6784: find library=librtlsdr [0]; searching
6784: search path=/home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/…/lib/julia:/home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/…/lib/julia/… (RUNPATH from file /home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/julia)
6784: trying file=/home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/…/lib/julia/librtlsdr
6784: trying file=/home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/…/lib/julia/…/librtlsdr
6784: search cache=/etc/ld.so.cache
6784: search path=/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/lib:/usr/lib (system search path)
6784: trying file=/lib/x86_64-linux-gnu/librtlsdr
6784: trying file=/usr/lib/x86_64-linux-gnu/librtlsdr
6784: trying file=/lib/librtlsdr
6784: trying file=/usr/lib/librtlsdr
6784:
“”
julia> find_library(“librtlsdr.so”)
6784: find library=librtlsdr.so [0]; searching
6784: search path=/home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/…/lib/julia:/home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/…/lib/julia/… (RUNPATH from file /home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/julia)
6784: trying file=/home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/…/lib/julia/librtlsdr.so
6784: trying file=/home/brent/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/bin/…/lib/julia/…/librtlsdr.so
6784: search cache=/etc/ld.so.cache
6784: trying file=/usr/local/lib/librtlsdr.so
6784:
6784: find library=libusb-1.0.so.0 [0]; searching
6784: search cache=/etc/ld.so.cache
6784: trying file=/lib/x86_64-linux-gnu/libusb-1.0.so.0
6784:
6784: find library=libudev.so.1 [0]; searching
6784: search cache=/etc/ld.so.cache
6784: trying file=/lib/x86_64-linux-gnu/libudev.so.1
6784:
6784:
6784: calling init: /lib/x86_64-linux-gnu/libudev.so.1
6784:
6784:
6784: calling init: /lib/x86_64-linux-gnu/libusb-1.0.so.0
6784:
6784:
6784: calling init: /usr/local/lib/librtlsdr.so
6784:
6784:
6784: calling fini: /usr/local/lib/librtlsdr.so [0]
6784:
6784:
6784: calling fini: /lib/x86_64-linux-gnu/libusb-1.0.so.0 [0]
6784:
6784:
6784: calling fini: /lib/x86_64-linux-gnu/libudev.so.1 [0]
6784:
“librtlsdr.so”