Skip to content

Commit 6fe815d

Browse files
okBriansbryngelson
andauthored
Disable TWO_PASS_IPO if NVHPC Version < 23.11 (#686)
Co-authored-by: Spencer Bryngelson <[email protected]>
1 parent c36ce91 commit 6fe815d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_
6969
message(FATAL_ERROR "ERROR: When using NVHPC, v21.7 or newer is required to build MFC.\n${__err_msg}")
7070
endif()
7171

72-
if ((CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 23.11) AND (CMAKE_BUILD_TYPE STREQUAL "Debug") AND MFC_OpenACC)
73-
message(FATAL_ERROR "ERROR: When using NVHPC, MFC with Debug and GPU options requires NVHPC v23.11 or newer.\n${__err_msg}")
72+
if ((CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 24.5) AND (CMAKE_BUILD_TYPE STREQUAL "Debug") AND MFC_OpenACC)
73+
message(FATAL_ERROR "ERROR: When using NVHPC, MFC with Debug and GPU options requires NVHPC v24.5 or newer.\n${__err_msg}")
7474
endif()
7575
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
7676
message(FATAL_ERROR "ERROR: MFC does not support the Apple Clang compilers. Please consult the documentation.\n${__err_msg}")
@@ -216,7 +216,9 @@ if (CMAKE_BUILD_TYPE STREQUAL "Release")
216216
# Enable LTO/IPO if supported
217217
if (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
218218
if (MFC_Unified)
219-
message(STATUS "IPO is not available with NVHPC using Unified Memory")
219+
message(STATUS "LTO/IPO is not available with NVHPC using Unified Memory")
220+
elseif(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "23.11")
221+
message(STATUS "LTO/IPO is not supported in NVHPC Version < 23.11. Use a newer version of NVHPC for best performance.")
220222
else()
221223
message(STATUS "Performing IPO using -Mextract followed by -Minline")
222224
set(NVHPC_USE_TWO_PASS_IPO TRUE)

0 commit comments

Comments
 (0)