Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMakeLists.txt to fix #237 Add fatal error to cmakelists if debug + gpu is enabled with NVHPC <= 22.11 #238

Merged
merged 6 commits into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
endif()
elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI"))
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 21.7)
message(FATAL_ERROR "${__err_msg}ERROR: NVHPC v21.7 or newer is required to build MFC.")
message(FATAL_ERROR "${__err_msg}ERROR: When using NVHPC, v21.7 or newer is required to build MFC.")
endif()
if (MAKE_BUILD_TYPE STREQUAL "Debug")
if (MFC_OpenACC)
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 23.0)
henryleberre marked this conversation as resolved.
Show resolved Hide resolved
message(FATAL_ERROR "${__err_msg}ERROR: When using NVHPC, v23.0 or newer is required to build MFC with Debug and GPU options.")
sbryngelson marked this conversation as resolved.
Show resolved Hide resolved
endif()
else()
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 23.8)
message(FATAL_ERROR "${__err_msg}ERROR: Debug is not working with NVHPC 23.X and older and CPU options at present.")
endif()
endif()
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
message(FATAL_ERROR "${__err_msg}ERROR: MFC does not support the Apple Clang compilers. Please consult the documentation.")
Expand Down Expand Up @@ -145,7 +155,7 @@ elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_
endif()

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-C -g -traceback -Mchkptr -Mchkstk -Minform=inform -Mbounds)
add_compile_options(-C -g -O0 -traceback -Mchkptr -Mchkstk -Minform=inform -Mbounds)
henryleberre marked this conversation as resolved.
Show resolved Hide resolved
endif()
endif()

Expand Down
Loading