Libdl : libifport.so.5: cannot open shared object file: No such file or directory

Hi everyone,

I wanted to connect a dynamic library compiled by Intel ifort to Julia. The compilation part was no problem. I ran

$ ifort -shared -fPIC tt.f90 -o tt.so

and got tt.so. Then I moved it to /usr/lib/.

Then I turned to Julia and ran

julia> using Libdl

julia> lib = Libdl.dlopen("tt.so")

and got error


julia> lib = Libdl.dlopen("tt.so")
ERROR: could not load library "tt.so"
libifport.so.5: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(::String, ::UInt32; throw_error::Bool) at /home/buildbot/build-worker/worker/juliapro-release-centos7-0_6/build/tmp_julia/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109
 [2] dlopen at /home/buildbot/build-worker/worker/juliapro-release-centos7-0_6/build/tmp_julia/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)
 [3] top-level scope at none:0

julia> lib = Libdl.dlopen("libifport.so.5")
ERROR: could not load library "libifport.so.5"
libifport.so.5: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(::String, ::UInt32; throw_error::Bool) at /home/buildbot/build-worker/worker/juliapro-release-centos7-0_6/build/tmp_julia/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109
 [2] dlopen at /home/buildbot/build-worker/worker/juliapro-release-centos7-0_6/build/tmp_julia/share/julia/stdlib/v1.4/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)
 [3] top-level scope at none:0

What is the problem? Is it because of an inappropriate installation of Intel’s Fortran compiler?

libifport.so.5 doesn’t seem to be on your LD_LIBRARY_PATH.
Did your source /path/to/compilervars.sh intel64 when compiling, but not before this Julia session?
If yes, try sourcing it before starting Julia.
If no, find this library’s location and add it to the path.