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

Error building ZMQ.jl v0.6.0 on CentOS 7 #176

Closed
felipenoris opened this issue Apr 20, 2018 · 24 comments · Fixed by #178
Closed

Error building ZMQ.jl v0.6.0 on CentOS 7 #176

felipenoris opened this issue Apr 20, 2018 · 24 comments · Fixed by #178

Comments

@felipenoris
Copy link

felipenoris commented Apr 20, 2018

When building on CentOS 7:

LoadError: BinaryProvider.LibraryProduct("/rhome/FNORO/.julia/v0.6/ZMQ/deps/usr/lib", String["libzmq"], :libzmq, "Prefix(/rhome/FNORO/.julia/v0.
6/ZMQ/deps/usr)") is not satisfied, cannot generate deps.jl!                                                                                    
while loading /rhome/FNORO/.julia/v0.6/ZMQ/deps/build.jl, in expression starting on line 40

If I revert to v0.5.1 using Pkg.pin("ZMQ", v"0.5.1") , then Pkg.build("ZMQ") works fine.

@jebej
Copy link

jebej commented Apr 20, 2018

same here, on CentOS 7

@stevengj
Copy link
Contributor

stevengj commented Apr 21, 2018

Sounds a lot like JuliaIO/Blosc.jl#50. Analogous to there, perhaps the error is fixed by rm(Pkg.dir("ZMQ", "deps", "usr"), recursive=true) followed by Pkg.build("ZMQ")?

@felipenoris
Copy link
Author

felipenoris commented Apr 21, 2018

@stevengj No.. it doesn't fix it. I'm installing ZMQ inside a docker container with a fresh Julia installation.
I'll try to dig into this problem to check what's going on.

Looks like something specific to CentOS 7. I had no trouble with macOS and Ubuntu.

@stevengj
Copy link
Contributor

See my comment about verbose info: JuliaIO/Blosc.jl#50 (comment)

@felipenoris
Copy link
Author

Nothing...

julia> ARGS
1-element Array{String,1}:
 "--verbose"

julia> Pkg.build("ZMQ")
INFO: Building ZMQ
===================================================================================================[ ERROR: ZMQ ]===================================================================================================

LoadError: BinaryProvider.LibraryProduct("/usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib", String["libzmq"], :libzmq, "Prefix(/usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr)") is not satisfied, cannot generate deps.jl!
while loading /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/build.jl, in expression starting on line 40

====================================================================================================================================================================================================================

==================================================================================================[ BUILD ERRORS ]==================================================================================================

WARNING: ZMQ had build errors.

 - packages with build errors remain installed in /usr/local/julia/share/julia/site/v0.6
 - build the package(s) and all dependencies with `Pkg.build("ZMQ")`
 - build a single package by running its `deps/build.jl` script

@felipenoris
Copy link
Author

I manually edited build.jl and got some output:

julia> Pkg.build("ZMQ")
INFO: Building ZMQ
Checking satisfaction...
Info: Found a valid dl path libzmq.so while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so cannot be dlopen'ed
Info: Found a valid dl path libzmq.so.5 while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5 matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5 cannot be dlopen'ed
Info: Found a valid dl path libzmq.so.5.1.5 while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5.1.5 matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5.1.5 cannot be dlopen'ed
Info: Could not locate libzmq inside /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib
BinaryProvider.LibraryProduct("/usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib", String["libzmq"], :libzmq, "Prefix(/usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr)") satisfied? : false
Info: Found a valid dl path libzmq.so while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so cannot be dlopen'ed
Info: Found a valid dl path libzmq.so.5 while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5 matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5 cannot be dlopen'ed
Info: Found a valid dl path libzmq.so.5.1.5 while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5.1.5 matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5.1.5 cannot be dlopen'ed
Info: Could not locate libzmq inside /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib
My platform key is BinaryProvider.Linux(:x86_64, :glibc, :blank_abi)
platform key in download_info? true
Info: Destination file /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/downloads/ZMQ.x86_64-linux-gnu.tar.gz already exists, verifying...
Info: Hash cache is consistent, returning true
Info: Installing /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/downloads/ZMQ.x86_64-linux-gnu.tar.gz into /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr
Info: Removing files installed by manifests/ZMQ.x86_64-linux-gnu.list
Info:   include/zmq.h removed
Info:   include/zmq_utils.h removed
Info:   Culling empty directory include
Info:   logs/ZMQ.log removed
Info:   Culling empty directory logs
Info:   lib/pkgconfig/libzmq.pc removed
Info:   Culling empty directory lib/pkgconfig
Info:   lib/libzmq.la removed
Info:   lib/libzmq.so.5.1.5 removed
Info:   lib/libzmq.so removed
Info:   lib/libzmq.so.5 removed
Info:   lib/libzmq.a removed
Info:   Culling empty directory lib
Info:   manifests/ZMQ.x86_64-linux-gnu.list removed
ran install for url=https://github.com/JuliaInterop/ZMQBuilder/releases/download/v4.2.5+2/ZMQ.x86_64-linux-gnu.tar.gz and it WORKED!
Will write deps file

@felipenoris
Copy link
Author

felipenoris commented Apr 21, 2018

