[MacPorts] #57009: ImageMagick @6.9.9-40_1: inserts -lgomp into pkgconfig files, which breaks build when using clang
MacPorts
noreply at macports.org
Thu Sep 12 04:40:52 UTC 2019
#57009: ImageMagick @6.9.9-40_1: inserts -lgomp into pkgconfig files, which breaks
build when using clang
--------------------------+------------------------
Reporter: kencu | Owner: ryandesign
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: ImageMagick |
--------------------------+------------------------
Comment (by kencu):
I think you found a good clue to the issue. That
[https://github.com/ImageMagick/ImageMagick6/commit/7a8c2e5471b0595f1dcc1c8c6d3923919d566f8a
commit] results in this block in configure.ac.
{{{
#
# Find OpenMP library
#
GOMP_LIBS=''
if test "$enable_openmp" != 'no'; then
if test "${GCC}" = "yes"; then
# Open64 (passes for GCC but uses different OpenMP implementation)
if test "x$GOMP_LIBS" = x ; then
if $CC --version 2>&1 | grep Open64 > /dev/null ; then
AC_CHECK_LIB(openmp,omp_get_num_procs,GOMP_LIBS="-lopenmp",,)
fi
fi
# Clang (passes for GCC but uses different OpenMP implementation)
if test "x$LIB_OMP" = x ; then
if $CC --version 2>&1 | grep clang > /dev/null ; then
AC_CHECK_LIB(omp,GOMP_parallel_start,LIB_OMP="-lomp",,)
fi
fi
# GCC
if test "x$GOMP_LIBS" = x ; then
AC_CHECK_LIB(gomp,GOMP_parallel_start,GOMP_LIBS="-lgomp",,)
fi
else
# Sun CC
if test "x$GOMP_LIBS" = x ; then
AC_CHECK_LIB(mtsk,sunw_mp_register_warn,GOMP_LIBS="-lmtsk",,)
fi
# AIX xlc
if test "x$GOMP_LIBS" = x ; then
AC_CHECK_LIB(xlsmp,_xlsmpFlush,GOMP_LIBS="-lxlsmp",,)
fi
# SGI IRIX 6.5 MIPSpro C/C++
if test "x$GOMP_LIBS" = x ; then
AC_CHECK_LIB(mp,mp_destroy,GOMP_LIBS="-lmp",,)
fi
fi
LIBS="$GOMP_LIBS $LIBS"
fi
AC_SUBST(GOMP_LIBS)
}}}
on my system, both tests pass
{{{
configure:30053: checking for GOMP_parallel_start in -lomp
configure:30078: /opt/local/bin/clang-mp-5.0 -o conftest -fopenmp -pipe
-Os -arch x86_64 -Wall -mtune=westmere -fexceptions -D_FORTIFY_SOURCE=0
-pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
-I/opt/local/include -DMAGICKCORE_HDRI_ENABLE=0
-DMAGICKCORE_QUANTUM_DEPTH=16 -L/opt/local/lib
-Wl,-headerpad_max_install_names -arch x86_64 conftest.c -lomp -lm >&5
configure:30078: $? = 0
configure:30087: result: yes
configure:30097: checking for GOMP_parallel_start in -lgomp
configure:30122: /opt/local/bin/clang-mp-5.0 -o conftest -fopenmp -pipe
-Os -arch x86_64 -Wall -mtune=westmere -fexceptions -D_FORTIFY_SOURCE=0
-pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
-I/opt/local/include -DMAGICKCORE_HDRI_ENABLE=0
-DMAGICKCORE_QUANTUM_DEPTH=16 -L/opt/local/lib
-Wl,-headerpad_max_install_names -arch x86_64 conftest.c -lgomp -lm
>&5
configure:30122: $? = 0
configure:30131: result: yes
}}}
First of all I'm not at this moment sure how my `clang-5.0` links with
`-lgomp` during this test, but fails when I'm trying to build `virtuoso-7`
with that link flag. But that aside, it seems like the configure.ac bit
completely ignores whether the `-lomp` test passes or not -- it just
inserts the `GOMP_LIBS` into the link libs no matter what.
And so `-lgomp` gets passed along forever more as one of the required
`link libs`, even though `-lomp` worked.
Let me check if they fixed this in the newer versions of ImageMagick.
--
Ticket URL: <https://trac.macports.org/ticket/57009#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list