diff --git a/cmake/compileroptions/Clang.cmake b/cmake/compileroptions/Clang.cmake index 4bba387b204dce3ae9112cde362ed77656aca722..d45f2c0353f1ac0f8a42de0363f31f539c8cdf7c 100644 --- a/cmake/compileroptions/Clang.cmake +++ b/cmake/compileroptions/Clang.cmake @@ -1,12 +1,14 @@ message(STATUS "Setting Clang specific compiler options") if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0) - message(FATAL_ERROR "Clang version must be at least 11!") + set(_apple_clang_minimal_version 11.0.0) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_apple_clang_minimal_version}) + message(FATAL_ERROR "Clang version must be at least ${_apple_clang_minimal_version}!") endif() else() - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7) - message(FATAL_ERROR "Clang version must be at least 7!") + set(_clang_minimal_version 7) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_clang_minimal_version}) + message(FATAL_ERROR "Clang version must be at least ${_clang_minimal_version}!") endif() endif() @@ -103,4 +105,4 @@ if(WALBERLA_BUILD_WITH_OPENMP) ) add_flag(CMAKE_CXX_FLAGS "-Wno-sign-conversion") endif() -endif() +endif() \ No newline at end of file diff --git a/cmake/compileroptions/Cray.cmake b/cmake/compileroptions/Cray.cmake index 95b88979463b19e3cb2e8550b5564e4ebba4bdcf..c8476f64d8f254b9342341d3b1e60a964c873c95 100644 --- a/cmake/compileroptions/Cray.cmake +++ b/cmake/compileroptions/Cray.cmake @@ -1,5 +1,10 @@ message(STATUS "Setting Cray specific compiler options") +set(_cray_minimal_version 9) +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_cray_minimal_version}) + message(FATAL_ERROR "Cray version must be at least ${_cray_minimal_version}!") +endif() + # Fixes linker errors with Cray compiler add_flag(CMAKE_EXE_LINKER_FLAGS "-dynamic -L/opt/gcc/4.9.3/snos/lib64") diff --git a/cmake/compileroptions/FujitsuClang.cmake b/cmake/compileroptions/FujitsuClang.cmake index 0d7f9282feafa4e3c779af867dcfeba4372ec5e1..feb790871d52fa317c87e59a174beff9d39d4bc5 100644 --- a/cmake/compileroptions/FujitsuClang.cmake +++ b/cmake/compileroptions/FujitsuClang.cmake @@ -1,5 +1,10 @@ message(STATUS "Setting FujitsuClang specific compiler options") +set(_clang_minimal_version 7) +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_clang_minimal_version}) + message(FATAL_ERROR "Clang version must be at least ${_clang_minimal_version}!") +endif() + add_flag(CMAKE_CXX_FLAGS "-Wall -Wconversion -Wshadow -Wno-c++11-extensions -Qunused-arguments") @@ -37,4 +42,4 @@ if(WALBERLA_BUILD_WITH_LIKWID_MARKERS) OFF CACHE BOOL "Compile in markers for likwid-perfctr" FORCE) endif() -endif() +endif() \ No newline at end of file diff --git a/cmake/compileroptions/GNU.cmake b/cmake/compileroptions/GNU.cmake index b9839cf450d17037458f9440d6ffb7cdce2111cd..1e1e81b690f7fb4508b3770cb17aec7dbe2b3faf 100644 --- a/cmake/compileroptions/GNU.cmake +++ b/cmake/compileroptions/GNU.cmake @@ -1,7 +1,8 @@ message(STATUS "Setting GNU specific compiler options") -if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8) - message(FATAL_ERROR "GCC version must be at least 8!") +set(_gcc_minimal_version 8) +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_gcc_minimal_version}) + message(FATAL_ERROR "GCC version must be at least ${_gcc_minimal_version}!") endif() # Profile guided optimization @@ -106,4 +107,4 @@ endif() if(WALBERLA_BUILD_WITH_GCOV AND CMAKE_COMPILER_IS_GNUCXX) add_flag(CMAKE_CXX_FLAGS "--coverage") endif() -# ############################################################################## +# ############################################################################## \ No newline at end of file diff --git a/cmake/compileroptions/IBM.cmake b/cmake/compileroptions/IBM.cmake index 6b6a2617df26a811f7599652d64ea9ebb7e00b52..6c475c84f9cf1e453b3d6767c5ee660d56cd9a9c 100644 --- a/cmake/compileroptions/IBM.cmake +++ b/cmake/compileroptions/IBM.cmake @@ -1,7 +1,8 @@ message(STATUS "Setting IBM specific compiler options") -if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.1.1) - message(FATAL_ERROR "IBM compiler version must be at least 17.1.1!") +set(_ibm_minimal_version 17.1.1) +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_ibm_minimal_version}) + message(FATAL_ERROR "IBM compiler version must be at least ${_ibm_minimal_version}!") endif() # Fixes linker errors with IBM compiler @@ -26,4 +27,4 @@ add_flag(CMAKE_C_FLAGS "-qsuppress=1500-030") # 1500-030: (I) INFORMATION: [...] # Additional optimization may be # attained by recompiling and # specifying MAXMEM option with a - # value greater than 8192. + # value greater than 8192. \ No newline at end of file diff --git a/cmake/compileroptions/Intel.cmake b/cmake/compileroptions/Intel.cmake index ef0d1a8df496e3216beb1fdf4ba61a5c98f72258..b70664a0521b03484ad4267f85b22022873e7b3f 100644 --- a/cmake/compileroptions/Intel.cmake +++ b/cmake/compileroptions/Intel.cmake @@ -1,5 +1,10 @@ message(STATUS "Setting Intel specific compiler options") +set(_intel_minimal_version 19.0.0) +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_intel_minimal_version}) + message(FATAL_ERROR "IBM compiler version must be at least ${_intel_minimal_version}!") +endif() + if(WALBERLA_PROFILE_GENERATE) add_flag(CMAKE_CXX_FLAGS "-prof-gen") file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/profile") @@ -72,4 +77,4 @@ if(WALBERLA_BUILD_WITH_GPROF) endif() # Intel C++17 support introduced in 2.6.2 (https://github.com/pybind/pybind11/pull/2729) -set(PYBIND11_MINIMUM_VERSION "2.6.2") +set(PYBIND11_MINIMUM_VERSION "2.6.2") \ No newline at end of file diff --git a/cmake/compileroptions/IntelLLVM.cmake b/cmake/compileroptions/IntelLLVM.cmake index 82bdd400c63f21342dd57eca18de1d4bee027fdc..03d41f83dd8811f86143b7ff50912ef9d1d2cc8f 100644 --- a/cmake/compileroptions/IntelLLVM.cmake +++ b/cmake/compileroptions/IntelLLVM.cmake @@ -1,5 +1,10 @@ message(STATUS "Setting IntelLLVM specific compiler options") +set(_intel_llvm_minimal_version 2021.0) +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_intel_llvm_minimal_version}) + message(FATAL_ERROR "IBM compiler version must be at least ${_intel_llvm_minimal_version}!") +endif() + # fastmath if(NOT WALBERLA_BUILD_WITH_FASTMATH) add_flag(CMAKE_CXX_FLAGS "-fp-model=precise") @@ -40,4 +45,4 @@ if(WALBERLA_BUILD_WITH_OPENMP) ) add_flag(CMAKE_CXX_FLAGS "-Wno-sign-conversion") endif() -endif() +endif() \ No newline at end of file diff --git a/cmake/compileroptions/MSVC.cmake b/cmake/compileroptions/MSVC.cmake index 4bd400df5401d37623e66e61706b1a1919e59a0c..bbf7de29598edbb63e7e7aa6894230bc8487e033 100644 --- a/cmake/compileroptions/MSVC.cmake +++ b/cmake/compileroptions/MSVC.cmake @@ -1,7 +1,8 @@ message(STATUS "Setting MSVC specific compiler options") -if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.11) - message(FATAL_ERROR "MSVC version must be at least 19.11!") +set(_msvc_minimal_version 19.11) +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_msvc_minimal_version}) + message(FATAL_ERROR "MSVC version must be at least ${_msvc_minimal_version}!") endif() if(WALBERLA_PROFILE_GENERATE) @@ -81,4 +82,4 @@ string(REPLACE "/Od" "/O2" CMAKE_CXX_FLAGS_DEBUGOPTIMIZED string(REPLACE "/Ob0" "/Ob2" CMAKE_CXX_FLAGS_DEBUGOPTIMIZED ${CMAKE_CXX_FLAGS_DEBUGOPTIMIZED}) string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUGOPTIMIZED - ${CMAKE_CXX_FLAGS_DEBUGOPTIMIZED}) + ${CMAKE_CXX_FLAGS_DEBUGOPTIMIZED}) \ No newline at end of file