Re: [AMBER-Developers] CUDA build fails for PBSA

From: Jason Swails <>
Date: Sat, 11 Mar 2017 15:49:17 -0500

I saw the same thing as Dan. I needed to add -lstdc++ to the linker line
to resolve this.

It seems either your gfortran build links the C++ libraries on its own or
it doesn't. If it does, then everything will work. If it doesn't, you get
the error unless you explicitly link libstdc++. We saw exactly the same
problem with pmemd.cuda in the early days and spent a fair bit of effort
iterating over the available compilers and options and such before we
finally got something that works. Look at line 1406 of configure2 and
you'll see fc_cxx_link_flag being added to the CUDA library. Note that not
all compilers use libstdc++, though (which is why fc_cxx_link_flag exists
and changes based on your compiler choice).

I *highly* recommend specifying flags in configure rather than hardcoding
them in the Makefile. In fact, I would recommend just trying the pmemd
CUDA flags and see if that works. If not, you may need to add another
variable for PBSA's CUDA libraries.

All the best,

On Sat, Mar 11, 2017 at 3:20 PM, Ray Luo <> wrote:

> From Ruxi ...
> It's strange our gnu 4.8.2 with cuda-7.5 on gpu-1-1 passed the tests,
> even I
> didn't use -lstdc++.
> Best,
> Ruxi
> On Mar 11, 2017 11:59 AM, Ray Luo <> wrote:
> Thanks for spotting this! Will fix it soon.
> Ray
> _______________________________________________
> AMBER-Developers mailing list

Jason M. Swails
AMBER-Developers mailing list
Received on Sat Mar 11 2017 - 13:00:02 PST
Custom Search