Installation issue - gcc version

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.

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

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.

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

1 Like

Hii vmyriant,

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

Regards,
Ashish

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?

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.

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

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.