On JuliaPro the result of BinDeps.debug(“ZMQ”) is:
julia> BinDeps.debug("ZMQ")
INFO: Reading build script...
The package declares 1 dependencies.
WARNING: Compat.ASCIIString is deprecated, use String instead.
likely near no file:0
- Library "zmq"
- Providers:
- Autotools Build
- BinDeps.AptGet package libzmq3 (can't provide)
- BinDeps.Yum package czmq (can't provide)
- BinDeps.Pacman package zeromq (can't provide)
Note that on Ubuntu there is no libzmq3 but libzmq5 installed in the system.
On the standard Julia version the result is different:
julia> BinDeps.debug("ZMQ")
INFO: Reading build script...
The package declares 1 dependencies.
WARNING: Compat.ASCIIString is deprecated, use String instead.
likely near no file:0
- Library "zmq"
- Satisfied by:
- System Paths at /usr/lib/x86_64-linux-gnu/libzmq.so
- Providers:
- Autotools Build
- BinDeps.AptGet package libzmq3 (can't provide)
- BinDeps.Yum package czmq (can't provide)
- BinDeps.Pacman package zeromq (can't provide)
Here it detects libzmq installed in the system and all goes well.
I noticed that ZMQ on JuliaPro comes with file ZMQ/deps/deps.jl which is:
# This is an auto-generated file; do not edit
# Pre-hooks
# Macro to load a library
macro checked_lib(libname, path)
((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
quote const $(esc(libname)) = $path end
end
# Load dependencies
@checked_lib zmq "/lib64/libzmq.so.5"
# Load-hooks
On Ubuntu there is no /lib64 directory for libraries (this perhaps a Red Hat directory structure) and libzmq is installed in /usr/lib/x86_64-linux-gnu/. The same file in the standard Julia installation is different:
# This is an auto-generated file; do not edit
# Pre-hooks
# Macro to load a library
macro checked_lib(libname, path)
((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
quote const $(esc(libname)) = $path end
end
# Load dependencies
@checked_lib zmq "/usr/lib/x86_64-linux-gnu/libzmq.so"
# Load-hooks
This one points to the right directory for libzmq.so. So, I replaced the file in JuliaPro with this one and repeated the debug command:
julia> BinDeps.debug("ZMQ")
INFO: Reading build script...
The package declares 1 dependencies.
WARNING: Compat.ASCIIString is deprecated, use String instead.
likely near no file:0
- Library "zmq"
- Providers:
- Autotools Build
- BinDeps.AptGet package libzmq3 (can't provide)
- BinDeps.Yum package czmq (can't provide)
- BinDeps.Pacman package zeromq (can't provide)
No progress. The next thing I did was to change file build.jl:
using BinDeps
using Compat
@BinDeps.setup
function validate(name, handle)
try
fhandle = Libdl.dlsym(handle, :zmq_version)
major = Vector{Cint}(1)
minor = Vector{Cint}(1)
patch = Vector{Cint}(1)
ccall(fhandle, Void, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), major, minor, patch)
return VersionNumber(major[1], minor[1], patch[1]) >= v"3"
catch
return false
end
end
zmq = library_dependency("zmq", aliases = ["libzmq", "libzmq.so.3", "libzmq.so.4", "libzmq.so.5"], validate = validate)
provides(Sources, URI("https://github.com/zeromq/zeromq3-x/releases/download/v3.2.5/zeromq-3.2.5.tar.gz"), zmq)
provides(BuildProcess, Autotools(libtarget = "src/.libs/libzmq." * Libdl.dlext), zmq)
provides(AptGet, "libzmq3", zmq, os = :Linux)
provides(Yum, "czmq", zmq, os = :Linux)
provides(Pacman, "zeromq", zmq, os = :Linux)
if Compat.Sys.iswindows()
using WinRPM
provides(WinRPM.RPM, "zeromq", [zmq], os = :Windows)
elseif Compat.Sys.isapple()
using Homebrew
provides(Homebrew.HB, "zeromq@3.2", zmq, os = :Darwin)
end
@BinDeps.install Dict(:zmq => :zmq)
by replacting
provides(AptGet, "libzmq3", zmq, os = :Linux)
with
provides(AptGet, "libzmq5", zmq, os = :Linux)
Then I get the following:
julia> BinDeps.debug("ZMQ")
INFO: Reading build script...
The package declares 1 dependencies.
- Library "zmq"
- Providers:
- Autotools Build
- BinDeps.AptGet package libzmq5
- BinDeps.Yum package czmq (can't provide)
- BinDeps.Pacman package zeromq (can't provide)
So I start a Pkg.build(“ZMQ”) and I get:
julia> Pkg.build("ZMQ")
INFO: Building ZMQ
WARNING: Compat.ASCIIString is deprecated, use String instead.
likely near /home/panos/Applications/JuliaPro-0.6.1.1/JuliaPro/pkgs-0.6.1.1/v0.6/ZMQ/deps/build.jl:36
Installing dependency libzmq5 via `sudo apt-get install libzmq5`:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libzmq5 is already the newest version (4.2.1-4ubuntu1).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
================================================[ ERROR: ZMQ ]=================================================
LoadError: Provider BinDeps.PackageManager failed to satisfy dependency zmq
while loading /home/panos/Applications/JuliaPro-0.6.1.1/JuliaPro/pkgs-0.6.1.1/v0.6/ZMQ/deps/build.jl, in expression starting on line 36
===============================================================================================================
===============================================[ BUILD ERRORS ]================================================
WARNING: ZMQ had build errors.
- packages with build errors remain installed in /home/panos/Applications/JuliaPro-0.6.1.1/JuliaPro/pkgs-0.6.1.1/v0.6
- build the package(s) and all dependencies with `Pkg.build("ZMQ")`
- build a single package by running its `deps/build.jl` script
===============================================================================================================
So, it tries to install libzmq5 using apt-get (already installed) and then it fails to load the library.
It looks like BinDeps cannot detect the library in folder /usr/lib/x86_64-linux-gnu when using JuliaPro.