Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "/opt/mozjpeg/lib/libjpeg.a: No such file or directory" on building jpeg-archive with Mozjpeg v4 #124

Open
xfuturomax opened this issue Sep 20, 2021 · 2 comments

Comments

@xfuturomax
Copy link

I've tried to build a docker image on alpine with version 4 of mozjpeg and got an error from subject. This is part of my Dockerfile:

...
ENV MOZJPEG_VERSION=4.0.3 \
    JPEGARCHIVE_VERSION=2.2.0
...
# mozjpeg
    cd /tmp; \
    curl -L -O https://github.com/mozilla/mozjpeg/archive/v$MOZJPEG_VERSION.tar.gz; \
    tar zxf v$MOZJPEG_VERSION.tar.gz; \
    cd mozjpeg-$MOZJPEG_VERSION; \
    mkdir build; \
    cd build; \
    cmake -G"Unix Makefiles" -DWITH_JPEG8=1 -DENABLE_STATIC=FALSE -DPNG_SUPPORTED=TRUE ../; \
    make; \
    make install; \
# jpeg-archive
    cd /tmp; \
    curl -L -O https://github.com/danielgtaylor/jpeg-archive/archive/v$JPEGARCHIVE_VERSION.tar.gz; \
    tar zxf v$JPEGARCHIVE_VERSION.tar.gz; \
    cd jpeg-archive-$JPEGARCHIVE_VERSION; \
    export CFLAGS="-fcommon"; \
    make; \
    make install; \
...

Generally, is it possible to build jpeg-archive with verison 4 of mozjpeg at this moment?
I've also tried to build mozjpeg with
-DCMAKE_INSTALL_LIBDIR=/opt/mozjpeg/lib/
and
ln -s /opt/mozjpeg/lib64/ /opt/mozjpeg/lib; but unsuccessfully.

And jpeg-archive successfully builds with 3.3.1 version of mozjpeg.

@zvezdochiot
Copy link

❓ Maybe use jpeg-recompress based on the standard libjpeg: https://github.com/ImageProcessing-ElectronicPublications/jpeg-recompress ?

@ThomasLohner
Copy link

@xfuturomax for me this works on ubuntu 20.04. After this the jpeg-recompress binary is transportable because of static build:

apt-get update
apt-get install -y cmake zlib1g-dev libpng-dev git
git clone https://github.com/mozilla/mozjpeg.git
cd mozjpeg
mkdir build && cd build
cmake -G"Unix Makefiles" ../
make
make install
cd /
git clone https://github.com/danielgtaylor/jpeg-archive.git
cd jpeg-archive
LDFLAGS="--static“ make
make install
cd /
git clone https://github.com/kornelski/pngquant.git
apt-get install build-essential git pkg-config libpng-dev
./configure  --extra-ldflags=-static
make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants