plumed / plumed2

Development version of plumed 2
https://www.plumed.org
GNU Lesser General Public License v3.0
363 stars 289 forks source link

Problem finding the MPI libraries needed. #875

Closed haltari closed 1 year ago

haltari commented 2 years ago

TLDR: I cannot complete the quick compilation instructions because the MPI libraries I have installed are not the ones that Plumed expects, and the documentation is not clear what library files need to be installed. Ubuntu 20.04.4 LTS with 5.15.0-52-generic kernel.

I am trying to follow the instructions for building Plumed from sources, and am having problems with the statement under "Suggested software" to install the MPI library. I have installed the following packages from apt: mpi-default-bin mpi-default-dev openmpi-bin openmpi-common openmpi-doc. When I run make test, the tests fail because they are not finding the MPI functions. For example, here are the last two failures (there are probably several dozen identical errors):

/usr/bin/ld: /home/BU/haltari1/tmp/plumed2/src/tools/Communicator.o: in function `PLMD::Communicator::Barrier() const':
Communicator.cpp:(.text+0x3fe): undefined reference to `MPI_Barrier'
/usr/bin/ld: /home/BU/haltari1/tmp/plumed2/src/tools/Communicator.o: in function `PLMD::Communicator::Split(int, int, PLMD::Communicator&) const':
Communicator.cpp:(.text+0x4ad): undefined reference to `MPI_Comm_split'

Then, when I try to run plumed help, I get similar errors from not finding the MPI functions:

terminate called after throwing an instance of 'PLMD::Plumed::ExceptionError'
  what():  
+++ PLUMED error
+++ at Communicator.cpp:91, function void PLMD::Communicator::Set_comm(void*)
+++ message follows +++
you are trying to use an MPI function, but PLUMED has been compiled without MPI support
[ens-93rj772-d:215658] *** Process received signal ***
[ens-93rj772-d:215658] Signal: Aborted (6)
[ens-93rj772-d:215658] Signal code:  (-6)
[ens-93rj772-d:215658] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x43090)[0x7f5de4cd3090]
[ens-93rj772-d:215658] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f5de4cd300b]
[ens-93rj772-d:215658] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f5de4cb2859]
[ens-93rj772-d:215658] [ 3] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa1a31)[0x7f5de4f40a31]
[ens-93rj772-d:215658] [ 4] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xad5dc)[0x7f5de4f4c5dc]
[ens-93rj772-d:215658] [ 5] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xad647)[0x7f5de4f4c647]
[ens-93rj772-d:215658] [ 6] /lib/x86_64-linux-gnu/libstdc++.so.6(__cxa_rethrow+0x4d)[0x7f5de4f4c93d]
[ens-93rj772-d:215658] [ 7] ./plumed(+0xf5c9)[0x555ac4a0f5c9]
[ens-93rj772-d:215658] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f5de4cb4083]
[ens-93rj772-d:215658] [ 9] ./plumed(+0xf84e)[0x555ac4a0f84e]
[ens-93rj772-d:215658] *** End of error message ***
Aborted (core dumped)

Can I get some advice to get a proper MPI installation? Thanks.

colematt commented 2 years ago

Watching this discussion, am having similar problems.

GiovanniBussi commented 2 years ago

It looks like:

Possibly you didn't type make clean after having installed the MPI libraries?

Please do make clean and compile plumed again.

Let us know if this solves the issue