Solved graphics/ImageMagick6-nox11 /usr/bin/ld: cannot find -lomp

I'm having trouble on one jail with one port after my 11.2 upgrade (from 10.4): graphics/ImageMagick6-nox11

Both graphics/ImageMagick6-nox11 and graphics/ImageMagick7-nox11 fail with "/usr/bin/ld: cannot find -lomp"

In both cases, the OPENMP option is NOT selected. I found PR 223518 which seems to be relevant, but messing with clang vs. GCC and enabling and disabling OPENMP haven't changed the outcome. I do note that there's a compiler message about using threads since perl is threaded, so the OPENMP flag might not make any difference.

In ImageMagick6 the fail is

Code:
libtool: link: cc -shared  -fPIC -DPIC  coders/.libs/coders_dng_la-dng.o   -Wl,-rpath -Wl,/var/ports/usr/ports/graphics/ImageMagick6-nox11/work/ImageMagick-6.9.10-14/magick/.libs -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib magick/.libs/libMagickCore-6.so -lpthread -L/usr/local/lib -lfreetype -llqr-1 -lglib-2.0 -lintl -lfftw3 -lxml2 -llzma -lbz2 -lz /usr/local/lib/libltdl.so -lm -lraw_r -llcms2  -Oz -march=barcelona -mtune=barcelona -march=amdfam10 -fstack-protector -pthread -fstack-protector -fopenmp   -pthread -fopenmp -Wl,-soname -Wl,dng.so -Wl,-version-script -Wl,coders/.libs/dng.so-ver -o coders/.libs/dng.so
/usr/bin/ld: cannot find -lomp
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:5688: coders/dng.la] Error 1
gmake[2]: *** Waiting for unfinished jobs....

and in ImageMagick7 it is

Code:
10 -fstack-protector -pthread -fstack-protector   -pthread -Wl,-soname -Wl,dpx.so -Wl,-version-script -Wl,coders/.libs/dpx.so-ver -o coders/.libs/dpx.so
/usr/bin/ld: cannot find -lomp
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:6385: coders/dng.la] Error 1
gmake[2]: *** Waiting for unfinished jobs....

There are some bugs about this here and there, but no obvious fixes. I also posted as PR 223946.

FreeBSD 11.2-RELEASE-p6 #0 r341740
 
c++ --version
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
Target: x86_64-unknown-freebsd11.2
Thread model: posix
InstalledDir: /usr/bin
 
I often have that same issue. It seems to creep up with every other update. All I can suggest is grepping through the option files and either enable or disable OPENMP everywhere. There seems to be something dodgy going on if its only partially on or off on all its dependencies.
 
Oh weird. First time for me, but that does make sense - not all jails are having this problem. I'll try make rmconfig first and report back.
 
no luck that route
make clean
make distclean
make rmconfig
portmaster graphics/ImageMagick6-nox11



Code:
attempt to open /usr/local/lib/libraw_r.so succeeded
-lraw_r (/usr/local/lib/libraw_r.so)
attempt to open /usr/local/lib/liblcms2.so succeeded
-llcms2 (/usr/local/lib/liblcms2.so)
attempt to open /usr/local/lib/libomp.so failed
attempt to open /usr/local/lib/libomp.a failed
attempt to open /usr/lib/libomp.so failed
attempt to open /usr/lib/libomp.a failed
attempt to open /basejail/usr/bin/../libdata/libomp.so failed
attempt to open /basejail/usr/bin/../libdata/libomp.a failed
attempt to open //lib/libomp.so failed
attempt to open //lib/libomp.a failed
attempt to open //usr/lib/libomp.so failed
attempt to open //usr/lib/libomp.a failed
/usr/bin/ld: cannot find -lomp
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:5688: coders/dng.la] Error 1
gmake[2]: Leaving directory '/var/ports/usr/ports/graphics/ImageMagick6-nox11/work/ImageMagick-6.9.10-14'
gmake[1]: *** [Makefile:5257: all] Error 2
gmake[1]: Leaving directory '/var/ports/usr/ports/graphics/ImageMagick6-nox11/work/ImageMagick-6.9.10-14'
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/ImageMagick6-nox11
 
graphics/ImageMagick6-nox11 compiled and installed with portmaster -o graphics/ImageMagick6-nox11 ImageMagick-nox11-6.9.9.28_2,1 with GCC with these changes to /etc/make.conf:

Code:
.if ${.CURDIR:M*graphics/ImageMagick6-nox11*}
  CC=gcc8
  CXX=g++8
  CPP=cpp8
  CFLAGS= -O2 -pipe -march=barcelona -mtune=barcelona
  COPTFLAGS= -O2 -pipe  -march=barcelona -mtune=barcelona
.endif
 
Back
Top