3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 13:53:40 +01:00

add nfft detection

This commit is contained in:
Olivier Parcollet 2014-04-04 11:51:08 +02:00
parent edca014785
commit 6fc131cd5d
2 changed files with 50 additions and 0 deletions

View File

@ -269,6 +269,17 @@ link_libraries( ${FFTW_LIBRARIES})
set(TRIQS_LIBRARY_FFTW ${FFTW_LIBRARIES}) set(TRIQS_LIBRARY_FFTW ${FFTW_LIBRARIES})
set(TRIQS_INCLUDE_FFTW ${FFTW_INCLUDE_DIR}) 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 ???) # 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 # 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.... # since _REENTRANT is mysteriously set and this leads to random stalling of the code....

39
cmake/FindNFFT.cmake Normal file
View File

@ -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)