Skip to content
Snippets Groups Projects
Commit 2a9d4608 authored by Christoph Alt's avatar Christoph Alt
Browse files

add minimal version for the rest of the compilers to support c++17 and

the std::filesystem
parent 6604565c
Branches
No related merge requests found
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
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")
......
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
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
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
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
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
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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment