1.下载源码解压缩
#下载
wget http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/1.3.23/GraphicsMagick-1.3.23.tar.bz2/download
#解压缩
tar jxvf GraphicsMagick-1.3.23.tar.bz2
cd GraphicsMagick-1.3.23
2.安装依赖库
yum install -y libpng-devel libpng libjpeg libjpeg-devel libpng libpng-devel libtiff-devel libtiff libwmf-devel libwmf libxml2-devel libxml2 zlib-devel zlib gd-devel gd bzip2 bzip2-devel libzip-devel libzip libwebp libwebp-devel
3.编译安装
./configure --prefix=/usr/local/GraphicsMagick-1.3.23 --disable-static --enable-openmp --enable-shared --enable-symbol-prefix --with-webp=yes
make
make install
4.检查版本及支持格式
[root@iZ25m0tulr5Z ~]# gm version
GraphicsMagick 1.3.23 2015-11-07 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2015 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Feature Support:
Native Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP yes
DPS no
FlashPix no
FreeType yes
Ghostscript (Library) no
JBIG no
JPEG-2000 no
JPEG yes
Little CMS no
Loadable Modules no
OpenMP yes (200805)
PNG yes
TIFF yes
TRIO no
UMEM no
WebP yes
WMF yes
X11 yes
XML yes
ZLIB yes
Host type: x86_64-unknown-linux-gnu
Configured using the command:
./configure '--prefix=/usr/local/GraphicsMagick-1.3.23' '--disable-static' '--enable-openmp' '--enable-shared' '--enable-symbol-prefix'
Final Build Parameters:
CC = gcc -std=gnu99
CFLAGS = -fopenmp -g -O2 -Wall -pthread
CPPFLAGS = -I/usr/include/freetype2 -I/usr/include/libxml2
CXX = g++
CXXFLAGS = -pthread
LDFLAGS =
LIBS = -ltiff -lfreetype -ljpeg -lpng12 -lwmflite -lXext -lX11 -lbz2 -lxml2 -lz -lm -lgomp -lpthread
参考:
http://www.graphicsmagick.org/INSTALL-unix.html