rflynn / imgmin

Lossy image optimization
MIT License
650 stars 32 forks source link

Ubuntu Make Problem #28

Open brizoo opened 11 years ago

brizoo commented 11 years ago

Hi,

I'm encountering a "make" problem on ubuntu server 13.04 (GNU/Linux 3.8.0-33-generic x86_64).

Everything seems to be fine until the make command. I was able to install imgmin successfully on a 12.04 LTS ubuntu server, but not on this new machine. I love this script it is fast and the ratio quality/weight is just wonderful I think.

Below, the output in terminal:

root@pop-front1:~/imgmin# make make all-recursive make[1]: Entering directory /root/imgmin' Making all in src make[2]: Entering directory/root/imgmin/src' gcc -W -Wall -Os MagickWand-config --cflags --cppflags -o imgmin imgmin.c MagickWand-config --ldflags --libs imgmin.c: In function ‘do_png’: imgmin.c:389:9: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] imgmin.c:399:9: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] imgmin.c:406:9: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] imgmin.c:429:9: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] imgmin.c:368:32: warning: unused parameter ‘mw’ [-Wunused-parameter] imgmin.c:369:50: warning: unused parameter ‘opt’ [-Wunused-parameter] make -C apache2 make[3]: Entering directory /root/imgmin/src/apache2' if [ "apxs2" != "" ]; then \ apxs2 -Ipwd/..MagickWand-config --cppflags --ldflags --libs|xargs-Wc,-DIMGMIN_LIB -Wc,-W -Wc,-Wall -Wc,-Wno-unused-parameter -c mod_imgmin.c ../imgmin.c; \ fi Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1. apxs:Error: Unknown option: f. Usage: apxs -g [-S <var>=<val>] -n <modname> apxs -q [-S <var>=<val>] <query> ... apxs -c [-S <var>=<val>] [-o <dsofile>] [-D <name>[=<value>]] [-I <incdir>] [-L <libdir>] [-l <libname>] [-Wc,<flags>] [-Wl,<flags>] [-p] <files> ... apxs -i [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ... apxs -e [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ... make[3]: *** [mod_imgmin_la] Error 1 make[3]: Leaving directory/root/imgmin/src/apache2' make[2]: * [mod_imgmin] Error 2 make[2]: Leaving directory `/root/imgmin/src' make[1]: * [all-recursive] Error 1 make[1]: Leaving directory`/root/imgmin' make: *\ [all] Error 2

Do you know what this could be ?

Thanks

ptz0n commented 10 years ago

Have you installed the Prerequisites?

brizoo commented 10 years ago

Yes, I have all the prerequisites installed, as well as all configured correctly. Since the last version of ubuntu server I can't install imgmin.. Which is really sad because I really enjoy the quality / size obtained by using this script.

rflynn commented 10 years ago

the error is in building the apache module (apxs2 is an apache2 utility). the "make[1]" line appears to have correctly built the "imgmin" executable (with warnings).

micmro commented 9 years ago

I had the same issue and used @AerisG222's solution from #21 and it fixed the issue for me. I have created a PR with the change to src/apache2/Makefile.am.

Magotchi commented 9 years ago

AerisG222's solution from #21 was added in ea2b77c to fix this problem, but on Arch Linux with ImageMagick libs 6.9.2-0, the output of:

MagickWand-config --cppflags --ldflags --libs | xargs

is

-fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6 -lMagickWand-6.Q16HDRI -lMagickCore-6.Q16HDRI -lMagickWand-6.Q16HDRI -lMagickCore-6.Q16HDRI

Since there are multiple instances of "-fopenmp ", to fix the problem, I add the "g" (global) flag on sed, like:

$(MAGICK_CONFIG) --cppflags --ldflags --libs|xargs|sed "s/-fopenmp\s//g"

I only need this fix on systems with Apache installed, as the Apache module doesn't get built without it.