Skip to content

ITK_MINIMUM_COMPLIANCE_LEVEL != Module not found #1675

Description

@aylward

Description

A module blocked by Compliance Level

  1. doesn't generate an error during ITK compilation
  2. generates an seemingly unrelated error when that module is attempted to be used by package being compiled against that ITK
  3. if I am using a build directory from a version of ITK from a few weeks ago and just do a git update master and recompile, the above error does NOT happen, and all appears to work...waiting for me to remove my build directory when the above errors will then appear

Steps to Reproduce

When configuring ITK with the command:
HEAD is now at 1554b66 Merge pull request #1262 from SimonRit/shadow_warning_eigen
+ cd ..
+ mkdir ITK-Debug
+ cd ITK-Debug
+ cmake -GNinja -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DModule_MinimalPathExtraction=ON -DCMAKE_BUILD_TYPE=Debug ../ITK

No error / warning is ever reported, BUT since MinimalPathExtraction is at Compliance Level 2 and the default Minimum Compliance Level is 4, the MinimalPathExtraction module is not actually built!

However, when I go to compile ITKTubeTK against that ITK and have MinimalPathExtraction as a required component (via find_package), I get the subtle error

CMake Error at /home/vsts/work/1/ITK/CMake/ITKModuleAPI.cmake:78 (message):
  No such module: "MinimalPathExtraction"
Call Stack (most recent call first):
  /home/vsts/work/1/ITK/CMake/ITKModuleAPI.cmake:31 (itk_module_load)
  /home/vsts/work/1/ITK/CMake/ITKModuleAPI.cmake:129 (_itk_module_config_recurse)
  /home/vsts/work/1/ITK-Debug/ITKConfig.cmake:83 (itk_module_config)
  CMakeLists.txt:135 (find_package)

"No such module" is really hard to track down. The error is reported in CMake/ITKModuleAPI.cmake, but the real problem to fix the error is the compliance level test in a different file: CMake/ITKRemoteModuleAPI.cmake.

One hour later, after dashboards were failing but local build was happily working, I figured this out and realized that had to specify -DITK_MINIMUM_COMPLIANCE_LEVEL=1 when compiling ITK.

Recommendations

  • Throw an error if a module is requested that doesn't meet minimum compliance
  • Throw a different error that is descriptive if a module is requested and it is not possible to add it because it doesn't meet the minimum_compliance_level.

Metadata

Metadata

Labels

type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions