Skip to content

Commit 9423642

Browse files
authored
Support nvfortran compiler (#92)
nvfortran is bundled with the NVIDIA HPC SDK.
1 parent c417955 commit 9423642

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

cmake/SetBuildOptions.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ elseif(COMPILER STREQUAL "Intel" OR COMPILER STREQUAL "IntelLLVM")
4444
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -fpe0 -check all")
4545
endif()
4646
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -debug minimal")
47+
elseif(COMPILER STREQUAL "NVHPC")
48+
add_compile_definitions(CPRNVHPC)
49+
set(CMAKE_C_FLAGS "-fPIC")
50+
set(CMAKE_C_FLAGS_DEBUG "-g -O0")
51+
set(CMAKE_C_FLAGS_RELEASE "-Ofast")
52+
set(CMAKE_Fortran_FLAGS "-fPIC")
53+
set(CMAKE_Fortran_FLAGS_DEBUG "-g -O0")
54+
set(CMAKE_Fortran_FLAGS_RELEASE "-Ofast")
4755
elseif(COMPILER STREQUAL "LFortran")
4856
add_compile_definitions(CPRLFORTRAN)
4957
# There is an issue, some modules require --cpp as a flag in their compilation
@@ -75,4 +83,4 @@ message(STATUS " ******* ${CMAKE_PROJECT_NAME} build options ******* ")
7583
message(STATUS " Build type = '${CMAKE_BUILD_TYPE}'")
7684
message(STATUS " Compiler = '${COMPILER}'")
7785
message(STATUS " Coupling mode = '${COUPLING_MODE}'")
78-
message(STATUS " ********************************** ")
86+
message(STATUS " ********************************** ")

0 commit comments

Comments
 (0)