Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Cannot find Julia's OpenBLAS #3

Open
andreasnoack opened this issue May 23, 2018 · 7 comments
Open

Cannot find Julia's OpenBLAS #3

andreasnoack opened this issue May 23, 2018 · 7 comments

Comments

@andreasnoack
Copy link
Member

My understanding is that it should be possible to use OpenBLASBuilder when using BinaryBuilder to build a project that needs BLAS and then rely on Julia's OpenBLAS. However, it seems that the libraries are unable to find Julia's OpenBLAS. When trying dlopen on Linux I get

julia> Libdl.dlopen("/home/andreasnoack/.julia/v0.6/Arpack/deps/usr/lib/libarpack.so")
ERROR: could not load library "/home/andreasnoack/.julia/v0.6/Arpack/deps/usr/lib/libarpack.so"
/home/andreasnoack/.julia/v0.6/Arpack/deps/usr/lib/libopenblas64_.so.0: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(::String, ::UInt32) at ./libdl.jl:97 (repeats 2 times)

and on Mac it is

julia> Libdl.dlopen("/Users/andreasnoack/.julia/v0.6/Arpack/deps/usr/lib/libarpack.2.0.0.dylib")
ERROR: could not load library "/Users/andreasnoack/.julia/v0.6/Arpack/deps/usr/lib/libarpack.2.0.0.dylib"
dlopen(/Users/andreasnoack/.julia/v0.6/Arpack/deps/usr/lib/libarpack.2.0.0.dylib, 1): Library not loaded: @loader_path/libopenblas64_p-r0.2.20.dylib
  Referenced from: /Users/andreasnoack/.julia/v0.6/Arpack/deps/usr/lib/libarpack.2.0.0.dylib
  Reason: image not found
Stacktrace:
 [1] dlopen(::String, ::UInt32) at ./libdl.jl:97 (repeats 2 times)

Let me know if you need more details.

@staticfloat
Copy link
Member

This should hopefully be fixed by #6. Note you'll need to build a new version of ArpackBuilder with this new version of OpenBLASBuilder, so that it picks up the right SONAME.

@andreasnoack
Copy link
Member Author

andreasnoack commented May 26, 2018

So the good news is that this now works on 0.6. The bad news is that it fails on 0.7 with

julia> Libdl.dlopen("/Users/andreasnoack/.julia/v0.7/Arpack/deps/usr/lib/libarpack.dylib")
ERROR: could not load library "/Users/andreasnoack/.julia/v0.7/Arpack/deps/usr/lib/libarpack.dylib"
dlopen(/Users/andreasnoack/.julia/v0.7/Arpack/deps/usr/lib/libarpack.dylib, 1): Library not loaded: @rpath/libopenblas64_p-r0.2.20.dylib
  Referenced from: /Users/andreasnoack/.julia/v0.7/Arpack/deps/usr/lib/libarpack.dylib
  Reason: image not found
Stacktrace:
 [1] dlopen(::String, ::UInt32) at /Users/andreasnoack/julia-dev/usr/share/julia/stdlib/v0.7/Libdl/src/Libdl.jl:99 (repeats 2 times)
 [2] top-level scope

julia> Libdl.find_library("libarpack", ["/Users/andreasnoack/.julia/v0.6/Arpack/deps/usr/lib/"])
""

Update: I've pasted the error message from a version of libarpack built against the 0.2.20 version of OpenBLAS. This is the version that works on 0.6 but fails on master. When libarpack has been built against OpenBLAS 0.3.0, I'm unable to load it on both 0.6 and master.

@staticfloat
Copy link
Member

When libarpack has been built against OpenBLAS 0.3.0, I'm unable to load it on both 0.6 and master.

Yes, this is expected as it's looking for @rpath/libopenblas64_.so.0.3.0, which isn't bundled with Julia; with the libraries that come bundled with Julia, packages will have to use the same versions as ship with Julia.

I've pasted the error message from a version of libarpack built against the 0.2.20 version of OpenBLAS

This error message looks like it's still looking for @rpath/libopenblas64_p-r0.2.20.dylib, which looks like it's from a build of ArpackBuilder that used a version of OpenBLASBuilder that didn't have the renaming magic that I added in dc15cde. I'm guessing you saw the 0.3.0 error and decided to fall back to an earlier release, which accidentally brought you back to a non-renamed version.

To remedy this, I'm rebuilding v0.2.20 with the renaming fixes included. I'll make a new v0.2.20 release with that, and hopefully that will fix all of this mess.

@staticfloat
Copy link
Member

New version of v0.2.20 built; go ahead and use that to do another build of ArpackBuilder.

@andreasnoack
Copy link
Member Author

This is currently fixed by changing the path downstream. See https://github.com/JuliaLinearAlgebra/ArpackBuilder/blob/2590bfddc91bcc34c2fbdd2b8044c9163c8a0229/build_tarballs.jl#L29-L34. This should probably be fixed upstream in Julia's OpenBLAS build.

@staticfloat
Copy link
Member

Yes, please open an issue on the main Julia repository and I'll make sure the relevant Makefiles get fixed.

@andreasnoack
Copy link
Member Author

Done

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

2 participants