[Insight-users] Insight-users Digest Questions - Problems Building FFTW From Review

Calvin Lefebvre calvin.lefebvr7 at gmail.com
Fri Nov 18 13:07:14 EST 2011


Hi Insight-users,



I am currently trying to use FFTW from the "Review" directory option but I
am having a great deal of difficulty and I would appreciate any help.



*Attempt1*

* *

*Step 1*

* *

I download the windows version for FFTW dll files from
http://www.fftw.org/install/windows.html and used lib.exe to create the
.lib (import libraries). So now I have the following new three lib files:



libfftw3-3.lib

libfftw3f-3.lib

libfftw3l-3.lib



*Step 2*



I then modified the CMakelist for compiling the ITK by adding


SET(CMAKE_MODULE_PATH ${ITK_SOURCE_DIR}/CMake)
OPTION(USE_FFTWD "Use double precision FFTW if found" ON)
OPTION(USE_FFTWF "Use single precision FFTW if found" ON)
FIND_PACKAGE( FFTW )

IF(USE_FFTWF)
    LINK_LIBRARIES(${FFTWF_LIB})
ENDIF(USE_FFTWF)

IF(USE_FFTWD)
    LINK_LIBRARIES(${FFTWD_LIB})
ENDIF(USE_FFTWD)

* *

*Step 3*



Next I configure ITK in CMake. I set ITK_USE_REVIEW, USE_FFTWD and
USE_FFTWF to "On". I get the following error



CMake Error: The following variables are used in this project, but they are
set to NOTFOUND.

Please set them or make sure they are set and tested correctly in the CMake
files:

FFTWD_LIB (ADVANCED)

linked by target "ITKAlgorithms" in directory
C:/Users/clefebvr/Desktop/InsightToolkit-3.20.1/Code/Algorithms

FFTWF_LIB (ADVANCED)

linked by target "ITKAlgorithms" in directory
C:/Users/clefebvr/Desktop/InsightToolkit-3.20.1/Code/Algorithms

FFTW_INCLUDE_PATH

...



So, in CMake it mentions that it cannot find FFTWD_LIB, FFTWD_THREADS_LIB,
FFTWF_LIB, FFTWF_THREADS_LIB and FTTW_INCLUDE_PATH. So I set the path
  in CMake          as the following



FFTWD_LIB, FFTWD_THREADS_LIB to libfftw3-3.lib

FFTWF_LIB, FFTWF_THREADS_LIB to libfftw3f-3.lib

FTTW_INCLUDE_PATH to directory of fftw3.h



I configured and generated in CMake without any errors and there was no
problem building ITK in visual studios 2008. When I try and build my own
project with itkFFTWComplexToComplexImageFilter.h                  I get I
get several errors that are similar to the following



itkGaborImageSourceTest.obj : error LNK2019: unresolved external symbol
__imp_fftwf_destroy_plan referenced in function "protected: virtual __cdecl
itk::FFTWComplexToComplexImageFilter<float,2>::~FFTWComplexToComplexImageFilter<float,2>(void)"
(??1?$FFTWComplexToComplexImageFilter at M$01 at itk@@MEAA at XZ)



*Attempt 2*



I also tried a different modification to the CMakelist file for the ITK
configuration by adding



SET(CMAKE_MODULE_PATH ${ITK_SOURCE_DIR}/CMake)

option(USE_FFTWD "Use double precision fftw if found" ON)

option(USE_FFTWF "Use single precision fftw if found" ON)

option(USE_SYSTEM_FFTW "Use an installed version of fftw" OFF)

if (USE_FFTWD OR USE_FFTWF)

        if(USE_SYSTEM_FFTW)

       find_package( FFTW )

       link_directories(${FFTW_LIBDIR})

        else(USE_SYSTEM_FFTW)

       link_directories(${ITK_DIR}/fftw/lib)

       include_directories(${ITK_DIR}/fftw/include)

        endif(USE_SYSTEM_FFTW)

endif(USE_FFTWD OR USE_FFTWF)



It did not show any FFTWD_LIB, FFTWD_THREADS_LIB, FFTWF_LIB,
FFTWF_THREADS_LIB and FTTW_INCLUDE_PATH errors in CMake. Regardless I
continued and no errors occurred generating in CMake, and building ITK in
visual studio. Again, when I tried to build my project with
itkFFTWComplexToComplexImageFilter.h from the Review folder I get several
errors that are similar to the following



itkGaborImageSourceTest.obj : error LNK2019: unresolved external symbol
__imp_fftwf_destroy_plan referenced in function "protected: virtual __cdecl
itk::FFTWComplexToComplexImageFilter<float,2>::~FFTWComplexToComplexImageFilter<float,2>(void)"
(??1?$FFTWComplexToComplexImageFilter at M$01 at itk@@MEAA at XZ)





I compiled CMake with the Visual Studios 2008 64 bit option.



Thanks for the help,



Calvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111118/94cd26f7/attachment.htm>


More information about the Insight-users mailing list