diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-10-18 19:44:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-18 19:44:42 (GMT) |
commit | 65e1bd8ce90d286bd4ffc1575414d775ae86a319 (patch) | |
tree | 5aeb6bc35ab0b6e0d8fe29b56bd9141c4f69bca3 /config/cmake | |
parent | fce7ce18697ecead37e75d3d05483ef995cf24dd (diff) | |
download | hdf5-65e1bd8ce90d286bd4ffc1575414d775ae86a319.zip hdf5-65e1bd8ce90d286bd4ffc1575414d775ae86a319.tar.gz hdf5-65e1bd8ce90d286bd4ffc1575414d775ae86a319.tar.bz2 |
Add NVidia compiler support and CI (#3686)
Diffstat (limited to 'config/cmake')
-rw-r--r-- | config/cmake/HDFCXXCompilerFlags.cmake | 18 | ||||
-rw-r--r-- | config/cmake/HDFCompilerFlags.cmake | 13 | ||||
-rw-r--r-- | config/cmake/HDFFortranCompilerFlags.cmake | 12 |
3 files changed, 40 insertions, 3 deletions
diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index e8a55ba..13f712d 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -49,6 +49,22 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_LOADED) endif () endif () +if (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" AND CMAKE_CXX_COMPILER_LOADED) + if (NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION) + if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 11) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C11_STANDARD_COMPILE_OPTION}") + endif () + endif () + if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Minform=warn") + if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") + endif () + else () + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Mbounds -gopt -g") + endif () +endif () + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer") @@ -97,7 +113,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) endif () #----------------------------------------------------------------------------- -# HDF5 library compile options +# HDF5 library compile options - to be made available to all targets #----------------------------------------------------------------------------- if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 1dca910..a6bce98 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -47,6 +47,17 @@ if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGN set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000") endif() +if(CMAKE_C_COMPILER_ID STREQUAL "NVHPC" ) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Minform=warn") + if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") + endif () + else () + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mbounds -g") + endif () +endif() + if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer") @@ -106,7 +117,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) endif () #----------------------------------------------------------------------------- -# HDF5 library compile options +# HDF5 library compile options - to be made available to all targets #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index e08df05..f207c70 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -41,7 +41,7 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) endif () #----------------------------------------------------------------------------- -# HDF5 library compile options +# HDF5 library compile options - to be made available to all targets #----------------------------------------------------------------------------- if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0) if (HDF5_ENABLE_BUILD_DIAGS) @@ -56,6 +56,16 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "NAG") message (STATUS "... Select IEEE floating-point mode full") list (APPEND HDF5_CMAKE_Fortran_FLAGS "-ieee=full") endif () +if (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") + if (NOT ${HDF_CFG_NAME} MATCHES "Debug" AND NOT ${HDF_CFG_NAME} MATCHES "Developer") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mnoframe") + if (NOT ${HDF_CFG_NAME} MATCHES "RelWithDebInfo") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -s") + endif () + else () + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mbounds -Mchkptr -Mdclchk -g") + endif () +endif () if (NOT MSVC AND NOT MINGW) # General flags |