Bug #81219 [Opn->Fbk]: imagick -- ld: library not found for -lgomp

From: Date: Thu, 01 Jul 2021 17:59:04 +0000
Subject: Bug #81219 [Opn->Fbk]: imagick -- ld: library not found for -lgomp
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234747@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81219&edit=1

 ID:                 81219
 Updated by:         danack@php.net
 Reported by:        jesse dot greathouse at gmail dot com
 Summary:            imagick -- ld: library not found for -lgomp
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Compile Failure
 Operating System:   macOS Big Sur 11.4
 PHP Version:        7.4.21
 Block user comment: N
 Private report:     N

 New Comment:

I'm not sure why this has become an issue now, but apparently it is due to gomp(GNU OpenMP)
being replaced by omp(LLVM's OpenMP) ....somewhere along the tool chain. See: https://github.com/Imagick/imagick/issues/430


I should probably do a new release, but applying this patch to the config.m4 file should fix the
issue for you: https://github.com/Imagick/imagick/commit/c9319d19410457b2bc07e9cdff1edf3983e7dfcf


-    PHP_CHECK_FUNC(omp_pause_resource_all, gomp)
-    PHP_ADD_LIBRARY(gomp,, IMAGICK_SHARED_LIBADD)

+    AS_IF([test "$(uname)" == "Darwin"],[
+      PHP_CHECK_FUNC(omp_pause_resource_all, omp)
+      PHP_ADD_LIBRARY(omp,, IMAGICK_SHARED_LIBADD)
+    ],[
+      PHP_CHECK_FUNC(omp_pause_resource_all, gomp)
+      PHP_ADD_LIBRARY(gomp,, IMAGICK_SHARED_LIBADD)
+    ])

If it doesn't, please let me know.


Previous Comments:
------------------------------------------------------------------------
[2021-07-01 17:13:02] jesse dot greathouse at gmail dot com

Description:
------------
I am using homebrew to install the ImageMagcik package. I cleaned the ImageMagick package from
homebrew and re-installed it. It installed ImageMagick v7.1.0-2. The same version which was there
before.

When I run:
pecl install imagick

The build fails during make with this output (entire output abbreviated to last make line)

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-2/lib
/usr/local/Cellar/imagemagick/7.1.0-2/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-2/lib/libMagickCore-7.Q16HDRI.dylib  -Wl,-rpath
-Wl,/usr/local/Cellar/imagemagick/7.1.0-2/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

The contents of my ImageMagick lib dir are as follows:

CERBERUS:~ jessegreathouse$ ls -lart /usr/local/Cellar/imagemagick/7.1.0-2/lib
total 18352
lrwxr-xr-x   1 jessegreathouse  admin       32 Jun 25 05:22 libMagickWand-7.Q16HDRI.dylib ->
libMagickWand-7.Q16HDRI.10.dylib
-r--r--r--   1 jessegreathouse  admin  1671024 Jun 25 05:22 libMagickWand-7.Q16HDRI.a
lrwxr-xr-x   1 jessegreathouse  admin       32 Jun 25 05:22 libMagickCore-7.Q16HDRI.dylib ->
libMagickCore-7.Q16HDRI.10.dylib
-r--r--r--   1 jessegreathouse  admin  3002240 Jun 25 05:22 libMagickCore-7.Q16HDRI.a
lrwxr-xr-x   1 jessegreathouse  admin       29 Jun 25 05:22 libMagick++-7.Q16HDRI.dylib ->
libMagick++-7.Q16HDRI.5.dylib
-r--r--r--   1 jessegreathouse  admin   912792 Jun 25 05:22 libMagick++-7.Q16HDRI.a
drwxr-xr-x   4 jessegreathouse  admin      128 Jun 25 05:22 ImageMagick
-rw-r--r--   1 jessegreathouse  admin   585872 Jul  1 10:14 libMagick++-7.Q16HDRI.5.dylib
-r--r--r--   1 jessegreathouse  admin  2015976 Jul  1 10:14 libMagickCore-7.Q16HDRI.10.dylib
-r--r--r--   1 jessegreathouse  admin  1185640 Jul  1 10:14 libMagickWand-7.Q16HDRI.10.dylib
-rwxr-xr-x   1 jessegreathouse  admin     1456 Jul  1 10:14 libMagick++-7.Q16HDRI.la
-rwxr-xr-x   1 jessegreathouse  admin     1333 Jul  1 10:14 libMagickCore-7.Q16HDRI.la
-rwxr-xr-x   1 jessegreathouse  admin     1402 Jul  1 10:14 libMagickWand-7.Q16HDRI.la
drwxr-xr-x  16 jessegreathouse  admin      512 Jul  1 10:14 .
drwxr-xr-x  10 jessegreathouse  admin      320 Jul  1 10:14 pkgconfig
drwxr-xr-x  15 jessegreathouse  admin      480 Jul  1 10:14 ..

I am using PHP compiled from source from the official 7.4.21 tarball

here is the configure line:

env
PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/pcre2/lib/pkgconfig
\
  ./configure \
    --prefix=${OPT}/php \
    --sysconfdir=${ETC} \
    --with-config-file-path=${ETC}/php \
    --with-config-file-scan-dir=${ETC}/php/conf.d \
    --enable-opcache \
    --enable-fpm \
    --enable-dom \
    --enable-exif \
    --enable-fileinfo \
    --enable-json \
    --enable-mbstring \
    --enable-bcmath \
    --enable-intl \
    --enable-ftp \
    --without-sqlite3 \
    --without-pdo-sqlite \
    --with-libxml \
    --with-xsl \
    --with-xmlrpc \
    --with-zlib \
    --with-curl \
    --with-webp \
    --with-openssl \
    --with-zip=/usr/local/opt/libzip \
    --with-sodium=/usr/local/opt/sodium \
    --with-mysqli=/usr/local/bin/mysql_config \
    --with-pdo-mysql=mysqlnd \
    --with-mysql-sock=/tmp/mysql.sock \
    --with-iconv=/usr/local/opt/libiconv
make
make install





Expected result:
----------------
I expect that the command: "pecl install imagick" will produce an imagick.so extension
module.

Actual result:
--------------
The imagick.so extension module is not created because make fails.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81219&edit=1


Thread (3 messages)

« previous php.bugs (#234747) next »