[AMBER-Developers] pmemd.cuda compilation issue

From: Jason Swails <jason.swails.gmail.com>
Date: Fri, 16 Nov 2012 13:42:27 -0500

Hi everyone,

George and I were having some issues recently building an
amber12-with-patches version of pmemd.cuda. We were getting these types of
errors at the link stage:

./cuda/cuda.a(gpu.o):gpu.cpp:function gpu_startup_: error: undefined
reference to 'operator new(unsigned long)'
./cuda/cuda.a(gpu.o):gpu.cpp:function gpu_startup_: error: undefined
reference to 'operator delete(void*)'
... etc.

new and delete are perfectly valid C++ operators, and it turns out that the
issue was that the linking is done by the Fortran compiler (in this case
gfortran), which was not actually loading the C++ standard library during
the link stage.

Adding -lstdc++ to the PMEMD_LD variable in the config.h solved the
compilation issues. Has anyone else seen this before? This also happens
with the master branch, unsurprisingly.

System specifications:
Ubuntu 11.10
GNU compilers version 4.6.1
NVCC version 4.2 V0.2.1221

Same errors (and fix) seen with ifort Version 12.1.2

Thoughts/comments?

Thanks!
Jason

P.S. Another note, the resulting pmemd.cuda_SPFP executable fails all
tests with the following error message:
Error: unknown error launching kernel kClearGBBuffers

So maybe something isn't quite right with the system somehow? Driver
version 295.20. The available graphics cards are a GTS 420 and a GTX 470.
 I'm not sure what's happening here...

-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Fri Nov 16 2012 - 11:00:02 PST
Custom Search