diff --git a/CMakeLists.txt b/CMakeLists.txt index 451d5551..5f84dcf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,6 +269,17 @@ link_libraries( ${FFTW_LIBRARIES}) set(TRIQS_LIBRARY_FFTW ${FFTW_LIBRARIES}) set(TRIQS_INCLUDE_FFTW ${FFTW_INCLUDE_DIR}) +# NFFT +message( STATUS "-------- NFFT detection (optional) -------------") +find_package(NFFT) +IF(NFFT_FOUND) +include_directories(SYSTEM ${NFFT_INCLUDE_DIR}) +link_libraries( ${NFFT_LIBRARIES}) +set(TRIQS_LIBRARY_FFTW ${TRIQS_LIBRARY_FFTW} ${NFFT_LIBRARIES}) +set(TRIQS_INCLUDE_FFTW ${TRIQS_INCLUDE_FFTW} ${NFFT_INCLUDE_DIR}) +set(TRIQS_CXX_DEFINITIONS ${TRIQS_CXX_DEFINITIONS} -DHAVE_NFFT ) +ENDIF(NFFT_FOUND) + # remove the possible horrible pthread bug on os X !!( on gcc, old, before clang... is it really needed now ???) # check for clang compiler ?? on gcc, os X snow leopard, it MUST be set # since _REENTRANT is mysteriously set and this leads to random stalling of the code.... diff --git a/cmake/FindNFFT.cmake b/cmake/FindNFFT.cmake new file mode 100644 index 00000000..52a1b519 --- /dev/null +++ b/cmake/FindNFFT.cmake @@ -0,0 +1,39 @@ +# Copyright Olivier Parcollet 2014. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# +# This module looks for nfft. +# It sets up : NFFT_INCLUDE_DIR, NFFT_LIBRARIES +# + +SET(TRIAL_PATHS + $ENV{NFFT_ROOT}/include + ${NFFT_ROOT}/include + /usr/include + /usr/local/include + /opt/local/include + /sw/include + ) +FIND_PATH(NFFT_INCLUDE_DIR nfft3.h ${TRIAL_PATHS} DOC "Include for NFFT") + +SET(TRIAL_LIBRARY_PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + $ENV{NFFT_ROOT}/lib + ${NFFT_ROOT}/lib + ) + +SET(NFFT_LIBRARIES "NFFT_LIBRARIES-NOTFOUND" CACHE STRING "NFFT library") +# Try to detect the lib +FIND_LIBRARY(NFFT_LIBRARIES nfft nfft3 ${TRIAL_LIBRARY_PATHS} DOC "NFFT library") + +mark_as_advanced(NFFT_INCLUDE_DIR) +mark_as_advanced(NFFT_LIBRARIES) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(NFFT DEFAULT_MSG NFFT_LIBRARIES NFFT_INCLUDE_DIR) + +