2013年3月31日星期日

gmagick安装错误

cc-shared  .libs/gmagick_helpers.o .libs/gmagick_methods.o .libs/gmagick.o .libs/gmagickdraw_methods.o .libs/gmagickpixel_methods.o  -L/usr/local/webserver/GraphicsMagick/lib /usr/local/webserver/GraphicsMagick/lib/libGraphicsMagickWand.a -L/usr/lib /usr/local/webserver/GraphicsMagick/lib/libGraphicsMagick.a  -Wl,-rpath -Wl,/usr/local/webserver/GraphicsMagick/lib -Wl,-rpath -Wl,/usr/local/webserver/GraphicsMagick/lib -Wl,-soname -Wl,gmagick.so -o .libs/gmagick.so 
/usr/bin/ld: /usr/local/webserver/GraphicsMagick/lib/libGraphicsMagickWand.a(drawing_wand.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC 
/usr/local/webserver/GraphicsMagick/lib/libGraphicsMagickWand.a: could not read symbols: Bad value 
collect2: ld returned 1 exit status 

make: *** Error 1
系统:
Linux test004 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 GNU/Linux

使用64位元编译就行
CFLAGS="-O3 -fPIC" ./configure

PHP 版本:PHP 5.4.5
编译这样ok,可是php 无法使用该扩展:
 
/home/php/bin/php: symbol lookup error: /home/php/lib/php/extensions/no-debug-non-zts-20100525/gmagick.so: undefined symbol: omp_get_num_procs
 
 
真是令人无语啊,装个扩展这么麻烦,最后来来回回好几次,终于搞定:
tar -zxvf GraphicsMagick-1.3.15.tar.gz
cd GraphicsMagick-1.3.15
CFLAGS="-O3 -fPIC" ./configure  --enable-shared
 
CFLAGS="-O3 -fPIC" make
make install
 
 
 
 
tar -zxvf gmagick-1.1.2RC1.tgz
 
cd gmagick-1.1.2RC1
 
 
/home/php/bin/phpize
 
CFLAGS="-O3 -fPIC" ./configure --with-php-config=/home/php/bin/php-config
 
 
CFLAGS="-O3 -fPIC" make
 
 
make install
 
 
 
 
 
我编译过失败几次,是因为之前有编译的时候没指定prefix,可能make 的时候没有覆盖成功,因此,删掉了  /usr/lib64 下面的 libGra* 和 /usr/bin/*Gra*

没有评论:

发表评论