Skip to content

Commit dcca99e

Browse files
committed
Fix Issue #146
1 parent 4a3c420 commit dcca99e

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

cmake/modules/compiler.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ elseif(((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR
145145
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) AND
146146
(NOT PATHSCALE_COMPILER))
147147
include(cmake/modules/clang.cmake)
148+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")
149+
include(cmake/modules/nvhpc.cmake)
148150
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
149151
include(cmake/modules/intel.cmake)
150152
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") OR (PATHSCALE_COMPILER))

cmake/modules/nvhpc.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
if((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "Release"))
2+
set(OPTIMISATION_FLAGS "-O2 -DNDEBUG ${OPTIMISATION_FLAGS}")
3+
tfel_enable_cxx_compiler_flag(OPTIMISATION_FLAGS_MARCH "fast")
4+
endif((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "Release"))
5+
6+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
7+
add_definitions("-g")
8+
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
9+
10+
if(enable-fast-math)
11+
tfel_enable_cxx_compiler_flag(OPTIMISATION_FLAGS "ffinite-math-only")
12+
else(enable-fast-math)
13+
tfel_enable_cxx_compiler_flag(OPTIMISATION_FLAGS2 "ffinite-math-only")
14+
endif(enable-fast-math)

0 commit comments

Comments
 (0)