Julia1.0 linux GZip.jl cannout find libz.so

This is using docker, so is a fresh unmodified linux distribution.
Using julia1.0 or 0.7,

using Pkg
Pkg.add(“GZip”)
Pkg.build(“GZip”)
using GZip
┌ Info: Precompiling GZip [92fee26a-97fe-5a0c-ad85-20a5f3185b63]
└ @ Base loading.jl:1186
ERROR: LoadError: LoadError: error compiling top-level scope: could not load library “libz”
libz.so: cannot open shared object file: No such file or directory

Installing the ubuntu package zlib1g-dev worked.

Googling the problem, it looks like libz has caused a lot of problems, usually when packages that require python are needed. Unfortunately, these (jupyter, pyplot) are some of the most popular and basic packages.

EDIT: previously I thought this was due to an interaction with IJulia; in fact the problem occurs when GZip is the first package to be installed.

Consider using CodecZlib instead of Gzip. It is a much more efficient way to process gzip files.

1 Like

I see that CodecZlib uses BinaryProvider to install zlib/libz, so probably avoids this problem.

Curious, you say it is more efficient. Since it appears to call libz, I would think that the speed would be the same as another library that also does so (e.g. GZip)?

No, both Libz and CodecZlib are very much faster than Gzip. Libz is now deprecated in favour of CodecZlib.

I use CodecZlib all the time and it has very little overhead in reading and writing gzip files. The nice thing is that the IO handle it returns is fully compatible with standard IO functions.

2 Likes