quixdb / squash

Compression abstraction library and utilities
https://quixdb.github.io/squash/
MIT License
405 stars 53 forks source link

`make install` on Debian Jessie doesn't result in a working installation #210

Closed aboyett closed 8 years ago

aboyett commented 8 years ago

I tried creating a docker image for squash based on Debian Jessie. The Dockerfile I used is as follows:

FROM debian:jessie

RUN apt-get update && apt-get install -y build-essential cmake ragel

COPY . /src

RUN cd /src && ./configure && make all test install

# hack to deal with squash: error while loading shared libraries: libsquash0.8.so.0.8.0: cannot open shared object file: No such file or directory
#RUN ln -s /usr/local/lib/libsquash0.8.so.0.8.0 /usr/lib/

I then executed this in a clean git checkout (commit 04c9b77) with initialized submodules by running docker build -t aboyett/squash . The tests completed successfully and installation appears to have succeeded, but the installed squash binary cannot find libsquash.so

$ docker run aboyett/squash squash --help
squash: error while loading shared libraries: libsquash0.8.so.0.8.0: cannot open shared object file: No such file or directory

If I run ln -s /usr/local/lib/libsquash0.8.so.0.8.0 /usr/lib/ (commented final line of the Dockerfile,) I then am able to execute squash successfully:

$ docker run aboyett/squash squash --help
Usage: squash [OPTION]... INPUT [OUTPUT]
Compress and decompress files.

Options:
        -k, --keep              Keep input file when finished.
        -o, --option key=value  Pass the option to the encoder/decoder.
        -1 .. -9                Pass the compression level to the encoder.
                                Equivalent to -o level=N
        -c, --codec codec       Use the specified codec.  By default squash will
                                attempt to guess it based on the extension.
        -L, --list-codecs       List available codecs and exit
        -P, --list-plugins      List available plugins and exit
        -f, --force             Overwrite the output file if it exists.
        -d, --decompress        Decompress
        -V, --version           Print version number and exit
        -h, --help              Print this help screen and exit.

I would expect make install to yield a working installation without the need to symlink the shared lib. Please let me know if this issue is due to operator error :smile:

nemequ commented 8 years ago

It's a pretty common issue on Debian (and Debian-based distros like Ubuntu). You need to run ldconfig. This isn't just a Squash thing; it's true for every shared library you install to /usr/local.

aboyett commented 8 years ago

Ah, of course, running ldconfig fixed it right up. I've gotten to used to build systems and package managers handling that for me and forgot cmake doesn't do it.