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.43k stars 668 forks source link

[ITK 5.1|Windows] Using ITK_USE_CUFFTW does not pass configure #1809

Open Neumann-A opened 4 years ago

Neumann-A commented 4 years ago

Description

CUDA Toolkit installed and CUDA_PATH setup correctly. FindFFTW.cmake does not find the cuda libraries automatically on Windows. It also misses to add $ENV{CUDA_PATH}/include as a include directory

Neumann-A commented 4 years ago

After fixing the above I am hitting:

[823/1360] C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\cl.exe   /TP -DITKFFT_EXPORTS -D_CRT_FAR_MAPPINGS_NO_DEPRECATE -D_CRT_IS_WCTYPE_NO_DEPRECATE -D_CRT_MANAGED_FP_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE_GLOBALS -D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE -D_CRT_TIME_FUNCTIONS_NO_DEPRECATE -D_CRT_VCCLRIT_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -IModules\ThirdParty\Eigen3\src -IModules\ThirdParty\KWIML\src -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\KWIML\src -IModules\ThirdParty\KWSys\src -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\v3p\netlib -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\vcl -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\core -IModules\ThirdParty\VNL\src\vxl\v3p\netlib -IModules\ThirdParty\VNL\src\vxl\vcl -IModules\ThirdParty\VNL\src\vxl\core -IModules\Core\Common -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Core\Common\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Core\ImageAdaptors\include -IModules\ThirdParty\Netlib -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Numerics\Statistics\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\ImageFilterBase\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Core\Transform\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Core\ImageFunction\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\ImageGrid\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\core\vnl -ID:\qt2\installed\x64-windows\include\eigen3 /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /DVCPKG_IS_COOL -W3  /bigobj /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 /DVCPKG_IS_COOL_DEBUG /showIncludes /FoModules\Filtering\FFT\src\CMakeFiles\ITKFFT.dir\itkFFTWGlobalConfiguration.cxx.obj /FdModules\Filtering\FFT\src\CMakeFiles\ITKFFT.dir\ /FS -c D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx
FAILED: Modules/Filtering/FFT/src/CMakeFiles/ITKFFT.dir/itkFFTWGlobalConfiguration.cxx.obj 
C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\cl.exe   /TP -DITKFFT_EXPORTS -D_CRT_FAR_MAPPINGS_NO_DEPRECATE -D_CRT_IS_WCTYPE_NO_DEPRECATE -D_CRT_MANAGED_FP_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE_GLOBALS -D_CRT_SETERRORMODE_BEEP_SLEEP_NO_DEPRECATE -D_CRT_TIME_FUNCTIONS_NO_DEPRECATE -D_CRT_VCCLRIT_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -IModules\ThirdParty\Eigen3\src -IModules\ThirdParty\KWIML\src -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\KWIML\src -IModules\ThirdParty\KWSys\src -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\v3p\netlib -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\vcl -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\core -IModules\ThirdParty\VNL\src\vxl\v3p\netlib -IModules\ThirdParty\VNL\src\vxl\vcl -IModules\ThirdParty\VNL\src\vxl\core -IModules\Core\Common -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Core\Common\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Core\ImageAdaptors\include -IModules\ThirdParty\Netlib -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Numerics\Statistics\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\ImageFilterBase\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Core\Transform\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Core\ImageFunction\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\ImageGrid\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\include -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\core\vnl\algo -ID:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\ThirdParty\VNL\src\vxl\core\vnl -ID:\qt2\installed\x64-windows\include\eigen3 /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP /DVCPKG_IS_COOL -W3  /bigobj /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 /DVCPKG_IS_COOL_DEBUG /showIncludes /FoModules\Filtering\FFT\src\CMakeFiles\ITKFFT.dir\itkFFTWGlobalConfiguration.cxx.obj /FdModules\Filtering\FFT\src\CMakeFiles\ITKFFT.dir\ /FS -c D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx
D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx(416): error C3861: 'fftwf_init_threads': identifier not found
D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx(422): error C3861: 'fftw_init_threads': identifier not found
D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx(482): error C3861: 'fftwf_import_system_wisdom': identifier not found
D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx(486): error C3861: 'fftw_import_system_wisdom': identifier not found
D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx(611): error C2120: 'void' illegal with all types
D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx(645): error C2120: 'void' illegal with all types
D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx(686): error C2120: 'void' illegal with all types
D:\qt2\buildtrees\itk\src\d7c02f3c7b-aca63a9a3a\Modules\Filtering\FFT\src\itkFFTWGlobalConfiguration.cxx(721): error C2120: 'void' illegal with all types
dzenanz commented 4 years ago

If I remember correctly, ITK_USE_CUFFTW requires FFTW to be enabled, as cuFFT acts as a back-end for FFTW. cuFFT is a recent addition, and has not been extensively tested.

Neumann-A commented 4 years ago

@dzenanz: From what I see cuFFT should be completely replacing FFTW but the Code itself is not up the the challange

https://github.com/InsightSoftwareConsortium/ITK/blob/ee2ab9c973e66616cc2132f9a96fcf7763a6b94d/CMake/FindFFTW.cmake#L65-L74

aylward commented 4 years ago

I fixed the itkFFTWGlobalConfiguration bug quite some time ago. It should not be compiled when cufft is used.

See this commit

s

dzenanz commented 4 years ago

That was just a day after 5.1.0 was tagged.

Neumann-A commented 4 years ago

With the changeset of that commit it builds.

I still need to pass

        list(APPEND ADDITIONAL_OPTIONS
             "-DFFTW_LIB_SEARCHPATH=${CUDA_LIB_PATH}"
             "-DFFTW_INCLUDE_PATH=${CUDA_PATH}/include"
             "-DCUFFTW_INCLUDE_PATH=${CUDA_PATH}/include"
             )

to cmake to pass configure though

Consider using FindCUDA and setting up all the required paths.

aylward commented 4 years ago

I agree. Improving FindCUDA would greatly simplify the configuration process!

On Thu, May 14, 2020 at 11:06 AM Alexander Neumann notifications@github.com wrote:

With the changeset of that commit it builds.

I still need to pass

    list(APPEND ADDITIONAL_OPTIONS
         "-DFFTW_LIB_SEARCHPATH=${CUDA_LIB_PATH}"
         "-DFFTW_INCLUDE_PATH=${CUDA_PATH}/include"
         "-DCUFFTW_INCLUDE_PATH=${CUDA_PATH}/include"
         )

to cmake to pass configure though

Consider using FindCUDA and setting up all the required paths.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/InsightSoftwareConsortium/ITK/issues/1809#issuecomment-628696627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACEJL3GQLLZXHENIW7YN6TRRQCIBANCNFSM4M36ICOQ .

-- Stephen R. Aylward, Ph.D. Senior Director of Strategic Initiatives

Kitware: Advancing the frontiers of understanding by developing innovative open-source software platforms and integrating them into research, processes, and products.

thewtex commented 4 years ago

See this commit

That was just a day after 5.1.0 was tagged.

@aylward 's commit was cherry-picked to the release branch for inclusion in 5.1.1.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.