emcconville / wand

The ctypes-based simple ImageMagick binding for Python
http://docs.wand-py.org/
Other
1.39k stars 199 forks source link

[UBUNTU][DOCKER] MagickWand shared library not found. #655

Open Akado2009 opened 5 months ago

Akado2009 commented 5 months ago

Hi,

trying to run a wand application in docker container. Below if the installation processed of ImageMagick:

RUN apt-get update ${APT_UPDATE_OPTIONS} \
    && apt-get install ${APT_INSTALL_OPTIONS} -y \
        build-essential \
        git \
        autoconf \
        libde265-dev \
        libdjvulibre-dev \
        libfftw3-dev \
        libghc-bzlib-dev \
        libgoogle-perftools-dev \
        libgraphviz-dev \
        libgs-dev \
        libheif-dev \
        libjbig-dev \
        libjemalloc-dev \
        libjpeg-dev \
        liblcms2-dev \
        liblqr-1-0-dev \
        liblzma-dev \
        libopenexr-dev \
        libopenjp2-7-dev \
        libpango1.0-dev \
        libraqm-dev \
        libraw-dev \
        librsvg2-dev \
        libtiff-dev \
        libwebp-dev \
        libwmf-dev \
        libxml2-dev \
        libzip-dev \
        libzstd-dev \
        libltdl-dev \
        libperl-dev

RUN git clone --depth 1 --branch 6.9.10-54 https://github.com/ImageMagick/ImageMagick6.git \
    && cd ImageMagick6 \
    && ./configure --prefix="/usr/" \
        --with-modules=yes \
        -disable-opencl \
        --with-ltdl=no \
        --with-bzlib=yes \
        --with-dps=yes \
        --with-fftw=yes \
        --with-flif=yes \
        --with-fontconfig=yes \
        --with-fpx=yes \
        --with-freetype=yes \
        --with-gslib=yes \
        --with-gvc=yes \
        --with-heic=yes \
        --with-jbig=yes \
        --with-jemalloc=yes \
        --with-jpeg=yes \
        --with-jxl=yes \
        --with-lcms=yes \
        --with-lqr=yes \
        --with-lzma=yes \
        --with-magick-plus-plus=yes \
        --with-openexr=yes \
        --with-openjp2=yes \
        --with-pango=yes \
        --with-perl=yes \
        --with-png=yes \
        --with-raqm=yes \
        --with-raw=yes \
        --with-rsvg=yes \
        --with-tcmalloc=yes \
        --with-tiff=yes \
        --with-webp=yes \
        --with-wmf=yes \
        --with-x=yes \
        --with-xml=yes \
        --with-zip=yes \
        --with-zlib=yes \
        --with-zstd=yes \
        --with-gcc-arch=native \
    && make -j 8 \
    && make install \
    && ldconfig /usr/lib

/usr/lib looks fine in terms of so file. All the binaries are good (e.g. mogrify, convert).

image

Wand version is Wand==0.6.13. When I run without MAGICK_HOME, I get the follow error:

image

if you set MAGICK_HOME=/usr, you get the following one:

image

Feels kinda awkward, since some of the paths the app is trying to look for are actually present.

Also all binaries are properly linked:

image

Any way I can actually run my app?

anthonyhughes commented 2 months ago

I'm having the same issue. ubuntu:20.04 docker image.

emcconville commented 2 months ago

Remove --with-tcmalloc=yes & --with-jemalloc=yes flags when compiling ImageMagick from source. In fact, add --without-jemalloc / --without-tcmalloc to ensure they don't get used. Those are all customized memory allocators that will not work in a docker/ubuntu/python runtime.