Errors while compiling with gpu package

Hello developers,

  I am experiencing a linking error while compiling lammps for linux. Here
is part of the message:

../../lib/gpu/libgpu.a(pair_gpu_device.o):(.rodata+0x4a0): undefined
reference to `typeinfo for MPI::Intracomm'
../../lib/gpu/libgpu.a(pair_gpu_device.o):(.rodata+0x4c0): undefined
reference to `typeinfo for MPI::Intracomm'
../../lib/gpu/libgpu.a(pair_gpu_device.o):(.rodata+0x510): undefined
reference to `typeinfo for MPI::Comm'
(and other similar messages)

  I have the packages kspace and gpu installed. Previous to that, I
compiled the gpu library with no errors. However, the executable
nvc_get_devices returned an error 134 with the message:

terminate called after throwing an instance of 'cudaError'
Aborted

  My gpu is a GT 240 with 1.2 compute capability and I installed the cuda
toolkit 4.0.17 64 bits.

  What could be the cause of those errors?

  Best regards,

  Luis