Skip to content
Snippets Groups Projects
Unverified Commit 10e4e9c8 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #3006 from bilke/bump-gcc

Bump gcc version to 9
parents 9422365d d63cc513
No related branches found
No related tags found
No related merge requests found
...@@ -74,9 +74,11 @@ if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL) ...@@ -74,9 +74,11 @@ if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL)
endif() endif()
if(COMPILER_IS_GCC) if(COMPILER_IS_GCC)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${ogs.minimum_version.gcc}) if(NOT "${HOSTNAME}" MATCHES "frontend.*") # TODO: remove later
message(FATAL_ERROR "Aborting: GCC ${ogs.minimum_version.gcc} is \ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${ogs.minimum_version.gcc})
required! Found version ${CMAKE_CXX_COMPILER_VERSION}.") message(FATAL_ERROR "Aborting: GCC ${ogs.minimum_version.gcc} is \
required! Found version ${CMAKE_CXX_COMPILER_VERSION}.")
endif()
endif() endif()
add_compile_options(-fext-numeric-literals) add_compile_options(-fext-numeric-literals)
include(GCCSanitizer) include(GCCSanitizer)
......
...@@ -50,6 +50,32 @@ You need to have at least **gcc {{< dataFile "versions.minimum_version.gcc" >}}* ...@@ -50,6 +50,32 @@ You need to have at least **gcc {{< dataFile "versions.minimum_version.gcc" >}}*
$ gcc --version $ gcc --version
gcc (GCC) {{< dataFile "versions.minimum_version.gcc" >}}.0 gcc (GCC) {{< dataFile "versions.minimum_version.gcc" >}}.0
``` ```
::: {.note}
### Install a newer compiler on Ubuntu
We recommend using Ubuntu {{< dataFile "versions.tested_version.ubuntu" >}} as its standard `gcc` package is already at version 9. If you are on an older Ubuntu version you can install a newer compiler from the `ubuntu-toolchain-r/test`-repository:
```bash
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-9 g++-9
```
To make the newly installed compiler the default one:
```bash
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9
```
If you do not do this you have to specify the compiler during the first CMake run:
```bash
CC=gcc-9 CXX=c++-9 cmake ../ogs [more CMake options]
```
:::
::: :::
::: {.mac} ::: {.mac}
......
{ {
"minimum_version": { "minimum_version": {
"gcc": "8.0", "gcc": "9.0",
"clang": "9.0", "clang": "9.0",
"msvc": { "msvc": {
"year": "2019", "year": "2019",
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
"qt": { "qt": {
"linux": "5.14.1", "linux": "5.14.1",
"win": "5.13.2" "win": "5.13.2"
} },
"ubuntu": "20.04"
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment