From 1daa4ce3747806d3482632dfeca01ce3dfa43c33 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Fri, 3 Apr 2020 14:24:27 -0600 Subject: [PATCH] USER-INTEL.cmake: add_compile_options -> target_compile_options --- cmake/CMakeLists.txt | 2 +- cmake/Modules/Packages/USER-INTEL.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 7045b7071f..43533477f7 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -73,7 +73,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF) mark_as_advanced(ENABLE_COVERAGE) if(ENABLE_COVERAGE) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + set (CMAK_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") endif() endif() diff --git a/cmake/Modules/Packages/USER-INTEL.cmake b/cmake/Modules/Packages/USER-INTEL.cmake index ea44119b2a..d38bb84460 100644 --- a/cmake/Modules/Packages/USER-INTEL.cmake +++ b/cmake/Modules/Packages/USER-INTEL.cmake @@ -70,7 +70,7 @@ if(PKG_USER-INTEL) endif() set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -xHost -qopenmp -qoffload") set(MIC_OPTIONS "-qoffload-option,mic,compiler,\"-fp-model fast=2 -mGLOB_default_function_attrs=\\\"gather_scatter_loop_unroll=4\\\"\"") - add_compile_options(-xMIC-AVX512 -qoffload -fno-alias -ansi-alias -restrict -qoverride-limits ${MIC_OPTIONS}) + target_compile_options(lammps PRIVATE -xMIC-AVX512 -qoffload -fno-alias -ansi-alias -restrict -qoverride-limits ${MIC_OPTIONS}) target_compile_definitions(lammps PRIVATE -DLMP_INTEL_OFFLOAD) else() if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") @@ -78,11 +78,11 @@ if(PKG_USER-INTEL) foreach(_FLAG -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high -qno-offload -fno-alias -ansi-alias -restrict) check_cxx_compiler_flag("${__FLAG}" COMPILER_SUPPORTS${_FLAG}) if(COMPILER_SUPPORTS${_FLAG}) - add_compile_options(${_FLAG}) + target_compile_options(lammps PRIVATE ${_FLAG}) endif() endforeach() else() - add_compile_options(-O3 -ffast-math) + target_compile_options(lammps PRIVATE -O3 -ffast-math) endif() endif()