安装环境:centos 6.5 64位
安装步骤:
1.openssl
wget http://www.openssl.org/source/openssl-1.0.1i.tar.gz
tar zxvf openssl-1.0.1i.tar.gz
cd openssl-1.0.1i
./config shared --prefix=/usr/local --openssldir=/usr/ssl
make&&make install
2.cmake
wget http://www.cmake.org/files/v3.0/cmake-3.0.1.tar.gz
tar xzvf cmake-3.0.1.tar.gz
cd cmake-3.0.1
./bootstrap --prefix=/usr/local
make&&make install
3.libevent
wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
make&&make install
4.libjpeg-turbo未安装,libjpeg, giflib and libpng使用系统自带的
5.webp
wget http://downloads.webmproject.org/releases/webp/libwebp-0.4.1.tar.gz
tar zxvf libwebp-0.4.1.tar.gz
cd libwebp-0.4.1
./configure
make
sudo make install
6.imagemagick
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar zxvf ImageMagick.tar.gz
cd ImageMagick-版本号
./configure --prefix=/usr/local
make&&make install
7.libmemcached
yum install libmemcached-devel
8.zimg
git clone https://github.com/buaazp/zimg -b master --depth=1
cd zimg
make
ln -s /usr/local/include/ImageMagick-6 /usr/local/include/ImageMagick
PS:找到libmagickwand-dev这个包进行安装,比如在ubuntu中可以使用以下命令
sudo apt-get install libmagickwand-dev
如果是centOS的话可能需要自己查找一下类似的包,或者使用方案二。
sudo yum install ImageMagick-devel
第二种是手动修改cmakelist文件:
首先确保自己的系统里安装了imagemagick,执行这个命令有结果即为安装了:
ls /usr/local/lib/ |grep MagickWand
libMagickWand-6.Q16.a
libMagickWand-6.Q16.la
libMagickWand-6.Q16.so
libMagickWand-6.Q16.so.2
libMagickWand-6.Q16.so.2.0.0
然后你修改一下 src/CMakeLists.txt 文件,在108行开始
# find_package (ImageMagick COMPONENTS MagickWand REQUIRED)
set (ImageMagick_INCLUDE_DIRS "/usr/local/include/ImageMagick-6")
set (ImageMagick_MagickWand_LIBRARY "/usr/local/lib/libMagickWand-6.Q16.so")
先把原先那个find_package注释掉,然后加上后面那两行,在此执行cmake。