BioJulia / Libz.jl

Fast, flexible zlib bindings.
Other
27 stars 17 forks source link

libz not installing in 0.7-DEV #59

Open StephenVavasis opened 6 years ago

StephenVavasis commented 6 years ago

Libz is not installing in the latest nightly of 0.7-DEV. The error message is below. This is for Ubuntu 17.10. I am trying to install JLD2, which depends on libz.

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.4018 (2018-02-19 19:28 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 1388ddf60a (0 days old master)
|__/                   |  x86_64-pc-linux-gnu

julia> using Pkg

julia> Pkg.add("Libz")
[ Info: Installing Libz v0.2.4
[ Info: Package database updated

julia> Pkg.test("Libz")
[ Info: Computing test dependencies for Libz...
[ Info: Installing BaseTestNext v0.2.2
[ Info: Testing Libz
┌ Warning: Deprecated syntax `type` at /home/vavasis/.julia/v0.7/Libz/src/lowlevel.jl:62.
│ Use `mutable struct` instead.
└ @ nothing lowlevel.jl:62
┌ Warning: `is_windows` is deprecated, use `Sys.iswindows` instead.
│   caller = top-level scope
└ @ Core :0
WARNING: importing deprecated binding Base.Void into Libz.
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /home/vavasis/.julia/v0.7/Libz/src/lowlevel.jl:62
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /home/vavasis/.julia/v0.7/Libz/src/lowlevel.jl:62
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /home/vavasis/.julia/v0.7/Libz/src/lowlevel.jl:62
WARNING: Base.Void is deprecated, use Nothing instead.
  likely near /home/vavasis/.julia/v0.7/Libz/src/lowlevel.jl:62
ERROR: LoadError: LoadError: error compiling version: could not load library "libz"
libz.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] top-level scope
 [2] include at ./boot.jl:295 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1060
 [4] include at ./sysimg.jl:27 [inlined]
 [5] include(::String) at /home/vavasis/.julia/v0.7/Libz/src/Libz.jl:3
 [6] top-level scope
 [7] include at ./boot.jl:295 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1060
 [9] include(::Module, ::String) at ./sysimg.jl:27
 [10] top-level scope
 [11] eval at ./boot.jl:298 [inlined]
 [12] top-level scope at ./<missing>:3
in expression starting at /home/vavasis/.julia/v0.7/Libz/src/lowlevel.jl:110
in expression starting at /home/vavasis/.julia/v0.7/Libz/src/Libz.jl:11
ERROR: LoadError: Failed to precompile Libz to /home/vavasis/.julia/lib/v0.7/Libz.ji.
Stacktrace:
 [1] error at ./error.jl:33 [inlined]
 [2] compilecache(::Base.PkgId) at ./loading.jl:1198
 [3] _require(::Base.PkgId) at ./loading.jl:996
 [4] require(::Module, ::Symbol) at ./loading.jl:867
 [5] include at ./boot.jl:295 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1060
 [7] include(::Module, ::String) at ./sysimg.jl:27
 [8] exec_options(::Base.JLOptions) at ./client.jl:332
 [9] _start() at ./client.jl:448
in expression starting at /home/vavasis/.julia/v0.7/Libz/test/runtests.jl:1
┌ Error: ------------------------------------------------------------
│ # Testing failed for Libz
│   exception =
│    failed process: Process(`/home/vavasis/julia-1388ddf60a/bin/julia -Cnative -J/home/vavasis/julia-1388ddf60a/lib/julia/sys.so --compile=yes --depwarn=yes --code-coverage=none --color=yes --compiled-modules=yes --check-bounds=yes --warn-overwrite=yes --startup-file=yes /home/vavasis/.julia/v0.7/Libz/test/runtests.jl`, ProcessExited(1)) [1]
│    Stacktrace:
│     [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
│     [2] pipeline_error(::Base.Process) at ./process.jl:693
│     [3] run(::Cmd) at ./process.jl:655
│     [4] (::getfield(Pkg.Entry, Symbol("##56#57")){Bool,String,Array{AbstractString,1}})() at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/Pkg/src/entry.jl:731
│     [5] cd(::getfield(Pkg.Entry, Symbol("##56#57")){Bool,String,Array{AbstractString,1}}, ::String) at ./file.jl:70
│     [6] #test!#55(::Bool, ::Function, ::String, ::Array{AbstractString,1}, ::Array{AbstractString,1}, ::Array{AbstractString,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/Pkg/src/entry.jl:719
│     [7] (::getfield(Pkg.Entry, Symbol("#kw##test!")))(::NamedTuple{(:coverage,),Tuple{Bool}}, ::typeof(Pkg.Entry.test!), ::String, ::Array{AbstractString,1}, ::Array{AbstractString,1}, ::Array{AbstractString,1}) at ./<missing>:0
│     [8] #test#59(::Bool, ::Function, ::Array{AbstractString,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/Pkg/src/entry.jl:758
│     [9] #test at ./<missing>:0 [inlined]
│     [10] #4 at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/Pkg/src/dir.jl:36 [inlined]
│     [11] cd(::getfield(Pkg.Dir, Symbol("##4#7")){Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:coverage,),Tuple{Bool}}},typeof(Pkg.Entry.test),Tuple{Array{AbstractString,1}}}, ::String) at ./file.jl:70
│     [12] #cd#1(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:coverage,),Tuple{Bool}}}, ::Function, ::Function, ::Array{AbstractString,1}, ::Vararg{Array{AbstractString,1},N} where N) at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/Pkg/src/dir.jl:36
│     [13] (::getfield(Pkg.Dir, Symbol("#kw##cd")))(::NamedTuple{(:coverage,),Tuple{Bool}}, ::typeof(Pkg.Dir.cd), ::Function, ::Array{AbstractString,1}, ::Vararg{Array{AbstractString,1},N} where N) at ./<missing>:0
│     [14] #test#3(::Bool, ::Function, ::String, ::Vararg{String,N} where N) at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/Pkg/src/Pkg.jl:277
│     [15] test(::String, ::Vararg{String,N} where N) at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/Pkg/src/Pkg.jl:277
│     [16] top-level scope
│     [17] eval at ./boot.jl:298 [inlined]
│     [18] eval(::Module, ::Expr) at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/REPL/src/REPL.jl:5
│     [19] eval_user_input(::Any, ::REPL.REPLBackend) at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/REPL/src/REPL.jl:86
│     [20] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/site/v0.7/REPL/src/REPL.jl:117 [inlined]
│     [21] (::getfield(REPL, Symbol("##28#29")){REPL.REPLBackend})() at ./event.jl:92
└ @ Pkg.Entry entry.jl:734
[ Info: Removing BaseTestNext v0.2.2
ERROR: Libz had test errors

julia> 
timholy commented 5 years ago

On a fresh Ubuntu 18.04 install,

$ locate libz.so | grep -v home
/lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libz.so.1.2.11

and consequently

julia> using Libdl

julia> dlopen("libz.so")
ERROR: could not load library "libz.so"
libz.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(::String, ::UInt32) at /usr/local/julia/julia-1.0/usr/share/julia/stdlib/v1.0/Libdl/src/Libdl.jl:97 (repeats 2 times)
 [2] top-level scope at none:0

julia> dlopen("libz.so.1")
Ptr{Nothing} @0x000055bccaaccec0

Interestingly, none of the libs in /lib/x86_64-linux-gnu have unversioned .so links. On a separate 18.04 system (one that was upgraded from earlier Ubuntu releases and also has many more packages installed), I also have /usr/lib/x86_64-linux-gnu/libz* and that does have the unversioned symlink. According to dpkg, the owner of that is zlib1g-dev, and doing

sudo apt install zlib1g-dev

indeed fixed this problem for me.

TransGirlCodes commented 5 years ago

@timholy Thanks for investigating that, @StephenVavasis I would encourage you both to use CodecZLib instead of this package, if it is possible, as it is more up to date and IIRC, uses BinaryBuilder and BinaryProvider to fulfill it's dependencies. Libz.jl is currently maintained as people still depend on it in older packages, but I would recommend CodecZlib.jl over this package.

cossio commented 5 years ago

I keep getting the following error on Gitlab CI. I presume it's related to this issue.

ERROR: LoadError: LoadError: error compiling version: could not load library "libz"
libz.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] top-level scope at none:0
 [2] include at ./boot.jl:326 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1038
 [4] include at ./sysimg.jl:29 [inlined]
 [5] include(::String) at /root/.julia/packages/Libz/zMAun/src/Libz.jl:3
 [6] top-level scope at none:0
 [7] include at ./boot.jl:326 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1038
 [9] include(::Module, ::String) at ./sysimg.jl:29
 [10] top-level scope at none:2
 [11] eval at ./boot.jl:328 [inlined]
 [12] eval(::Expr) at ./client.jl:404
 [13] top-level scope at ./none:3
in expression starting at /root/.julia/packages/Libz/zMAun/src/lowlevel.jl:110
in expression starting at /root/.julia/packages/Libz/zMAun/src/Libz.jl:11
DarioSarra commented 5 years ago

I had the same issue, I installed Libz has a dependency of MAT, but I couldn't make it work I solved following @timholy's advice

sudo apt install zlib1g-dev

cossio commented 5 years ago

@DarioSarra Thanks! I put that in in the .gitlab-ci.yml and it works. But it seems that Libz.jl should take care of this automatically.

nicrummel commented 5 years ago

I fixed this issue on a fresh install of Centos 7 by making a link between .so.1 to .so: sudo ln -sf /usr/lib64/libz.so.1 /usr/lib64/libz.so