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

Problem compiling on Ubuntu 12.04 #99

Closed
matylla opened this issue Aug 19, 2014 · 10 comments
Closed

Problem compiling on Ubuntu 12.04 #99

matylla opened this issue Aug 19, 2014 · 10 comments

Comments

@matylla
Copy link

matylla commented Aug 19, 2014

64-bit build on 64-bit Ubuntu 12.04

$ sh ../configure
../configure: line 12975: syntax error near unexpected token `libpng,'
../configure: line 12975: `PKG_CHECK_MODULES(libpng, libpng, HAVE_LIBPNG=1,'

Anyone?

@dwbuiten
Copy link
Contributor

When you ran autoreconf -fi, you were missing the pkg config macros.

$ dpkg -L pkg-config | grep m4
/usr/share/aclocal/pkg.m4

Do you have pkg-config installed?

@matylla
Copy link
Author

matylla commented Aug 19, 2014

Yes, thanks. That was the case. It's all good now.

@matylla matylla closed this as completed Aug 19, 2014
jodiecunningham added a commit to jodiecunningham/mozjpeg that referenced this issue Jan 22, 2015
szepeviktor added a commit to szepeviktor/jpeg-archive that referenced this issue May 11, 2015
See: mozilla/mozjpeg#99
I hope your are happy with leaving `$` signs. This way it can be copy-and-pasted.
@okor
Copy link

okor commented Sep 22, 2015

@dwbuiten @matylla Could you expand on the solution a bit for us mere mortals? Like if I am missing the pkg config macros which I don't really understand what further actions should I take to correct the problem?

Thanks!

@okor
Copy link

okor commented Sep 22, 2015

Ok, actually figured this out. For me, I had pkg-config installed already. But I had to do a sudo ldconfig /usr/lib since this was a fresh box.

Googlers: Ensure you have all packages installed reload shared libs before attempting to compile. So something like:

sudo apt-get -y install build-essential cmake libtool autoconf automake m4 nasm pkg-config
sudo ldconfig /usr/lib
cd ~
wget https://github.com/mozilla/mozjpeg/archive/v3.1.tar.gz
cd mozjpeg-3.1/
autoreconf -fiv
mkdir build
cd build
sh ../configure
sudo make install

Works for me.

@kappuccino
Copy link

thank you @okor for your condensed solution.

@thegbom
Copy link

thegbom commented Apr 12, 2018

sudo apt-get -y install build-essential cmake libtool autoconf automake m4 nasm pkg-config
sudo ldconfig /usr/lib
cd ~
wget https://github.com/mozilla/mozjpeg/archive/v3.1.tar.gz
tar -xvzf v3.1.tar.gz
cd mozjpeg-3.1/
autoreconf -fiv
mkdir build
cd build
sh ../configure
sudo make install

I supplemented a missing tar-statement. Running npm install after the steps above, I did not get the error.

@cbj4074
Copy link

cbj4074 commented Apr 12, 2018

Thanks for articulating the solution, @okor (and for providing the missing tar step, @thegbom ).

In my particular case, installing pkg-config "fixed" the issue, but the more poignant question seems to be, what causes the initial failure that requires building from source at all? This line:

⚠ The '/var/www/html/laravel/node_modules/mozjpeg/vendor/cjpeg' binary doesn't seem to work correctly

Why does this cjpeg binary not work correctly upon installation?

@kornelski
Copy link
Member

I have no idea why the node module complains. You're asking in the wrong project. The Node.js binary is maintained by https://github.com/imagemin/mozjpeg-bin

@cbj4074
Copy link

cbj4074 commented Apr 13, 2018

Thanks for clarifying the origin of the problem, @kornelski . I loathe to be the guy who complains to the incorrect project.

It looks like this may be the place to discuss this further:

imagemin/imagemin#168

@salehawal
Copy link

@dwbuiten it works
i ma using ubuntu
i installed the missing package : sudo apt-get install pkg-config
and then autoreconf -fi and now it is working thanks (:+1:

XiNGRZartis added a commit to XiNGRZartis/jpeg-archive that referenced this issue Jan 31, 2024
See: mozilla/mozjpeg#99
I hope your are happy with leaving `$` signs. This way it can be copy-and-pasted.
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

8 participants