Re: [eigen] Eigen 3.0.5 Could NOT find FFTW (missing: FFTW_INCLUDES) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] Eigen 3.0.5 Could NOT find FFTW (missing: FFTW_INCLUDES)
- From: "Claas H. Köhler" <claas.koehler@xxxxxx>
- Date: Mon, 12 Mar 2012 08:22:10 +0100
- Organization: Deutsches Zentrum für Luft-und Raumfahrt
Attached find the patch. The changes in FindFFTW also incurred some
changes in unsupported/test/CMakeLists.txt, which are also included.
It might be a good idea to have it reviewed, before it is committed.
Since this is the first time I contribute to eigen, I do not know, what
your procedures are. If you need more information, do not hesitate to
contact me.
Regards
Claas
On 12/03/12 03:10, Mark Borgerding wrote:
Please do so. It's almost as if the original author of the FindFFTW
script had no clue about CMake ;)
On 03/11/2012 12:50 PM, Claas H. Köhler wrote:
Hi, to whom it may concern:
Eigen seems to be always problematic under Windows.
I'm trying to use the released version 3.0.5 . However, when I tried
to configure Eigen using CMake 2.8.7 GUI > under Window7 (32bit),
it's weird there is no "FFTW_INCLUDES" for me to specify,.
I encountered a similar problem under linux. The problem is, that
findFFTW does not allow to specify a FFTW_ROOT variable, which
overrides the cmake find results. I was able to patch the necessary
cmake files to get things working on my system, which I can post, if
you are interested.
Regards
Claas
0a1,22
> # - Find the FFTW library
> #
> # Usage:
> # find_package(FFTW [REQUIRED] [QUIET] )
> #
> # It sets the following variables:
> # FFTW_FOUND ... true if fftw is found on the system
> # FFTW_LIBRARIES ... full path to fftw library
> # FFTW_INCLUDE_DIRS ... fftw include directory
> #
> # The following variables will be checked by the function
> # FFTW_USE_STATIC_LIBS ... if true, only static libraries are found
> # FFTW_ROOT ... if set, the libraries are exclusively searched
> # under this path
> # FFTW_LIBRARY ... fftw library to use
> # FFTW_INCLUDE_DIR ... fftw include directory
> #
>
> #If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT
> if( NOT FFTW_ROOT AND ENV{FFTWDIR} )
> set( FFTW_ROOT $ENV{FFTWDIR} )
> endif()
2,16c24,25
< if (FFTW_INCLUDES AND FFTW_LIBRARIES)
< set(FFTW_FIND_QUIETLY TRUE)
< endif (FFTW_INCLUDES AND FFTW_LIBRARIES)
<
< find_path(FFTW_INCLUDES
< NAMES
< fftw3.h
< PATHS
< $ENV{FFTWDIR}
< ${INCLUDE_INSTALL_DIR}
< )
<
< find_library(FFTWF_LIB NAMES fftw3f PATHS $ENV{FFTWDIR} ${LIB_INSTALL_DIR})
< find_library(FFTW_LIB NAMES fftw3 PATHS $ENV{FFTWDIR} ${LIB_INSTALL_DIR})
< set(FFTW_LIBRARIES "${FFTWF_LIB} ${FFTW_LIB}" )
---
> # Check if we can use PkgConfig
> find_package(PkgConfig)
18c27,30
< find_library(FFTWL_LIB NAMES fftw3l PATHS $ENV{FFTWDIR} ${LIB_INSTALL_DIR})
---
> #Determine from PKG
> if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT )
> pkg_check_modules( PKG_FFTW QUIET "fftw3" )
> endif()
20,21c32,38
< if(FFTWL_LIB)
< set(FFTW_LIBRARIES "${FFTW_LIBRARIES} ${FFTWL_LIB}")
---
> #Check whether to search static or dynamic libs
> set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
>
> if( ${FFTW_USE_STATIC_LIBS} )
> set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} )
> else()
> set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
23a41,109
> if( FFTW_ROOT )
>
> #find libs
> find_library(
> FFTW_LIB
> NAMES "fftw3"
> PATHS ${FFTW_ROOT}
> PATH_SUFFIXES "lib" "lib64"
> NO_DEFAULT_PATH
> )
>
> find_library(
> FFTWF_LIB
> NAMES "fftw3f"
> PATHS ${FFTW_ROOT}
> PATH_SUFFIXES "lib" "lib64"
> NO_DEFAULT_PATH
> )
>
> find_library(
> FFTWL_LIB
> NAMES "fftw3l"
> PATHS ${FFTW_ROOT}
> PATH_SUFFIXES "lib" "lib64"
> NO_DEFAULT_PATH
> )
>
> #find includes
> find_path(
> FFTW_INCLUDES
> NAMES "fftw3.h"
> PATHS ${FFTW_ROOT}
> PATH_SUFFIXES "include"
> NO_DEFAULT_PATH
> )
>
> else()
>
> find_library(
> FFTW_LIB
> NAMES "fftw3"
> PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
> )
>
> find_library(
> FFTWF_LIB
> NAMES "fftw3f"
> PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
> )
>
> find_library(
> FFTWL_LIB
> NAMES "fftw3l"
> PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
> )
>
> find_path(
> FFTW_INCLUDES
> NAMES "fftw3.h"
> PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
> )
>
> endif( FFTW_ROOT )
>
> set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})
>
> if(FFTWL_LIB)
> set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB})
> endif()
25c111
< message(STATUS "FFTW ${FFTW_LIBRARIES}" )
---
> set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
96a97
>
97a99
> include_directories( ${FFTW_INCLUDES} )
unsupported/test/CMakeLists.txt
98a101
>
100c103
< ei_add_test(FFTW "-DEIGEN_FFTW_DEFAULT -DEIGEN_HAS_FFTWL" "fftw3;fftw3f;fftw3l" )
---
> ei_add_test(FFTW "-DEIGEN_FFTW_DEFAULT -DEIGEN_HAS_FFTWL" "${FFTW_LIBRARIES}" )
102c105
< ei_add_test(FFTW "-DEIGEN_FFTW_DEFAULT " "fftw3;fftw3f" )
---
> ei_add_test(FFTW "-DEIGEN_FFTW_DEFAULT" "fftw3;fftw3f" )