安装过程中命令:
cd /usr/local/src
yum install freetype* ghostscript* libjpeg* libpng* libtiff* zlib*
wget http://pkgs.fedoraproject.org/repo/pkgs/ImageMagick/ImageMagick-6.2.8-0.tar.bz2/484cd7b62fac2164e8257449405f2563/ImageMagick-6.2.8-0.tar.bz2
wget http://downloads.jmagick.org/6.2.6/JMagick-6.2.6-0.tar.gz
------------------
tar xjvf ImageMagick-6.2.8-0.tar.bz2
tar xzvf JMagick-6.2.6-0.tar.gz
cd /usr/local/src/ImageMagick-6.2.8
./configure -prefix=/usr/local/ImageMagick && make && make install
cd /usr/local/src/JMagick-6.2.6-0
./configure --with-magick-home=/usr/local/ImageMagick && make all && make install
# copy libs into specific directories
cp lib/libJMagick.so /usr/lib64/libJMagick.so
cp lib/libJMagick.so ${JAVA_HOME}/jre/lib/libJMagick.so
cp lib/libJMagick.so ${JAVA_HOME}/jre/lib/ext/libJMagick.so
cp lib/libJMagick.so ${JAVA_HOME}/lib/libJMagick.so
cp lib/libJMagick.so /usr/local/lib/libJMagick.so
cp lib/jmagick.jar ${JAVA_HOME}/bin/jmagick.jar
cp lib/jmagick.jar ${JAVA_HOME}/jre/jmagick.jar
cp lib/jmagick.jar ${JAVA_HOME}/jre/lib/jmagick.jar
cp lib/jmagick.jar ${JAVA_HOME}/jre/lib/ext/jmagick.jar
cp lib/jmagick.jar /usr/local/lib/jmagick.jar
cd /usr/local/lib
cp libJMagick.so /usr/lib64/libJMagick.so
cp libJMagick.so ${JAVA_HOME}/jre/lib/libJMagick.so
cp libJMagick.so ${JAVA_HOME}/jre/lib/ext/libJMagick.so
cp libJMagick.so ${JAVA_HOME}/lib/libJMagick.so
cp libJMagick.so /usr/local/lib/libJMagick.so
cp jmagick.jar ${JAVA_HOME}/bin/jmagick.jar
cp jmagick.jar ${JAVA_HOME}/jre/jmagick.jar
cp jmagick.jar ${JAVA_HOME}/jre/lib/jmagick.jar
cp jmagick.jar ${JAVA_HOME}/jre/lib/ext/jmagick.jar
cp jmagick.jar /usr/local/lib/jmagick.jar
遇到的问题
Magick++/lib/Image.cpp: In function 'void Magick::InitializeMagick(const char*)':
Magick++/lib/Image.cpp:3811: error: 'atexit' was not declared in this scope
make: *** [Magick++/lib/Image.lo] 错误 1
后来发现原来是gcc版本的问题。新系统的gcc版本比较新,对于旧的写法有些不兼容。
旧的版本gcc某些不需要明确的声明include的地方,在新的gcc中不再支持,必须明确的声明。
进入ImageMagick目录下的Magick++/lib目录下,编辑Image.cpp文件,在头部include声明的代码中增加一行:
#include <stdlib.h>
重新make就可以了。
make[1]: *** [PerlMagick/Makefile] 错误 2
解决方法:
yum -y install perl-CPAN
Unable to find ImageMagick header files
网友评论