InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.37k stars 660 forks source link

itkTestDriver link error with afl-clang-fast++ compiler #4649

Open seanm opened 1 month ago

seanm commented 1 month ago

I'm trying to build ITK master with the afl-clang-fast++ compiler and hit a link error right at the very end:

ld: Undefined symbols:
  std::exception_ptr::__from_native_exception_pointer(void*), referenced from:
      std::exception_ptr std::make_exception_ptr[abi:ne180100]<std::__1::future_error>(std::__1::future_error) in libITKCommon.a[98](itkPoolMultiThreader.cxx.o)
  ___cxa_init_primary_exception, referenced from:
      std::exception_ptr std::make_exception_ptr[abi:ne180100]<std::__1::future_error>(std::__1::future_error) in libITKCommon.a[98](itkPoolMultiThreader.cxx.o)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/itkTestDriver] Error 1
make[1]: *** [Modules/Core/TestKernel/src/CMakeFiles/itkTestDriver.dir/all] Error 2
make: *** [all] Error 2

Searching the codebase for itkTestDriver, I found a build setting named DO_NOT_BUILD_ITK_TEST_DRIVER, which if I set to 1 results in that thing not being built and therefore no link error. (Looks like I'm not the first to not want it, but interestingly that string appears exactly once.)

I'm configuring with:

BUILD_TESTING = OFF
DISABLE_MODULE_TESTS = ON

Which I thought disabled all testing stuff. Assuming so, why is itkTestDriver even being built? From its name, it seems like it should not be needed given my build options.

thewtex commented 1 month ago

itkTestDriver is an executable that is installed. Other projects that depend on ITK may use it for their testing even though they may not want to test ITK themselves.