# GROMACS on RISC-V

**URL:** <https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995>\
**Category:** User discussions\
**Created:** [April 20, 2021, 1:15am UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995 "2021-04-20T01:15:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![amit.hmath](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@amit.hmath](https://gromacs.bioexcel.eu/u/amit.hmath)\
**Post date:** [April 20, 2021, 1:15am UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/1 "2021-04-20T01:15:14Z")

</div>

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)?

---

<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:** [April 20, 2021, 2:04pm UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/2 "2021-04-20T14:04:43Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![amit.hmath](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@amit.hmath](https://gromacs.bioexcel.eu/u/amit.hmath)\
**Post date:** [April 20, 2021, 4:38pm UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/3 "2021-04-20T16:38:00Z")

</div>

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

---

<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:** [April 21, 2021, 6:08pm UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/4 "2021-04-21T18:08:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amit.hmath](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@amit.hmath](https://gromacs.bioexcel.eu/u/amit.hmath)\
**Post date:** [April 22, 2021, 10:46am UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/5 "2021-04-22T10:46:12Z")

</div>

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

---

<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:** [April 22, 2021, 11:13am UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/6 "2021-04-22T11:13:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amit.hmath](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@amit.hmath](https://gromacs.bioexcel.eu/u/amit.hmath)\
**Post date:** [April 22, 2021, 12:28pm UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/7 "2021-04-22T12:28:27Z")

</div>

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

---

<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:** [April 22, 2021, 4:58pm UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/8 "2021-04-22T16:58:56Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![amit.hmath](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@amit.hmath](https://gromacs.bioexcel.eu/u/amit.hmath)\
**Post date:** [April 23, 2021, 1:53am UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/9 "2021-04-23T01:53:39Z")

</div>

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…

---

<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:** [April 26, 2021, 9:04am UTC](https://gromacs.bioexcel.eu/t/gromacs-on-risc-v/1995/10 "2021-04-26T09:04:44Z")

</div>

> 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 [Buildd status for gromacs (experimental)](https://buildd.debian.org/status/package.php?p=gromacs&suite=experimental)
