cmake: check that USER-INTEL flags actually work

This commit is contained in:
Christoph Junghans 2018-05-11 15:27:24 -06:00
parent 4820cef5d4
commit b3b3c225e8
1 changed files with 9 additions and 3 deletions

View File

@ -182,7 +182,7 @@ if(PKG_KSPACE)
if(NOT FFT STREQUAL "KISSFFT")
find_package(${FFT} REQUIRED)
if(NOT FFT STREQUAL "FFTW3F")
add_definitions(-DFFT_FFTW)
add_definitions(-DFFT_FFTW)
else()
add_definitions(-DFFT_${FFT})
endif()
@ -614,7 +614,13 @@ if(PKG_USER-INTEL)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xHost")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qopenmp -qno-offload -fno-alias -ansi-alias -restrict -DLMP_INTEL_USELRT -DLMP_USE_MKL_RNG -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high")
include(CheckCXXCompilerFlag)
foreach(_FLAG -qopenmp -qno-offload -fno-alias -ansi-alias -restrict -DLMP_INTEL_USELRT -DLMP_USE_MKL_RNG -O2 "-fp-model fast=2" -no-prec-div -qoverride-limits -qopt-zmm-usage=high)
check_cxx_compiler_flag("${__FLAG}" COMPILER_SUPPORTS${_FLAG})
if(COMPILER_SUPPORTS${_FLAG})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_FLAG}")
endif()
endforeach()
set(USER-INTEL_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/USER-INTEL)
set(USER-INTEL_SOURCES ${USER-INTEL_SOURCES_DIR}/intel_preprocess.h
${USER-INTEL_SOURCES_DIR}/intel_buffers.h
@ -856,5 +862,5 @@ if(ENABLED_GPU)
endif()
endif()
if(PKG_KSPACE)
message(STATUS "Using ${FFT} as FFT")
message(STATUS "Using ${FFT} as FFT")
endif()