Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Failed to open library #9

Closed
KristofferC opened this issue Jun 15, 2018 · 4 comments
Closed

Failed to open library #9

KristofferC opened this issue Jun 15, 2018 · 4 comments

Comments

@KristofferC
Copy link
Member

julia> Libdl.dlopen("deps/usr/lib/libopenspecfun.1.3.dylib")
ERROR: could not load library "deps/usr/lib/libopenspecfun.1.3.dylib"
dlopen(deps/usr/lib/libopenspecfun.1.3.dylib, 1): Library not loaded: @rpath/libgfortran.4.dylib
  Referenced from: /Users/kristoffer/.julia/v0.6/SpecialFunctions/deps/usr/lib/libopenspecfun.1.3.dylib
  Reason: image not found
Stacktrace:
 [1] dlopen(::String, ::UInt32) at /Users/kristoffer/julia/usr/share/julia/stdlib/v0.7/Libdl/src/Libdl.jl:99 (repeats 2 times)
 [2] top-level scope at none:0

cc @andreasnoack

@andreasnoack
Copy link
Member

I believe this is the same as JuliaLinearAlgebra/OpenBLASBuilder#2. Your system probably has libgfortran.5 installed (mine has through homebrew). dlopen should work with the official binaries since they are built with libgfortran.4.

@KristofferC
Copy link
Member Author

Yeah, seems to work on my julia 0.6. I thought

julia> Libdl.dllist()[contains.(Libdl.dllist(), "libgfortran")]
1-element Array{AbstractString,1}:
 "/usr/local/opt/gcc/lib/gcc/7/libgfortran.4.dylib"

meant I had libgfortran.4 though.

@andreasnoack
Copy link
Member

cc: @staticfloat

@staticfloat
Copy link
Contributor

This is because @rpath/libgfortran.4.dylib is looking in your @rpath, which does not contain /usr/local/opt/gcc/lib/gcc/7/libgfortran.4.dylib. You most likely compiled from source, using the latestgfortran from Homebrew (which is GCC 8 now) which means that Julia auto-copied in libgfortran.5.dylib. I don't really recommend linking multiple libgfortran's into a single process. It's probably harmless here because all the "important" stuff will have already bound to the methods they need, but it's kind of like playing with fire in an armory.

The true solution to this is something like JuliaPackaging/BinaryBuilder.jl#253

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants