Skip to content

Commit

Permalink
Added CMake config for NVIDIA HPC compilers (nvfortran)
Browse files Browse the repository at this point in the history
  • Loading branch information
ACSimon33 committed Aug 24, 2023
1 parent 3f1aef1 commit 64d95ed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CMAKE/CheckLAPACKCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
else ()
set(FOPT_ILP64 -i8)
endif()
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" )
if ( WIN32 )
set(FOPT_ILP64 /i8)
else ()
set(FOPT_ILP64 -i8)
endif()
else()
set(CPE_ENV $ENV{PE_ENV})
if(CPE_ENV STREQUAL "CRAY")
Expand Down Expand Up @@ -138,6 +144,17 @@ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -quiet")
endif()

# NVIDIA HPC SDK
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" )
if( ("${CMAKE_Fortran_FLAGS}" MATCHES "-Ktrap=") AND
NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "-Ktrap=none") )
set( FPE_EXIT TRUE )
endif()

if( NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "[-/]Kieee") )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Kieee")
endif()

else()
endif()

Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL XL)
check_fortran_compiler_flag("-qrecur" _qrecurFlag)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NAG)
check_fortran_compiler_flag("-recursive" _recursiveFlag)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NVHPC)
check_fortran_compiler_flag("-Mrecursive" _MrecursiveFlag)
else()
message(WARNING "Fortran local arrays should be allocated on the stack."
" Please use a compiler which guarantees that feature."
Expand Down

0 comments on commit 64d95ed

Please sign in to comment.