Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#65683 closed defect (fixed)

darktable: curve-tool: opportunistic use of OpenMP

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc:
Port: darktable

Description

While the previous build of this port succeeded on our 10.15 buildbot, the latest fails with a link error for the curve-tool utility:

Undefined symbols for architecture x86_64:
  "___kmpc_for_static_fini", referenced from:
      _.omp_outlined. in darktable-curve-tool.c.o
      _.omp_outlined..66 in darktable-curve-tool.c.o
  "___kmpc_for_static_init_4", referenced from:
      _.omp_outlined. in darktable-curve-tool.c.o
      _.omp_outlined..66 in darktable-curve-tool.c.o
  "___kmpc_fork_call", referenced from:
      _linearize_16bit in darktable-curve-tool.c.o
      _linearize_8bit in darktable-curve-tool.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [share/darktable/tools/basecurve/darktable-curve-tool] Error 1

Two changes have been made since the last successful build:

  • Blacklisting Xcode Clang < 1200
  • A GraphicsMagick-related patch, to disable signal handler registration by that library; issue:64252

The link command for the previous successful build, is:

/usr/bin/clang++ -pipe -DNDEBUG -I/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
-D_DARWIN_C_SOURCE -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wthread-safety -Wno-unknown-pragmas -Wno-error=varargs
-Wno-error=address-of-packed-member -O3 -DNDEBUG -arch x86_64 -mmacosx-version-min=10.15 -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-L/opt/local/lib -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -L/usr/lib
"CMakeFiles/darktable-curve-tool.dir/darktable-curve-tool.c.o" "CMakeFiles/darktable-curve-tool.dir/exif-wrapper.cpp.o"
-o darktable-curve-tool -Wl,-rpath,/opt/local/lib /opt/local/lib/libexiv2.dylib -lm

While the latest, is as follows. As expected, the only difference relates to Clang:

/opt/local/bin/clang++-mp-13 -pipe -DNDEBUG -I/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
-D_DARWIN_C_SOURCE -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wthread-safety -Wno-unknown-pragmas -Wno-error=varargs
-Wno-error=address-of-packed-member -O3 -DNDEBUG -arch x86_64 -mmacosx-version-min=10.15 -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-L/opt/local/lib -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -L/usr/lib
"CMakeFiles/darktable-curve-tool.dir/darktable-curve-tool.c.o" "CMakeFiles/darktable-curve-tool.dir/exif-wrapper.cpp.o"
-o darktable-curve-tool  -Wl,-rpath,/opt/local/lib /opt/local/lib/libexiv2.dylib -lm

Of note, when building locally on 10.15, I'm not able to reproduce the link error.

Are the undefined symbols related to libomp, or something similar...?

Change History (6)

comment:1 Changed 21 months ago by Christopher Nielsen <mascguy@…>

In 92cadfc5c4e987428b2608540fce00a9ec64bf20/macports-ports (master):

darktable-devel: curve-tool: ensure build respects USE_OPENMP
See: #65683

comment:2 Changed 21 months ago by mascguy (Christopher Nielsen)

Sure enough, this was caused by OpenMP being opportunistically used by the curve-tool build: While all other modules respect global CMake variable USE_OPENMP, that tool doesn't.

The patch added via comment:1 does the trick. And as an added bonus, this also fixes builds for the curve and noise tools across-the-board. (The opportunistic OpenMP usage was the problem all along.) Nice!

comment:3 Changed 21 months ago by Christopher Nielsen <mascguy@…>

In 2f8fe26bae7c95d4c9bb1c0b1eae2f8c8e6161f7/macports-ports (master):

darktable-devel: enable curve and noise tools across-the-board

  • Now possible, thanks to OpenMP-related patch

See: #65474
See: #65683

comment:4 Changed 21 months ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 8b27e40c0bdf221b15b4a5e245ae7751f08ef8cd/macports-ports (master):

darktable: enable curve and noise tools across-the-board

  • Now possible, thanks to OpenMP-related patch

See: #65474
Fixes: #65683

comment:5 Changed 21 months ago by mascguy (Christopher Nielsen)

Summary: darktable: link failure for darktable-curve-tool, on 10.15darktable: curve-tool: opportunistic use of OpenMP

comment:6 Changed 21 months ago by mascguy (Christopher Nielsen)

PR submitted to upstream, with our OpenMP patch:

12356 - curve-tool: cmake: enable/disable OpenMP use, via USE_OPENMP

Note: See TracTickets for help on using tickets.