Installing GROMACS on HPC Cluster

I deleted gromacs-2022.2 from the HPC cluster to reinstall gromacs-2024.4.
I am installing gromacs-2024.4 on a HPC cluster. I am following the sequence of commands from the “Quick & Dirty installation” in the GROMACS documentation.
I recieved an error when I run this sequence of command, “cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON”.
Here I am pasting the commands I inputted:

(base) [… ~]$ wget ftp://ftp.gromacs.org/gromacs/gromacs-2024.4.tar.gz
–2024-12-20 16:43:59-- ftp://ftp.gromacs.org/gromacs/gromacs-2024.4.tar.gz
=> ‘gromacs-2024.4.tar.gz’
Resolving ftp.gromacs.org (ftp.gromacs.org)… 130.237.11.165, 2001:6b0:1:1191:216:3eff:fec7:6e30
Connecting to ftp.gromacs.org (ftp.gromacs.org)|130.237.11.165|:21… connected.
Logging in as anonymous … Logged in!
==> SYST … done. ==> PWD … done.
==> TYPE I … done. ==> CWD (1) /gromacs … done.
==> SIZE gromacs-2024.4.tar.gz … 42356162
==> PASV … done. ==> RETR gromacs-2024.4.tar.gz … done.
Length: 42356162 (40M) (unauthoritative)

100%[======================================>] 42,356,162 14.7MB/s in 2.7s

2024-12-20 16:44:05 (14.7 MB/s) - ‘gromacs-2024.4.tar.gz’ saved [42356162]

(base) [… ~] ls gromacs-2024.4.tar.gz miniconda Miniconda3-py311_23.5.2-0-Linux-x86_64.sh intel miniconda3 myproject (base) [... ~] tar xfz gromacs-2024.4.tar.gz
(base) [… ~] ls gromacs-2024.4 miniconda myproject gromacs-2024.4.tar.gz miniconda3 intel Miniconda3-py311_23.5.2-0-Linux-x86_64.sh (base) [... ~] cd gromacs-2024.4
(base) [… gromacs-2024.4] ls admin CITATION.cff COPYING docs README src api cmake CPackInit.cmake INSTALL scripts tests AUTHORS CMakeLists.txt CTestConfig.cmake python_packaging share (base) [... gromacs-2024.4] mkdir build
(base) [… gromacs-2024.4] ls admin CITATION.cff CPackInit.cmake python_packaging src api cmake CTestConfig.cmake README tests AUTHORS CMakeLists.txt docs scripts build COPYING INSTALL share (base) [... gromacs-2024.4] cd build
(base) [… build]$ cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
– The C compiler identification is GNU 8.3.0
– The CXX compiler identification is GNU 8.3.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /opt/ohpc/pub/compiler/gcc/8.3.0/bin/gcc - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /opt/ohpc/pub/compiler/gcc/8.3.0/bin/c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
CMake Error at cmake/gmxTestCompilerProblems.cmake:69 (message):
GCC version 9 or later required. Earlier versions don’t have full C++17
support.
Call Stack (most recent call first):
CMakeLists.txt:100 (gmx_test_compiler_problems)

– Configuring incomplete, errors occurred!

Why is the configuration incomplete and errors occurred?

The output is reporting the reason:

– The C compiler identification is GNU 8.3.0
– The CXX compiler identification is GNU 8.3.0

and then

GCC version 9 or later required. Earlier versions don’t have full C++17
support.

You need a newer version of GCC!

I can’t remember the process installing GCC version 9.

I remember to install the C compiler or CXX compiler specify the -DMAKE_C_Compiler=8.3.0 for C Compiler. For CXX compiler, -DCMAKE_CXX_Compiler=8.3.0.
This is install when running cmake in the terminal window.
cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_MPI=ON
The -DGMX_MPI=ON provides MPI support to run script file in GROMACS.

Check cmake version using cmake --version command in the terminal
I did I have cmake version 3.26.4.

You do not have to install any compiler but rather pass to the flags a newer one (at least version 9). You can’t pass the number to the flag but rather the full path like -DMAKE_C_Compiler=/path/to/gcc>=9 -DMAKE_CXX_Compiler=/path/to/g++>=9.

What is the output if you run simply

gcc --version
g++ --version

?

The version is gcc (GCC) 8.3.0.

Then you have to point cmake to newer C/C++ compilers. Or you check in the same positions where the 8.3.0 is (e.g. which gcc and you check that directory), or depending on your HPC environment you might have modules to load with specific compilers (e.g. module load GCC). It is hard to help you here as you are the one with access to the HPC, so you have to check in the documentation/forum/helpdesk of that HPC service what to do to get the version you need.

Okay, thank you. I can’t use sudo in my HPC cluster.