我在运行 pecl 的 big sur 上运行的 mac 上安装 imagick 时遇到问题。
我确实使用 brew 成功安装了 imagemagick,但在运行 library not found
后得到了 sudo pecl install imagick
。这里是完整的错误 (https://pastebin.com/SULyu9Rx):
....
.....
.....
^~~~~~~~
2 warnings generated.
/bin/sh /private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/libtool --mode=compile cc -Xpreprocessor -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -Xpreprocessor -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/imagemagick/7.1.0-0/include/ImageMagick-7 -I. -I/private/tmp/pear/temp/imagick -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/include -I/private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/main -I/private/tmp/pear/temp/imagick -I/usr/local/Cellar/php@7.4/7.4.20/include/php -I/usr/local/Cellar/php@7.4/7.4.20/include/php/main -I/usr/local/Cellar/php@7.4/7.4.20/include/php/TSRM -I/usr/local/Cellar/php@7.4/7.4.20/include/php/Zend -I/usr/local/Cellar/php@7.4/7.4.20/include/php/ext -I/usr/local/Cellar/php@7.4/7.4.20/include/php/ext/date/lib -I/usr/local/Cellar/imagemagick/7.1.0-0/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/imagick/shim_im6_to_im7.c -o shim_im6_to_im7.lo
cc -Xpreprocessor -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -Xpreprocessor -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/imagemagick/7.1.0-0/include/ImageMagick-7 -I. -I/private/tmp/pear/temp/imagick -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/include -I/private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/main -I/private/tmp/pear/temp/imagick -I/usr/local/Cellar/php@7.4/7.4.20/include/php -I/usr/local/Cellar/php@7.4/7.4.20/include/php/main -I/usr/local/Cellar/php@7.4/7.4.20/include/php/TSRM -I/usr/local/Cellar/php@7.4/7.4.20/include/php/Zend -I/usr/local/Cellar/php@7.4/7.4.20/include/php/ext -I/usr/local/Cellar/php@7.4/7.4.20/include/php/ext/date/lib -I/usr/local/Cellar/imagemagick/7.1.0-0/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/imagick/shim_im6_to_im7.c -fno-common -DPIC -o .libs/shim_im6_to_im7.o
/bin/sh /private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/libtool --mode=link cc -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/include -I/private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/main -I/private/tmp/pear/temp/imagick -I/usr/local/Cellar/php@7.4/7.4.20/include/php -I/usr/local/Cellar/php@7.4/7.4.20/include/php/main -I/usr/local/Cellar/php@7.4/7.4.20/include/php/TSRM -I/usr/local/Cellar/php@7.4/7.4.20/include/php/Zend -I/usr/local/Cellar/php@7.4/7.4.20/include/php/ext -I/usr/local/Cellar/php@7.4/7.4.20/include/php/ext/date/lib -I/usr/local/Cellar/imagemagick/7.1.0-0/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -o imagick.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/modules imagick_file.lo imagick_class.lo imagickdraw_class.lo imagickpixel_class.lo imagickpixeliterator_class.lo imagick_helpers.lo imagick.lo imagickkernel_class.lo shim_im6_to_im7.lo -lgomp -Wl,-rpath,/usr/local
/Cellar/imagemagick/7.1.0-0/lib -L/usr/local/Cellar/imagemagick/7.1.0-0/lib -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/imagick.so -bundle .libs/imagick_file.o .libs/imagick_class.o .libs/imagickdraw_class.o .libs/imagickpixel_class.o .libs/imagickpixeliterator_class.o .libs/imagick_helpers.o .libs/imagick.o .libs/imagickkernel_class.o .libs/shim_im6_to_im7.o -lgomp -L/usr/local/Cellar/imagemagick/7.1.0-0/lib /usr/local/Cellar/imagemagick/7.1.0-0/lib/libMagickWand-7.Q16HDRI.dylib -L/usr/local/Cellar/little-cms2/2.12/lib -L/usr/local/opt/freetype/lib -L/usr/local/Cellar/glib/2.68.3/lib -L/usr/local/opt/gettext/lib -L/usr/local/Cellar/fontconfig/2.13.1/lib /usr/local/Cellar/imagemagick/7.1.0-0/lib/libMagickCore-7.Q16HDRI.dylib -Wl,-rpath -Wl,/usr/local/Cellar/imagemagick/7.1.0-0/lib
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [imagick.la] Error 1
ERROR: `make' failed
我从错误中观察到的,-lgomp
参数期望接收库位置,我怀疑在执行此行期间(在链接模式下)导致错误发生:
/bin/sh /private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/libtool --mode=link cc -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/include -I/private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/main -I/private/tmp/pear/temp/imagick -I/usr/local/Cellar/php@7.4/7.4.20/include/php -I/usr/local/Cellar/php@7.4/7.4.20/include/php/main -I/usr/local/Cellar/php@7.4/7.4.20/include/php/TSRM -I/usr/local/Cellar/php@7.4/7.4.20/include/php/Zend -I/usr/local/Cellar/php@7.4/7.4.20/include/php/ext -I/usr/local/Cellar/php@7.4/7.4.20/include/php/ext/date/lib -I/usr/local/Cellar/imagemagick/7.1.0-0/include/ImageMagick-7 -DHAVE_CONFIG_H -g -O2 -o imagick.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/pear/temp/pear-build-rootpIumPp/imagick-3.5.0/modules imagick_file.lo imagick_class.lo imagickdraw_class.lo imagickpixel_class.lo imagickpixeliterator_class.lo imagick_helpers.lo imagick.lo imagickkernel_class.lo shim_im6_to_im7.lo -lgomp -Wl,-rpath,/usr/local
/Cellar/imagemagick/7.1.0-0/lib -L/usr/local/Cellar/imagemagick/7.1.0-0/lib -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/imagick.so -bundle .libs/imagick_file.o .libs/imagick_class.o .libs/imagickdraw_class.o .libs/imagickpixel_class.o .libs/imagickpixeliterator_class.o .libs/imagick_helpers.o .libs/imagick.o .libs/imagickkernel_class.o .libs/shim_im6_to_im7.o -lgomp -L/usr/local/Cellar/imagemagick/7.1.0-0/lib /usr/local/Cellar/imagemagick/7.1.0-0/lib/libMagickWand-7.Q16HDRI.dylib -L/usr/local/Cellar/little-cms2/2.12/lib -L/usr/local/opt/freetype/lib -L/usr/local/Cellar/glib/2.68.3/lib -L/usr/local/opt/gettext/lib -L/usr/local/Cellar/fontconfig/2.13.1/lib /usr/local/Cellar/imagemagick/7.1.0-0/lib/libMagickCore-7.Q16HDRI.dylib -Wl,-rpath -Wl,/usr/local/Cellar/imagemagick/7.1.0-0/lib
发现上面的命令有两个-lgomp
:
-lgomp -Wl
和-lgomp -L/usr/local/Cellar/imagemagick/7.1.0-0/lib......
我在这里,坚持下去,不知道找不到哪个库。
Pecl 版本
PEAR Version: 1.10.12
PHP Version: 7.4.20
Zend Engine Version: 3.4.0
Running on: Darwin users-MacBook-Pro.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
MagickWand-config 位置
/usr/local/bin/MagickWand-config
imagemagick 版本
imagemagick 7.1.0-0
imagick 版本
imagick-3.5.0
答案 0 :(得分:0)
[已解决]
似乎 imagemagick
7.1.0-0 版无法与 imagick
3.5.0 版(撰写本文时的稳定和最新版本)一起正常工作。
必须从带有标记版本3.4.4
的源代码 (https://github.com/Imagick/imagick) 构建。没有在任何文档中找到这两个版本之间的兼容性。
希望也能帮助到那里的人:)