verbose argument is not passed to write_deps_file by build.jl .
I also edited that, and this is the output of write_deps_file execution with verbose=true, which is the last line in build.jl.

Info: Found a valid dl path libzmq.so while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so cannot be dlopen'ed
Info: Found a valid dl path libzmq.so.5 while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5 matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5 cannot be dlopen'ed
Info: Found a valid dl path libzmq.so.5.1.5 while looking for libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5.1.5 matches our search criteria of libzmq
Info: /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib/libzmq.so.5.1.5 cannot be dlopen'ed
Info: Could not locate libzmq inside /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib
===================================================================================================[ ERROR: ZMQ ]===================================================================================================

LoadError: BinaryProvider.LibraryProduct("/usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr/lib", String["libzmq"], :libzmq, "Prefix(/usr/local/julia/share/julia/site/v0.6/ZMQ/deps/usr)") is not satisfied, cannot generate deps.jl!
while loading /usr/local/julia/share/julia/site/v0.6/ZMQ/deps/build.jl, in expression starting on line 54

@felipenoris felipenoris changed the title Error building ZMQ.jl for Release v0.6.0 Error building ZMQ.jl for Release v0.6.0 on CentOS 7 Apr 21, 2018
@felipenoris felipenoris changed the title Error building ZMQ.jl for Release v0.6.0 on CentOS 7 Error building ZMQ.jl v0.6.0 on CentOS 7 Apr 21, 2018
@stevengj
Copy link
Contributor

What happens if you manually call dlopen on the libzmq.so in deps/usr?

@jebej
Copy link

jebej commented Apr 22, 2018

The problem seems to be that the "BinaryBuilder" binaries are not compatible with the "unofficial" CentOS julia package. If I use the generic linux binaries it works.

@felipenoris
Copy link
Author

smells like ABI madness

@oschulz
Copy link

oschulz commented Apr 25, 2018

I also ran into this problem. A manual dlopen, as suggested by @stevengj, results in

julia> Libdl.dlopen("/some/path/.julia/v0.6/ZMQ/deps/usr/lib/libzmq.so")
ERROR: could not load library "/some/path/.julia/v0.6/ZMQ/deps/usr/lib/libzmq.so"
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /some/path/.julia/v0.6/ZMQ/deps/usr/lib/libzmq.so)

@oschulz
Copy link

oschulz commented Apr 25, 2018

Would it be possible for ZMQBuilder to use an older GCC version, to provide more backward-compatibility? CentOS-7 will still be with us for a while ...

@stevengj
Copy link
Contributor

stevengj commented Apr 25, 2018

That depends on the BinaryBuilder setup: filed JuliaPackaging/BinaryBuilder.jl#230

@stevengj
Copy link
Contributor

See also https://stackoverflow.com/questions/44205687/glibcxx-3-4-21-not-found-on-centos-7 — it looks like the library might be there on CentOS 7, but there is a problem with the paths.

@stevengj
Copy link
Contributor

As commented in the BinaryBuilder thread, this problem arises if you build Julia from source with old libstdc++ library. A workaround would be to use the official Linux julia binaries from https://julialang.org/downloads/

@oschulz
Copy link

oschulz commented Apr 26, 2018

this problem arises if you build Julia from source with old libstdc++ library

Sure - but of course, it's sometimes necessary to build Julia from source (enabling AVX-2, using BUILD_LLVM_CLANG=1, etc.).

Could we just have ZMQ.jl build the library from source if the default binary is not suitable for the current system?

@stevengj
Copy link
Contributor

Could we just have ZMQ.jl build the library from source if the default binary is not suitable for the current system?

Yes, that would be possible. A PR would be welcome.

@oschulz
Copy link

oschulz commented Apr 26, 2018

Turns out that I need to override libstdc++ for the current Anaconda matplotlib anyhow, on CentOS-7. And that probably won't be the last thing that's usually supplied in binary form and needs a more recent one, so ...

@mmikhasenko
Copy link

Same problem with my CentOS

this problem arises if you build Julia from source with old libstdc++ library

The version from the yum repository has the same ZMQ, BinaryProvider error.
Indeed, taking built version gives the way around.

@felipenoris
Copy link
Author

GR.jl has interesting code for detecting Redhat, on GR.jl/deps/build.jl file.

if Sys.KERNEL == :NT
    os = :Windows
  else
    os = Sys.KERNEL
  end
  const arch = Sys.ARCH
  if os == :Linux && arch == :x86_64
    if isfile("/etc/redhat-release")
      rel = String(read(pipeline(`cat /etc/redhat-release`, `sed s/.\*release\ //`, `sed s/\ .\*//`)))[1:end-1]
      if rel > "7.0"
        os = "Redhat"
      end

@ChrisRackauckas
Copy link
Contributor

@nalimilan just so he's aware.

@stevengj
Copy link
Contributor

Can someone on CentOS confirm that this is fixed in the latest master?

Pkg.add("CMakeWrapper")
Pkg.checkout("ZMQ")
Pkg.build("ZMQ")

@ChrisRackauckas
Copy link
Contributor

Works great.

@oschulz
Copy link

oschulz commented May 18, 2018

Thanks, @stevengj!

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

Successfully merging a pull request may close this issue.

6 participants