"undefined reference to `ompi_datatype_t* " errors while compiling plumed

66 views
Skip to first unread message

Visvaldas Kairys

unread,
Jul 7, 2017, 9:03:56 AM7/7/17
to PLUMED users
Dear all,

Sorry for the messy text: error messages interspersed with useful text. I shortened the error text to be able to be a bit more readable.

I ran into problems when trying to compile plumed on our local lab cluster: I always get errors. The correct configuration is  the confusing part, because the cluster has a bit dated openmpi and gcc (4.4 I think), so to be able compile gromacs2016.3 I had to install gcc version 4.9.4 which are run from my home directory.

An example of the errors I get

%setenv CC mpicc
%setenv CXX mpic++
./configure --prefix=/home/visvaldas/plumed232 --disable-mpi
 make install

[when I do

%which mpicc
/opt/openmpi/bin/mpicc
% which mpic++
/opt/openmpi/bin/mpic++
% which gcc
/home/visvaldas/gcc494/bin/gcc]


The errors are:

<....>
config/ConfigInstall.o ../wrapper/PlumedStatic.o -o install/plumed -ldl  -lstdc++ -lz -ldl -llapack -lblas   -rdynamic -fopenmp
../analysis/LandmarkSelectionBase.o: In function `PLMD::analysis::LandmarkSelectionBase::selectLandmarks(PLMD::MultiReferenceBase*)':
LandmarkSelectionBase.cpp:(.text+0xf84): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
../bias/MetaD.o: In function `PLMD::bias::MetaD::addGaussian(PLMD::bias::MetaD::Gaussian const&)':
MetaD.cpp:(.text+0x3ff8): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
MetaD.cpp:(.text+0x4074): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
../bias/MetaD.o: In function `PLMD::bias::MetaD::getBiasAndDerivatives(std::vector<double, std::allocator<double> > const&, double*)':
MetaD.cpp:(.text+0x7cc6): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
MetaD.cpp:(.text+0x7d29): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
../bias/MetaD.o:MetaD.cpp:(.text+0x873c): more undefined references to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()' follow
../bias/MetaD.o: In function `PLMD::bias::MetaD::update()':
<...>
Ensemble.cpp:(.text+0x23ef): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
collect2: error: ld returned 1 exit status

<...>


If I omit --disable-mpi in the config I get something very similar or even identical:

config/ConfigInstall.o ../wrapper/PlumedStatic.o -o install/plumed -ldl  -lstdc++ -lz -ldl -llapack -lblas   -rdynamic -fopenmp
../analysis/LandmarkSelectionBase.o: In function `PLMD::analysis::LandmarkSelectionBase::selectLandmarks(PLMD::MultiReferenceBase*)':
LandmarkSelectionBase.cpp:(.text+0xf84): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
../bias/MetaD.o: In function `PLMD::bias::MetaD::addGaussian(PLMD::bias::MetaD::Gaussian const&)':
MetaD.cpp:(.text+0x3ff8): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
MetaD.cpp:(.text+0x4074): undefined reference to `ompi_datatype_t* PLMD::Communicator::getMPIType<double>()'
<...>


To exacerbate matters, I run gromacs with mvapich2 (openmpi for some reason doesn't run with gromacs2016.3), but mvapich2 does not enter plumed config anywhere, so this is probably irrelevant to plumed.

I tried different permutations of compiler (old vs new), also tried to use mvapich2 but not suceessfully.

For example, if I use mvapich2's mpicc/mpicxx, I get

<...>
../analysis/Analysis.o: In function `MPI::Cartcomm::Clone() const':
Analysis.cpp:(.text._ZNK3MPI8Cartcomm5CloneEv[_ZNK3MPI8Cartcomm5CloneEv]+0x33): undefined reference to `MPI::Comm::Comm()'
Analysis.cpp:(.text._ZNK3MPI8Cartcomm5CloneEv[_ZNK3MPI8Cartcomm5CloneEv]+0x66): undefined reference to `ompi_mpi_comm_null'
../analysis/Analysis.o: In function `MPI::Graphcomm::Clone() const':
Analysis.cpp:(.text._ZNK3MPI9Graphcomm5CloneEv[_ZNK3MPI9Graphcomm5CloneEv]+0x33): undefined reference to `MPI::Comm::Comm()'
Analysis.cpp:(.text._ZNK3MPI9Graphcomm5CloneEv[_ZNK3MPI9Graphcomm5CloneEv]+0x66): undefined reference to `ompi_mpi_comm_null'
../analysis/Analysis.o: In function `MPI::Intercomm::Merge(bool) const':
Analysis.cpp:(.text._ZNK3MPI9Intercomm5MergeEb[_ZNK3MPI9Intercomm5MergeEb]+0x3b): undefined reference to `MPI::Comm::Comm()'
Analysis.cpp:(.text._ZNK3MPI9Intercomm5MergeEb[_ZNK3MPI9Intercomm5MergeEb]+0x69): undefined reference to `ompi_mpi_comm_null'
../analysis/Analysis.o: In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
<...>


I am not sure what other combinations to try.

Perhaps I need to install a newer version of openmpi?

Best regards,

Vis Kairys

Visvaldas Kairys

unread,
Jul 10, 2017, 4:21:27 AM7/10/17
to PLUMED users
After this, I installed openmpi locally, and now I get the "undefined reference to `MPI::Comm::Comm()' errors.
I also tried add -Wl,-rpath -Wl,/home/visvaldas/local/lib flag to LDFLAGS.
I suspect the linking flags (the first line below) are wrong, but I haven't figured out what's the problem yet.


<...> -o plumed -ldl  -lstdc++ -lz -ldl -llapack -lblas  -Wl,-rpath -Wl,/home/visvaldas/local/lib -rdynamic -fopenmp

../analysis/Analysis.o: In function `MPI::Cartcomm::Clone() const':
Analysis.cpp:(.text._ZNK3MPI8Cartcomm5CloneEv[_ZNK3MPI8Cartcomm5CloneEv]+0x33): undefined reference to `MPI::Comm::Comm()'
../analysis/Analysis.o: In function `MPI::Graphcomm::Clone() const':
Analysis.cpp:(.text._ZNK3MPI9Graphcomm5CloneEv[_ZNK3MPI9Graphcomm5CloneEv]+0x33): undefined reference to `MPI::Comm::Comm()'
../analysis/Analysis.o: In function `MPI::Intercomm::Merge(bool) const':
Analysis.cpp:(.text._ZNK3MPI9Intercomm5MergeEb[_ZNK3MPI9Intercomm5MergeEb]+0x3b): undefined reference to `MPI::Comm::Comm()'

PS
my LD_LIBRARY_PATH=/home/visvaldas/gcc494/lib/../lib64:/home/visvaldas/local/lib:/home/visvaldas/mvapich2/bin:/home/visvaldas/gromacs20163/lib64:/home/visvaldas/gcc494/lib/../lib64:/home/visvaldas/local/lib/openmpi:/home/visvaldas/mvapich2/bin:/opt/openmpi/lib
I
(duplication due to reload of shell).

Visvaldas Kairys

unread,
Jul 11, 2017, 5:47:57 AM7/11/17
to PLUMED users
Ok, I was able to compile plumed only after I isntalled OpenMPI version 1.10.7 instead of 2.1.1. Hopefully this will be useful to developers and occasioanl users who have the wrong openmpi version.
Reply all
Reply to author
Forward
0 new messages