php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81219 imagick -- ld: library not found for -lgomp
Submitted: 2021-07-01 17:13 UTC Modified: 2021-07-11 04:22 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: jesse dot greathouse at gmail dot com Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 7.4.21 OS: macOS Big Sur 11.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jesse dot greathouse at gmail dot com
New email:
PHP Version: OS:

 

 [2021-07-01 17:13 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-01 17:59 UTC] danack@php.net
-Status: Open +Status: Feedback
 [2021-07-01 17:59 UTC] danack@php.net
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.
 [2021-07-11 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC