Skip to content

Instantly share code, notes, and snippets.

@Kelfitas
Last active February 7, 2024 02:47
Show Gist options
  • Select an option

  • Save Kelfitas/f3fb99984698ccd79414c6a29e9f4edd to your computer and use it in GitHub Desktop.

Select an option

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
@gkirill

gkirill commented Jan 20, 2019

Copy link
Copy Markdown

I confirm I had also to add pkg-config

@vielhuber

Copy link
Copy Markdown

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

@Mimoza

Mimoza commented Feb 23, 2020

Copy link
Copy Markdown

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

kepi commented May 25, 2020

Copy link
Copy Markdown

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
Copy Markdown

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