# Installation issue - gcc version

**URL:** <https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806>\
**Category:** User discussions\
**Created:** [September 13, 2021, 4:02pm UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806 "2021-09-13T16:02:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmyriant](https://avatars.discourse-cdn.com/v4/letter/v/c4cdca/32.png) [@vmyriant](https://gromacs.bioexcel.eu/u/vmyriant)\
**Post date:** [September 13, 2021, 4:02pm UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806/1 "2021-09-13T16:02:53Z")

</div>

GROMACS version:2020-5  
GROMACS modification: No

Hi there,

Trying to install Gromacs, at the: “cmake … -DGMX\_BUILD\_OWN\_FFTW=ON -DREGRESSIONTEST\_DOWNLOAD=ON”  
stage, I get the error message:  
" GCC version 5 or later required. Earlier versions don’t have full C++14 support."  
Yet, in my computer I have installed gcc version 10.1.0 and g++ version 10.1.0.

Does anyone have a suggestion how to proceed?

Many thanks.

---

<div class="post-metadata">

**Author:** ![pszilard](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pszilard/32/21_2.png) [@pszilard](https://gromacs.bioexcel.eu/u/pszilard)\
**Post date:** [September 13, 2021, 4:59pm UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806/2 "2021-09-13T16:59:26Z")

</div>

Can you please share the exact output as well as the output of `gcc --version`?

---

<div class="post-metadata">

**Author:** ![vmyriant](https://avatars.discourse-cdn.com/v4/letter/v/c4cdca/32.png) [@vmyriant](https://gromacs.bioexcel.eu/u/vmyriant)\
**Post date:** [September 14, 2021, 1:39pm UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806/3 "2021-09-14T13:39:49Z")

</div>

Thank you.  
Here is the error:

* * *

CMake Error at cmake/gmxTestCompilerProblems.cmake:72 (message):  
GCC version 5 or later required. Earlier versions don’t have full C++14  
support.  
Call Stack (most recent call first):  
CMakeLists.txt:345 (gmx\_test\_compiler\_problems)

– Configuring incomplete, errors occurred!  
See also “/opt/gromacs-2020.5/CMakeFiles/CMakeOutput.log”.  
See also “/opt/gromacs-2020.5/CMakeFiles/CMakeError.log”.  
CMake Error: Unable to open check cache file for write. /opt/gromacs-2020.5/CMakeFiles/cmake.check\_cache

* * *

and the gcc version:

* * *

gcc (GCC) 10.1.0  
Copyright (C) 2020 Free Software Foundation, Inc.  
This is free software; see the source for copying conditions. There is NO  
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++ (GCC) 10.1.0  
Copyright (C) 2020 Free Software Foundation, Inc.  
This is free software; see the source for copying conditions. There is NO  
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

* * *

Thank you for this.

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [September 15, 2021, 7:29am UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806/4 "2021-09-15T07:29:49Z")

</div>

Hi,

try adding `-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++` to your `cmake` command. It might be that some older binaries are being selected automatically, in which case setting them manually should fix it.

Regards,  
Petter

---

<div class="post-metadata">

**Author:** ![ashish](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@ashish](https://gromacs.bioexcel.eu/u/ashish)\
**Post date:** [July 19, 2022, 4:50am UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806/5 "2022-07-19T04:50:58Z")

</div>

Hii vmyriant,

How did you solve this problem? I am also facing same error and unable to solve it. Please suggest.

Regards,  
Ashish

---

<div class="post-metadata">

**Author:** ![ostueker](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ostueker/32/4918_2.png) [@ostueker](https://gromacs.bioexcel.eu/u/ostueker)\
**Post date:** [July 19, 2022, 12:35pm UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806/6 "2022-07-19T12:35:23Z")

</div>

As Petter has suggested, you can tell cmake which gcc compilers it should use using the `-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++` options.

What’s the output of these commands?

```auto
which gcc g++
gcc --version
g++ --version
apt list --installed gcc-*

```

The last command assumes you are running a Linux distribution like Ubuntu, Mint or Debian. If that doesn’t work, please tell us which operating system you are using.

---

<div class="post-metadata">

**Author:** ![ashish](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@ashish](https://gromacs.bioexcel.eu/u/ashish)\
**Post date:** [July 20, 2022, 11:36am UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806/7 "2022-07-20T11:36:45Z")

</div>

Hi, Thanks for your reply.

I am using RedHat linux 4.8.5-44 x86\_64.

I am availing this on one of the computational server in India.

gcc version is 4.8.5

For g++ version 4.8.5

Please suggest.

![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/4/45887e1139e78eb717dac2d92732a9f0300b48f5.png)

---

<div class="post-metadata">

**Author:** ![ostueker](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ostueker/32/4918_2.png) [@ostueker](https://gromacs.bioexcel.eu/u/ostueker)\
**Post date:** [July 20, 2022, 12:03pm UTC](https://gromacs.bioexcel.eu/t/installation-issue-gcc-version/2806/8 "2022-07-20T12:03:15Z")

</div>

Those compilers are indeed too old to compile recent versions of GROMACS.

Does your computing centre use “environment modules” to manage software packages?

Maybe try running `module avail gcc` and/or `module avail gromacs` to see if they may have newer versions of the _GNU Compiler Collection_ (GCC; which contains gcc and g++ and more) installed. Maybe they even have the version of GROMACS you want.

If they are managing software with “environment modules”, you can use the `module avail {MODULENAME}` commands to see what versions of `{MODULENAME}` are installed and then load it with e.g. `module load gcc/9.3.0` for that particular version.

If not, please look at your computing centre’s documentation or reach out to their support team to seek advice what additional software they have installed and how you can use it.
