Commit 75f73c9c authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov
Browse files

Merge branch 'C++20' into 'master'

Enable C++20 standard.

See merge request ogs/ogs!3343
parents ecdd0721 b7639475
Subproject commit 1c4a2e4664b296e24b33253767242f8df247c1d3
Subproject commit e4dea7028f1969e9942b680b9eda951a8432e9a3
build container images:
stage: preparation
rules:
- if: '$CI_PROJECT_NAMESPACE == "bilke" || $CI_PROJECT_NAMESPACE == "ogs"'
- if: '$CI_PROJECT_NAMESPACE == "endjunction" || $CI_PROJECT_NAMESPACE == "bilke" || $CI_PROJECT_NAMESPACE == "ogs"'
changes:
- ThirdParty/container-maker
- scripts/ci/jobs/build_image.yml
......
# C++ standard setup
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
......@@ -110,6 +110,11 @@ if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL)
endif()
if(MSVC)
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS ${ogs.minimum_version.msvc.compiler})
message(FATAL_ERROR "Aborting: Visual Studio compiler \
${ogs.minimum_version.msvc.compiler} is required. Found version \
${CMAKE_CXX_COMPILER_VERSION}.")
endif()
if(${MSVC_TOOLSET_VERSION} LESS ${ogs.minimum_version.msvc.toolset})
message(FATAL_ERROR "Aborting: Visual Studio ${ogs.minimum_version.msvc.year} \
is required! Found Visual Studio with toolset version \
......
......@@ -33,7 +33,7 @@ include(${PROJECT_SOURCE_DIR}/scripts/cmake/conan/conan.cmake)
set(CONAN_REQUIRES
boost/${ogs.minimum_version.boost}@conan/stable
eigen/${ogs.minimum_version.eigen}@conan/stable
eigen/${ogs.minimum_version.eigen}
vtk/${ogs.tested_version.vtk}@bilke/stable
CACHE INTERNAL ""
)
......
......@@ -82,7 +82,11 @@ else()
include(${VTK_USE_FILE})
endif()
find_package(Eigen3 ${ogs.minimum_version.eigen} REQUIRED)
if(OGS_USE_CONAN)
set(EIGEN3_INCLUDE_DIR ${CONAN_INCLUDE_DIRS_EIGEN} CACHE INTERNAL "")
else()
find_package(Eigen3 ${ogs.minimum_version.eigen} REQUIRED)
endif()
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
if(OGS_USE_MFRONT)
......
......@@ -16,7 +16,7 @@ The minimum prerequisites to build OGS are:
- An 64-bit operating system (Linux, Windows 7 and up, macOS)
- Git (version control tool, at least version {{< dataFile "versions.minimum_version.git" >}})
- CMake (build configuration tool, at least version {{< dataFile "versions.minimum_version.cmake" >}})
- A compiler with [C++17](http://en.wikipedia.org/wiki/C%2B%2B17)-support
- A compiler with [C++20](http://en.wikipedia.org/wiki/C%2B%2B20)-support
- [Conan package manager](https://www.conan.io/) (at least version {{< dataFile "versions.minimum_version.conan" >}}) **OR** install [required libraries]({{< ref "third-party-libraries.md" >}}) manually (for advanced users only!)
<div class='note'>
......@@ -39,7 +39,7 @@ Please note that the following setup on Windows is the **native Windows developm
</div>
As we use lots of features of the C++17-standard we support **Visual Studio {{< dataFile "versions.minimum_version.msvc.year" >}}** and up. Therefore you will need at least **Windows 7** (64-bit recommended). It is perfectly fine to use the free Community Edition of Visual Studio.
As we use lots of features of the C++17-standard we support **Visual Studio {{< dataFile "versions.minimum_version.msvc.year" >}}** with compiler version **{{< dataFile "versions.minimum_version.msvc.compiler" >}}** and up. Therefore you will need at least **Windows 7** (64-bit required). It is perfectly fine to use the free Community Edition of Visual Studio.
- Download and install [Visual Studio Community](https://www.visualstudio.com)
- Select the *workload* `Desktop Development with C++`
......
......@@ -6,14 +6,15 @@
"msvc": {
"year": "2019",
"number": "16",
"toolset": "142"
"toolset": "142",
"compiler": "19.24"
},
"conan": "1.21.0",
"git": "2.14",
"cmake": "3.14",
"hugo": "0.64.1",
"boost": "1.66.0",
"eigen": "3.3.4",
"boost": "1.67.0",
"eigen": "3.3.9",
"vtk": "8.1.2",
"petsc": "3.11.2",
"qt": "5.12.4",
......
Supports Markdown
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