Bug 257324

Summary: multimedia/vapoursynth: fails to build when ImageMagick7 is built with OPENMP=on
Product: Ports & Packages Reporter: Jack <xxjack12xx>
Component: Individual Port(s)Assignee: Daniel Engberg <diizzy>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: diizzy, xxjack12xx
Priority: --- Flags: jbeich: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Full log of compile error none

Description Jack 2021-07-22 06:47:10 UTC
===> The following configuration options are available for vapoursynth-r54:
     DEBUG=off: Build with debugging support
     DOCS=off: Build and/or install documentation
     FRAME_GUARD=off: Check integrity after each filter
     SIMD=on: Use CPU-specific optimizations
====> Components
     CORE=on: Core library
     PYTHON=on: Python bindings or support
     VSPIPE=on: Command line interface
     VSSCRIPT=on: Scripting library
====> Plugins
     ASS=on: Subtitles rendering via libass
     EEDI3=on: Very slow edge directed interpolation
     IMAGEMAGICK=on: ImageMagick image processing support
     MISCFILTERS=on: Miscellaneous filters
     MORPHO=on: Morphological filter
     TESSERACT=on: Optical Character Recognition via Tesseract
     REMOVEGRAIN=on: 3x3 median and convolution denoising
     VINVERSE=on: Remove residual combing
     VIVTC=on: Field matching, inverse telecine and decimation
===> Use 'make config' to modify these settings

If IMAGEMAGICK=on, the port does not compile.

gmake[2]: Entering directory '/usr/obj/usr/ports/multimedia/vapoursynth/work/vapoursynth-R54'
/bin/sh ./libtool  --tag=CXX --tag=disable-static  --mode=link c++ -std=c++11 -O3 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-ignored-attributes -I./include  -mfpmath=sse -msse2   -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DLIBICONV_PLUG -isystem /usr/local/include  -no-undefined -avoid-version  -Wl,--no-undefined -fstack-protector-strong  -o libimwri.la -rpath /usr/local/lib/vapoursynth src/filters/imwri/libimwri_la-imwri.lo -L/usr/local/lib -lMagick++-7 -lMagickWand-7 -lMagickCore-7  -L/usr/local/lib
libtool: link: c++  -fPIC -DPIC -shared -nostdlib /usr/lib/crti.o /usr/lib/crtbeginS.o  src/filters/imwri/.libs/libimwri_la-imwri.o   -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib /usr/local/lib/libMagick++-7.so /usr/local/lib/libMagickWand-7.so /usr/local/lib/libMagickCore-7.so -L/usr/lib -lc++ -lm -lc -lgcc -lgcc_s /usr/lib/crtendS.o /usr/lib/crtn.o  -O3 -mfpmath=sse -msse2 -O2 -fstack-protector-strong -Wl,--no-undefined -fstack-protector-strong   -pthread -fopenmp -Wl,-soname -Wl,libimwri.so -o .libs/libimwri.so
c++: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
ld: error: undefined symbol: Magick::Image::Image(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by imwri.cpp
>>>               src/filters/imwri/.libs/libimwri_la-imwri.o:(readCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*))
>>> referenced by imwri.cpp
>>>               src/filters/imwri/.libs/libimwri_la-imwri.o:(readGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*))

ld: error: undefined symbol: Magick::Image::magick(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by imwri.cpp
>>>               src/filters/imwri/.libs/libimwri_la-imwri.o:(writeGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*))

ld: error: undefined symbol: Magick::Image::attribute(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char const*)
>>> referenced by imwri.cpp
>>>               src/filters/imwri/.libs/libimwri_la-imwri.o:(writeGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*))

ld: error: undefined symbol: Magick::Image::write(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by imwri.cpp
>>>               src/filters/imwri/.libs/libimwri_la-imwri.o:(writeGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*))

ld: error: undefined symbol: Magick::Image::attribute(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) const
>>> referenced by imwri.cpp
>>>               src/filters/imwri/.libs/libimwri_la-imwri.o:(readSampleTypeDepth(ReadData const*, Magick::Image const&, VSSampleType&, int&))
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:1097: libimwri.la] Error 1
gmake[2]: Leaving directory '/usr/obj/usr/ports/multimedia/vapoursynth/work/vapoursynth-R54'
*** Error code 1

Stop.
make[1]: stopped in
Comment 2 Jack 2021-07-25 23:16:58 UTC
How can I create a log with poudriere? I'm having the same issue on multiple systems but all build fine with ImageMagick off
Comment 3 Jack 2021-07-26 03:42:42 UTC
Created attachment 226699 [details]
Full log of compile error

Here's a full build log of the failure.
Comment 4 Jan Beich freebsd_committer freebsd_triage 2021-07-27 16:18:05 UTC
Rebuild graphics/ImageMagick7 with OPENMP port option disabled. When using -fopenmp mixing Clang and GCC is generally not supported. For example, graphics/ImageMagick7 defines USES=compiler:openmp which currently forces lang/gcc10 on Clang architectures like amd64.

vapoursynth simply uses "pkg-config --cflags --libs Magick++" but -fopenmp only appears in --cflags but not --libs which looks like a (unrelated) bug: -fopenmp may require linking against libomp.so (clang) or libgomp.so (gcc).

Over to ImageMagick7 maintainer as I have no clue how to fix.
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2023-08-05 19:23:45 UTC
As of 69e0cbe8eaa6fb6fcb075774c4d8ef7b2a205bba there are no plugin dependencies as these have been moved out of main repo