ZMQ.jl
ZMQ.jl copied to clipboard
build failure on CentOS 7
@pfv07 wrote in JuliaLang/IJulia.jl#894
Hi, I update the julia version to 1.3.1 and build the packages, but i have this error. I install the libraries that the message show but the error no fixed
julia> using IJulia
[ Info: Precompiling IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a]
ERROR: LoadError: InitError: could not load library "/home/patricio/.julia/artifacts/8b67c92bc6eb60d96d3488bf4b48bd3a38f70c53/lib/libzmq.so"
/usr/bin/../lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/patricio/.julia/artifacts/8b67c92bc6eb60d96d3488bf4b48bd3a38f70c53/lib/libzmq.so)
Stacktrace:
[1] dlopen at /builddir/build/BUILD/julia/build/usr/share/julia/stdlib/v1.3/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)
[2] __init__() at /home/patricio/.julia/packages/ZeroMQ_jll/SbMEz/src/wrappers/x86_64-linux-gnu.jl:35
[3] top-level scope at none:2
during initialization of module ZeroMQ_jll
in expression starting at /home/patricio/.julia/packages/ZMQ/KdNw3/src/ZMQ.jl:4
ERROR: LoadError: Failed to precompile ZMQ [c2297ded-f4af-51ae-bb23-16f91089e4e1] to /home/patricio/.julia/compiled/v1.3/ZMQ/CaaO6_dGP3l.ji.
Stacktrace:
[1] top-level scope at none:2
in expression starting at /home/patricio/.julia/packages/IJulia/F1GUo/src/IJulia.jl:36
ERROR: Failed to precompile IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] to /home/patricio/.julia/compiled/v1.3/IJulia/nfu7T_dGP3l.ji.
This seems to be a resurgence of #176. Now that #194 moved ZMQ.jl to using the new binary-artifacts system, we no longer have a fallback to compile from source.
@pfv07, a workaround should be to add the older version of ZMQ instead:
pkg> add [email protected]
@staticfloat, is there any way to support CentOS with the binary artifact?
This is interesting; libstdc++.so.6
should already be loaded by Julia, and we ship a much more recent libstdc++.so.6
than is denoted by that error. If I had to guess, I would guess that this user is not using the official Julia binaries, but is instead using distribution packages or they built Julia from source, or something similar.
Because the build recipe for ZeroMQ
uses preferred_gcc_version=v"6"
, we are simply not going to be able to support this configuration (a system that has built Julia with GCC 4 and is still using a GCC 4-era libstdc++.so.6
) without some extra work. Here are the paths forward:
- Tell the user to download the official Julia release. Everything should still work just fine, and they'll get a more recent libstdc++ bundled with their Julia.
- Have the user download a more recent
libstdc++.so.6
and put it someplace early on theirLD_LIBRARY_PATH
.libstdc++so.6
is very backwards-compatible, so this is not dangerous, it just increases compatibility on their system. - Build
ZeroMQ
with an older GCC version; the default is GCC 4.8.5, but I assume there is a reason why we bumped it up to v6 in Yggdrasil, so perhaps this is not workable. - Have Julia auto-detect when it has a very old
libstdc++.so.6
and complain. We actually have most of the code required to do this, but since we typically build with such an old GCC version for most of our dependencies (and most users are either using the official binaries or building from source on a very recent distribution), it hasn't been a priority for us. We could have Julia automatically download an appropriate set of compiler support libraries (we actually already have a collection of them all ready to go) but the challenge is in getting Julia to load thatlibstdc++.so.6
first. Usually we would just plop it into${prefix}/lib/julia
, but if the user doesn't havesudo
privileges that may not work on restrictive, older systems. We can always download it to~/.julia/artifacts/<hash>/lib
and then tell the user to exportLD_LIBRARY_PATH=~/.julia/artifacts/<hash>/lib:$LD_LIBRARY_PATH
, but that's about the best we can do, I'm afraid.
@pfv07 wrote in JuliaLang/IJulia.jl#894
Hi, I update the julia version to 1.3.1 and build the packages, but i have this error. I install the libraries that the message show but the error no fixed
julia> using IJulia [ Info: Precompiling IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] ERROR: LoadError: InitError: could not load library "/home/patricio/.julia/artifacts/8b67c92bc6eb60d96d3488bf4b48bd3a38f70c53/lib/libzmq.so" /usr/bin/../lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/patricio/.julia/artifacts/8b67c92bc6eb60d96d3488bf4b48bd3a38f70c53/lib/libzmq.so) Stacktrace: [1] dlopen at /builddir/build/BUILD/julia/build/usr/share/julia/stdlib/v1.3/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times) [2] __init__() at /home/patricio/.julia/packages/ZeroMQ_jll/SbMEz/src/wrappers/x86_64-linux-gnu.jl:35 [3] top-level scope at none:2 during initialization of module ZeroMQ_jll in expression starting at /home/patricio/.julia/packages/ZMQ/KdNw3/src/ZMQ.jl:4 ERROR: LoadError: Failed to precompile ZMQ [c2297ded-f4af-51ae-bb23-16f91089e4e1] to /home/patricio/.julia/compiled/v1.3/ZMQ/CaaO6_dGP3l.ji. Stacktrace: [1] top-level scope at none:2 in expression starting at /home/patricio/.julia/packages/IJulia/F1GUo/src/IJulia.jl:36 ERROR: Failed to precompile IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] to /home/patricio/.julia/compiled/v1.3/IJulia/nfu7T_dGP3l.ji.
This seems to be a resurgence of #176. Now that #194 moved ZMQ.jl to using the new binary-artifacts system, we no longer have a fallback to compile from source.
@pfv07, a workaround should be to add the older version of ZMQ instead:
pkg> add [email protected]
@staticfloat, is there any way to support CentOS with the binary artifact?
Tnks !!! the workaround is ok ... this works !!! I'm using this repository (i don't know if is a official repo): nalimilan-julia/x86_64 Copr repo for julia owned by nalimilan
@nalimilan can we bundle a newer libstdc++.so.6
in the private libdir of your Julia distribution? We would need one that is GCC 7 or later; you can get one from here: https://github.com/JuliaBinaryWrappers/CompilerSupportLibraries_jll.jl/releases/download/CompilerSupportLibraries-v0.2.0%2B1/CompilerSupportLibraries.v0.2.0.x86_64-linux-gnu-libgfortran5.tar.gz
Build ZeroMQ with an older GCC version; the default is GCC 4.8.5, but I assume there is a reason why we bumped it up to v6 in Yggdrasil, so perhaps this is not workable.
For the record, the reason why GCC v6 was used is for a bug in Musl: https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/387. However, in https://github.com/JuliaPackaging/Yggdrasil/pull/396 I applied a patch -- interestingly enough already available in Yggdrasil but not used -- that should fix the issue. I just noted that @staticfloat was hesitant to apply the patch in https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/387#issuecomment-474920759.
In addition to that, ZeroMQ was not expanded for the C++ string ABI, I did also that in https://github.com/JuliaPackaging/Yggdrasil/pull/396.