# 2020 cuda compile errors

**URL:** <https://gromacs.bioexcel.eu/t/2020-cuda-compile-errors/1408>\
**Category:** User discussions\
**Created:** [January 8, 2021, 9:44pm UTC](https://gromacs.bioexcel.eu/t/2020-cuda-compile-errors/1408 "2021-01-08T21:44:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfaendtner](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@pfaendtner](https://gromacs.bioexcel.eu/u/pfaendtner)\
**Post date:** [January 8, 2021, 9:44pm UTC](https://gromacs.bioexcel.eu/t/2020-cuda-compile-errors/1408/1 "2021-01-08T21:44:43Z")

</div>

GROMACS version: 2020.4  
GROMACS modification: No  
Here post your question

Hello, I’m unable to compile GPU enabled gromacs. The MPI version compiles fine, but when I enable the GPU compile with -GMX\_GPU=ON , I fail compilation with many errors like this:

/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/basic\_string.tcc(1067): error: a nonstatic member reference must be relative to a specific object  
\_M\_set\_sharable();  
^

My loaded module set is the following:

1. icc\_19 2) icc\_19-impi\_2019 3) cmake/3.11.2 4) gcc/8.2.1 5) cuda/10.1.105\_418.39

Any suggestions would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![kevinboyd](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kevinboyd](https://gromacs.bioexcel.eu/u/kevinboyd)\
**Post date:** [January 9, 2021, 3:27pm UTC](https://gromacs.bioexcel.eu/t/2020-cuda-compile-errors/1408/2 "2021-01-09T15:27:46Z")

</div>

Hi,

Why are you loading ICC and gcc at the same time? Are you doing something funny with the standard libraries?

What’s your operating system? Depending on that, CUDA 10.1 may not be compatible with GCC 8 -  
see table 1 at [Installation Guide Linux :: CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/archive/10.1/cuda-installation-guide-linux/index.html)

---

<div class="post-metadata">

**Author:** ![pfaendtner](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@pfaendtner](https://gromacs.bioexcel.eu/u/pfaendtner)\
**Post date:** [January 9, 2021, 9:05pm UTC](https://gromacs.bioexcel.eu/t/2020-cuda-compile-errors/1408/3 "2021-01-09T21:05:35Z")

</div>

I load gcc because the base g++ installed in the system is 4.8.5 and I need 5.1 or higher according to this error message:

CMake Error at cmake/FindLibStdCpp.cmake:119 (message):  
Found g++ at /usr/bin/g++. Its version is 4.8.5. GROMACS requires at  
least version 5.1. Please specify a different g++ using  
GMX\_GPLUSPLUS\_PATH, PATH or CMAKE\_PREFIX\_PATH.  
Call Stack (most recent call first):

Loading both has always taken care of the of that error message for gmx on CPU. I guess the proper thing to do is get the sysadmin to upgrade the base/core gcc that is installed.

Thanks for the reference. My student simultaneously found the same issue I think we are making progress now.

---

<div class="post-metadata">

**Author:** ![kevinboyd](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kevinboyd](https://gromacs.bioexcel.eu/u/kevinboyd)\
**Post date:** [January 9, 2021, 11:31pm UTC](https://gromacs.bioexcel.eu/t/2020-cuda-compile-errors/1408/4 "2021-01-09T23:31:59Z")

</div>

The “base” gcc can’t really be upgraded, it’s pinned to the version of the operating system in most cases. Installed gcc/other compilers should work fine as long as Gromacs finds them correctly at configure time and the CUDA/OS/compiler version is compatible.

If your combination seems good and cmake says you’ve found the correct gcc version the problem persists I’d say to try (in order):

- removing the icc load from the install
- upgrading cuda
