diff --git a/CMake/FindFFTW.cmake b/CMake/FindFFTW.cmake index 994b25e3a137df30c7907105fc6ee3404284cac3..d553d45365ccf65b2ef0c5b0ee843a60b8a6aeb1 100644 --- a/CMake/FindFFTW.cmake +++ b/CMake/FindFFTW.cmake @@ -5,7 +5,7 @@ # FFTW_INCLUDE_DIRS - the FFTW include directories # FFTW_LIBRARIES - link these to use FFTW # -# Set With_FFTW=where_fftw_is_installed if it's not in a "classic" place or if you want a specific version +# Set fftw_DIR=where_fftw_is_installed if it's not in a "classic" place or if you want a specific version # # Written by F. Pérignon, nov/2009 # inspired from http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries @@ -21,7 +21,7 @@ find_path( FFTW_INCLUDE_DIR NAMES fftw3.h #NO_CMAKE_ENVIRONMENT_PATH - PATHS ${With_FFTW} PATHS ENV INCLUDE ENV PATH ${FFTW_PKGCONF_INCLUDE_DIRS} + PATHS ${fftw_DIR} PATHS ENV INCLUDE ENV PATH ${FFTW_PKGCONF_INCLUDE_DIRS} PATH_SUFFIXES include NO_DEFAULT_PATH ) @@ -32,8 +32,9 @@ find_path(FFTW_INCLUDE_DIR NAMES fftw3.h) find_library( FFTW_LIBRARY NAMES fftw3 - PATHS ${With_FFTW} ENV LIBRARY_PATH ENV LD_LIBRARY_PATH ${FFTW_PKGCONF_LIBRARY_DIRS} + PATHS ${fftw_DIR} ${FFTW_INCLUDE_DIR}/.. ENV LIBRARY_PATH ENV LD_LIBRARY_PATH ${FFTW_PKGCONF_LIBRARY_DIRS} PATH_SUFFIXES lib + NO_DEFAULT_PATH ) find_library(FFTW_LIBRARY @@ -43,8 +44,9 @@ find_library(FFTW_LIBRARY find_library( FFTWFloat_LIBRARY NAMES fftw3f - PATHS ${With_FFTW} ENV LIBRARY_PATH ENV LD_LIBRARY_PATH ${FFTW_PKGCONF_LIBRARY_DIRS} + PATHS ${fftw_DIR} ENV LIBRARY_PATH ENV LD_LIBRARY_PATH ${FFTW_PKGCONF_LIBRARY_DIRS} PATH_SUFFIXES lib + NO_DEFAULT_PATH ) find_library(FFTWFloat_LIBRARY NAMES fftw3f diff --git a/CMake/FindMPI_Fortran.cmake b/CMake/FindMPI_Fortran.cmake index 72af5b9c7c149f2e92e150dcb555460f041daac8..cd323fbcb4ad65c40c81e3914b95e65b16e17319 100644 --- a/CMake/FindMPI_Fortran.cmake +++ b/CMake/FindMPI_Fortran.cmake @@ -10,7 +10,7 @@ # MPI_Fortran_LIBRARIES All libraries to link MPI programs against # # F. Pérignon - LJK, Grenoble - march 2011. -# Inspired from original Kitware FindMPI.cmake (only for C/C++ MPI) +# Inspired from original Kitware FindMPI.cmake (which is written only for C/C++ MPI) # # If mpiexec is not set, that means MPI has not been searched. Forced it @@ -193,9 +193,9 @@ elseif (MPI_Fortran_COMPILE_CMDLINE) find_library(MPI_Fortran_LIB ${LIB} HINTS ${MPI_Fortran_LINK_PATH}) if (MPI_Fortran_LIB) list(APPEND MPI_Fortran_LIBRARIES ${MPI_Fortran_LIB}) - else (MPI_LIB) + else() message(SEND_ERROR "Unable to find MPI library ${LIB}") - endif (MPI_Fortran_LIB) + endif() endforeach(LIB) set(MPI_Fortran_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE) @@ -203,12 +203,12 @@ elseif (MPI_Fortran_COMPILE_CMDLINE) # MPI_EXTRA_LIBRARY. list(LENGTH MPI_Fortran_LIBRARIES MPI_Fortran_NUMLIBS) list(LENGTH MPI_Fortran_LIBNAMES MPI_Fortran_NUMLIBS_EXPECTED) - if (MPI_Fortran_NUMLIBS EQUAL MPI_Fortran_NUMLIBS_EXPECTED) + if (MPI_Fortran_NUMLIBS GREATER MPI_Fortran_NUMLIBS_EXPECTED) list(GET MPI_Fortran_LIBRARIES 0 MPI_Fortran_LIBRARY_WORK) set(MPI_Fortran_LIBRARY ${MPI_Fortran_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE) - else (MPI_Fortran_NUMLIBS EQUAL MPI_Fortran_NUMLIBS_EXPECTED) + else() set(MPI_Fortran_LIBRARY "MPI_Fortran_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE) - endif (MPI_Fortran_NUMLIBS EQUAL MPI_Fortran_NUMLIBS_EXPECTED) + endif() if (MPI_Fortran_NUMLIBS GREATER 1) set(MPI_Fortran_EXTRA_LIBRARY_WORK ${MPI_Fortran_LIBRARIES}) list(REMOVE_AT MPI_Fortran_EXTRA_LIBRARY_WORK 0) diff --git a/CMake/FindMetis.cmake b/CMake/FindMetis.cmake index bfb7411c17438b44610246ba4c78867865b005fe..3025849b884181fe184dc35dc95856a1dfeb34e8 100644 --- a/CMake/FindMetis.cmake +++ b/CMake/FindMetis.cmake @@ -5,8 +5,9 @@ # Metis_INCLUDE_DIRS - the Metis include directories # Metis_LIBRARIES - link these to use Metis # -# Franck Perignon, jan. 2011, from http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries +# If Metis is in a non usual place, provide Metis_DIR variable to cmake (cmake -DMetis_DIR=...) # +# Franck Perignon, jan. 2011, from http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries # # - On debian, metis is installed in /usr/include/metis, /usr/lib with both static and dynamic libs. # - The tgz file from Karypis lab does not include any installation process. Metis is compiled in the sources and the .h is in metis_src/Lib, while the .a is in