New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU modules are listed as available even if `ITK_USE_GPU` is `OFF` #415

Open
fbudin69500 opened this Issue Jan 15, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@fbudin69500
Copy link
Contributor

fbudin69500 commented Jan 15, 2019

Description

ITK GPU modules such as ITKGPUCommon are listed in ITK_MODULES_ENABLED in ITKConfig.cmake even if ITK_USE_GPU is set to OFF.

Steps to Reproduce

  1. Configure ITK build tree with default values (ITK_USE_GPU is OFF by default).
  2. Open ITKConfig.cmake that is generated in build folder
  3. Look at content of ITK_MODULES_ENABLED and value of ITK_USE_GPU.

Expected behavior

The GPU modules should only be listed as enabled if ITK_USE_GPU is enabled.

Actual behavior

GPU modules are listed in ITK_MODULES_ENABLED even if ITK_USE_GPU is OFF.

Reproducibility

All the time.

Versions

I tested this on ITK v5.0beta3 but I expect this to happen on all ITK versions prior to that.

Environment

Tested on Ubuntu 18.04 but should happen on all systems.

Additional Information

Looking at the CMake code, it seems that ITK_USE_GPU CMake variable is only used to deactivate part of the GPU modules, not fully deactivate them.

Maybe someone could contribute a patch so that the GPU modules are not listed as enabled if ITK_USE_GPU is OFF. I see several ways this could be fixed:

  1. ITK_GPU modules should be excluded from the default modules (EXCLUDE_FROM_DEFAULT).
  2. Maybe the CMake variable ITK_USE_GPU could be used to activate or deactivate ITKGPUCommon, which should be sufficient to deactivate all the other GPU modules which I expect to require this main GPU module (I have not verified this statement).
  3. There is currently no mechanism in the build system of ITK to require a CMake variable value to activate modules. One could envision the addition of such a mechanism.
  4. A possible simple solution would be to update the individual CMake code of all these GPU modules to only activate them if ITK_USE_GPU is ON instead of only removing part of each module based on the value of ITK_USE_GPU.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment