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

Cmake for vtune

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