diff --git a/CMakeLists.txt b/CMakeLists.txt index e65080794..af8af981a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,10 +65,16 @@ 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 ((CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 23.0) AND (MAKE_BUILD_TYPE STREQUAL "Debug") AND (MFC_OpenACC)) - message(FATAL_ERROR "${__err_msg}ERROR: NVHPC v23.0 or newer is required to build MFC with GPU and Debug options.") + if (MAKE_BUILD_TYPE STREQUAL "Debug")) + if (MFC_OpenACC) + if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 23.0)) + message(FATAL_ERROR "${__err_msg}ERROR: When using NVHPC, v23.0 or newer is required to build MFC with Debug and GPU options.") + endif() + else() + message(FATAL_ERROR "${__err_msg}ERROR: Debug is not working with NVHPC 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.")