Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgfortran not loaded error when trying to dlopen generated library on macOS. #139

Closed
KristofferC opened this issue Feb 6, 2018 · 8 comments

Comments

@KristofferC
Copy link
Member

Using https://github.com/KristofferC/OpenspecfunBuilder and replacing the dlopen_e with dlopen to see what the error is, I get:

julia> Pkg.build("SpecialFunctions")
INFO: Building SpecialFunctions
INFO: Found a valid dl path libopenspecfun.1.3.dylib while looking for libopenspecfun
INFO: /Users/kristoffer/.julia/v0.6/SpecialFunctions/deps/usr/lib/libopenspecfun.1.3.dylib matches our search criteria of libopenspecfun
========================================================================================================[ ERROR: SpecialFunctions ]========================================================================================================

LoadError: could not load library "/Users/kristoffer/.julia/v0.6/SpecialFunctions/deps/usr/lib/libopenspecfun.1.3.dylib"
dlopen(/Users/kristoffer/.julia/v0.6/SpecialFunctions/deps/usr/lib/libopenspecfun.1.3.dylib, 1): Library not loaded: /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/lib/libgfortran.4.dylib
  Referenced from: /Users/kristoffer/.julia/v0.6/SpecialFunctions/deps/usr/lib/libopenspecfun.1.3.dylib
  Reason: image not found
while loading /Users/kristoffer/.julia/v0.6/SpecialFunctions/deps/build.jl, in expression starting on line 24

on macOS.

@staticfloat
Copy link
Member

This is a great fortran test; In your Julia, what libgfortran is already loaded?

@KristofferC
Copy link
Member Author

julia> Libdl.dllist()[contains.(Libdl.dllist(), "libgfortran")]
1-element Array{AbstractString,1}:
 "/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/libgfortran.4.dylib"

@staticfloat
Copy link
Member

Okay, so we are failing to rewrite the dependency to an @rpath one.

@KristofferC
Copy link
Member Author

In the logs I also see:

INFO: Beginning audit of /home/travis/build/KristofferC/OpenspecfunBuilder/build/i686-linux-gnu/gkbwBvwh/destdir
INFO: Checking lib/libopenspecfun.so with RPath list Any[]
WARNING: Linked library libquadmath.so.0 could not be resolved and could not be auto-mapped
INFO: Checking lib/libopenspecfun.so.1 with RPath list Any[]
WARNING: Linked library libquadmath.so.0 could not be resolved and could not be auto-mapped
INFO: Checking lib/libopenspecfun.so.1.3 with RPath list Any[]
WARNING: Linked library libquadmath.so.0 could not be resolved and could not be auto-mapped

which is a dependency gfortran always put there, I think.

@staticfloat
Copy link
Member

This should be fixed now.

@KristofferC
Copy link
Member Author

Doesn't seem fixed: JuliaMath/OpenspecfunBuilder#9

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
julia> Libdl.dllist()[contains.(Libdl.dllist(), "libgfortran")]
 "/usr/local/opt/gcc/lib/gcc/7/libgfortran.4.dylib"

@KristofferC
Copy link
Member Author

Or, well, it seems to be an @rpath now but it still fails to load.

@KristofferC
Copy link
Member Author

Ok, dup of JuliaLinearAlgebra/OpenBLASBuilder#2

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

No branches or pull requests

2 participants