tweak compiler flags for Intel and GNU

This commit is contained in:
Axel Kohlmeyer 2020-03-05 10:16:38 -05:00
parent 1642bf5afc
commit b0c6641f1b
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 7 additions and 1 deletions

View File

@ -52,7 +52,13 @@ include(CheckCCompilerFlag)
include(CheckIncludeFileCXX)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict -std=c++11")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
endif()
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
if(NOT (${CMAKE_BUILD_TYPE} STREQUAL "Debug"))
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math -ftree-vectorize -fexpensive-optimizations")
endif()
endif()
option(DISABLE_CXX11_REQUIREMENT "Disable check that requires C++11 for compiling LAMMPS" OFF)