Re: [AMBER] Error for installing the GPU version of Amber20

From: David A Case <>
Date: Wed, 8 Dec 2021 08:50:33 -0500

On Wed, Dec 08, 2021, jinfeng liu wrote:
>I come across another problem when I make install the GPU version of
>Amber20. The error message is in the following,
>/usr/local/cuda-11.3/include/thrust/detail/cpp11_required.h:23:6: 错误:#error
>C++11 is required for this Thrust feature; please upgrade your compiler or
>pass the appropriate -std=c++XX flag to it.
>It seems like the compiler's problem. I use gcc version 4.8.5 20150623 (Red
>Hat 4.8.5-44) (GCC). What should I do? or how to enable the -std=c++11

1. Consider upgrading your compiler. GCC 4.8.5 was released in June, 2015.
This may help with things other than the problem listed above, since few
Amber developers are still using this compiler. Don't go above gcc/gfortran

2. Try the following patch to the CompilerFlags.cmake file in

diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake
index fba09518a9..46ea28656a 100644
--- a/cmake/CompilerFlags.cmake
+++ b/cmake/CompilerFlags.cmake
.. -59,6 +59,8 .. endmacro(add_flags)

+ add_flags(CXX -std=c++11)
         add_flags(C -Wall -Wno-unused-function -Wno-unknown-pragmas)


(By hand: just add the lines marked by "+" at about line 61 of this file.)

This is untested, since I don't have a machine with gcc4, but the Cmake
build report indicates that it does indeed add the flag to the compiler.

...hope this helps....dac

AMBER mailing list
Received on Wed Dec 08 2021 - 06:00:03 PST
Custom Search