GROMACS on RISC-V

GROMACS version: Any version
GROMACS modification: Yes/No
Here post your question: I am wondering, does GROMACS installable on RISC-V (both 32 and 64 bit architectures)?

Hi,

In principle it should work but we only have experience with it through working with the Debian team to make sure as many of their CI builds compile and pass our tests. They have 64-bit RISC-V in buildd, but looks like there is a toolchain error and compilation is only partially successful:
https://buildd.debian.org/status/fetch.php?pkg=gromacs&arch=riscv64&ver=2021.1-1&stamp=1618787527&raw=0
I expect this may not be hard to resolve e.g. by upgrading the toolchains to gcc 10 (or perhaps using clang).

Szilárd

Hello Szilárd,

I am trying to build on RISC-V 32 compiler but I am getting following error:

/gromacs-2019.6/src/external/thread_mpi/src/pthreads.cpp:81:37: error: ‘PTHREAD_MUTEX_INITIALIZER’ was not declared in this scope; did you mean ‘TMPI_THREAD_MUTEX_INITIALIZER’?

In the cmake command line option I gave path to header files using this switch -DCMAKE_INCLUDE_PATH="/path/to/header_files" But I am still unable to remove the above error. Can you please tell me what am I missing?

Thanks,
-Amit

Hi,

Your pthreads are broken I think, that macro should be in pthread.h. I suggest to make sure that your pthreads installation is complete. Alternatively you may be able to get away by turning off thread-MPI parallelization (-DGMX_THREAD_MPI=OFF).

BTW, why not use the latest release instead of one that is 2 years old?

Cheers,
Szilárd

Hello Szilárd,

Actually, I did switch off using -DGMX_THREAD_MPI=OFF but I am still getting error. When switched off these codes: /gromacs
2019.6/src/external/thread_mpi/src/*.cpp should not be called? I am sticking on to gromacs-2019.6 version because it is successfully compiling. Other versions have lot of compilation issues.

Thanks,
-Amit

Hi Amit,

We do use some of the functionalities provided by the thread-MPI library even when using it for parallelization is switched off.

What sort of compilation issues did you run into with the latest release? Are you using modern compilers?

Also note that 32-bit support is deprecated, we stopped testing in CI on 32-bit ARM a year or two ago.

Cheers,
Szilárd

Hello Szilárd,

On latest release Cmake is throwing error that it is does not know how enable to C++17. I have gcc 9.3 and Cmake 3.19. I did change compiler paths in CMakeCache.txt which was pointing to old version of gcc and g++ and compiled it, I was unsuccessful.

Thanks,
-Amit

What is your cmake invocation and exact output? (You can’t change the compiler in the cache without regenerating it, you should use -DCMAKE_CXX_COMPILER).

OK Szilárd, now I got it. But I think all latest versions only support 64 bit? I am planning to cross compile for RV32 elf. I am not sure whether GROMACS run on elf? I think it requires Liniux OS support…

But I think all latest versions only support 64 bit?

32-bit is not officially supported, but there is nothing that prevents building on such platforms; see https://buildd.debian.org/status/package.php?p=gromacs&suite=experimental