Skip to content

Instantly share code, notes, and snippets.

@Kelfitas
Last active February 7, 2024 02:47
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Kelfitas/f3fb99984698ccd79414c6a29e9f4edd to your computer and use it in GitHub Desktop.
Save Kelfitas/f3fb99984698ccd79414c6a29e9f4edd to your computer and use it in GitHub Desktop.
sudo su
apt-get install -y autoconf automake libtool nasm make pkg-config
cd /tmp
wget https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz
tar -xvf mozjpeg-3.1-release-source.tar.gz
cd mozjpeg
autoreconf -fiv
mkdir build && cd build
sh ../configure
make install
ln -s /opt/libmozjpeg/bin/jpegtran /usr/local/bin/mozjpeg
@n3storm
Copy link

n3storm commented Jul 16, 2018

maybe necessary to install pkg-config

apt-get install pkg-config

@gkirill
Copy link

gkirill commented Jan 20, 2019

I confirm I had also to add pkg-config

@vielhuber
Copy link

I had to use
ln -s /opt/mozjpeg/bin/jpegtran /usr/bin/mozjpeg

@Mimoza
Copy link

Mimoza commented Feb 23, 2020

I know it's obvious but «gcc» or «clang» is mandatory.
In my case, i needed :
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu

Another thing, «/tmp» is sometime mounted with «noexec» option (security reason) so it's better to do that in other directory, otherwise the «configure» step fail.

«make deb» produce an .deb, who can be cleaner to install/uninstall on system.

@kepi
Copy link

kepi commented May 25, 2020

I belive its really bad idea to compile programs under root user. It might be better to minimize sudo commands, i.e.:

sudo apt-get install -y autoconf automake libtool nasm make pkg-config
cd /tmp
wget https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz
tar -xvf mozjpeg-3.1-release-source.tar.gz
cd mozjpeg
autoreconf -fiv
mkdir build && cd build
sh ../configure
make
sudo make install
sudo ln -s /opt/mozjpeg/bin/jpegtran /usr/local/bin/mozjpeg

@vikas5914
Copy link

If anyone is looking for V4, please check this:https://gist.github.com/vikas5914/4affccdfa5c3a722808cd465f77866b9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment