Skip to content
Snippets Groups Projects
Commit 906e6803 authored by 数学の武士's avatar 数学の武士
Browse files

Cmake for vtune

parent 343c88d5
Branches
Tags
No related merge requests found
......@@ -5,6 +5,7 @@ option(USE_CXX "CXX build in mode" OFF)
option(BUILD_DOC "Build documentation" OFF)
option(SFX_CHECK_NAN "Build documentation" OFF)
option(USE_CONFIG_PARSER "Build config parser" ON)
option(VTUNE_FLAGS " " OFF)
include(FetchContent)
......@@ -177,6 +178,14 @@ endif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
# set(CMAKE_Fortran_ARCHIVE_FINISH "$<CMAKE_RANLIB> -no_warning_for_no_symbols -c $<TARGET>")
target_include_directories(sfx_lib PUBLIC ${CMAKE_BINARY_DIR}/modules/)
if(VTUNE_FLAGS)
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:C>: -g -O2 -Xsprofile>
PUBLIC $<$<COMPILE_LANGUAGE:CXX>: -g -O2 -Xsprofile>
PUBLIC $<$<COMPILE_LANGUAGE:Fortran>: -g -O2>)
endif(VTUNE_FLAGS)
set(CMAKE_BUILD_TYPE Release)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:C>: -g >)
......@@ -184,11 +193,15 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
PUBLIC $<$<COMPILE_LANGUAGE:CXX>: -g >)
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: -g >)
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:Fortran>: -g -fbacktrace -ffpe-trap=zero,overflow,underflow >)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:Fortran>: -g -traceback -check all -ftrapuv -debug all >)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(sfx-
PUBLIC $<$<COMPILE_LANGUAGE:Fortran>: -g -fbacktrace -ffpe-trap=zero,overflow,underflow >)
endif()
endif()
# copy data & configs on post build
add_custom_command(
TARGET sfx POST_BUILD
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment