How to install GraphicsMagick with PNG support on Amazon EC2?

If you naively follow the steps on the GraphicsMagick website , after running ./configure you are not getting PNG support:

 checking for PNG support ... checking png.h usability... no checking png.h presence... no PNG --with-png=yes no 

This leads to a rather useless installation of GraphicsMagick.

How to enable PNG support? Libpng seems to be already installed but not detected:

 > $ sudo yum install libpng > Package 2:libpng-1.2.49-1.12.amzn1.x86_64 already installed and latest version 
+6
source share
1 answer

You need to install the libpng-devel in addition to just libpng :

 sudo yum install libpng-devel 

Then, when you run ./configure , everything will work as you hope:

 checking for PNG support ... checking png.h usability... yes checking png.h presence... yes PNG --with-png=yes yes (-lpng12) 

<Rant> That is why everything should be available in packages that clearly define their dependencies and are easily installed with package managers, instead of requiring a secret knowledge of the compilation prerequisites. </Rant>

+11
source

Source: https://habr.com/ru/post/918988/


All Articles