Skip to content

Commit 64d95ed

Browse files
committed
Added CMake config for NVIDIA HPC compilers (nvfortran)
1 parent 3f1aef1 commit 64d95ed

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CMAKE/CheckLAPACKCompilerFlags.cmake

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
3131
else ()
3232
set(FOPT_ILP64 -i8)
3333
endif()
34+
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" )
35+
if ( WIN32 )
36+
set(FOPT_ILP64 /i8)
37+
else ()
38+
set(FOPT_ILP64 -i8)
39+
endif()
3440
else()
3541
set(CPE_ENV $ENV{PE_ENV})
3642
if(CPE_ENV STREQUAL "CRAY")
@@ -138,6 +144,17 @@ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
138144
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -quiet")
139145
endif()
140146

147+
# NVIDIA HPC SDK
148+
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" )
149+
if( ("${CMAKE_Fortran_FLAGS}" MATCHES "-Ktrap=") AND
150+
NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-Ktrap=none") )
151+
set( FPE_EXIT TRUE )
152+
endif()
153+
154+
if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "[-/]Kieee") )
155+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Kieee")
156+
endif()
157+
141158
else()
142159
endif()
143160

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
141141
check_fortran_compiler_flag("-qrecur" _qrecurFlag)
142142
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NAG)
143143
check_fortran_compiler_flag("-recursive" _recursiveFlag)
144+
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NVHPC)
145+
check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
144146
else()
145147
message(WARNING "Fortran local arrays should be allocated on the stack."
146148
" Please use a compiler which guarantees that feature."

0 commit comments

Comments
 (0)