mpic++ command not found

3,492 views
Skip to first unread message

wlson...@gmail.com

unread,
Jul 10, 2014, 12:47:54 AM7/10/14
to plumed...@googlegroups.com
Hello everyone,

I met this puzzling situation. Before I compiled openmpi, my plumed was working fine. Now I need to work in parallel with GROMACS, so I deleted my old plumed and tried to compile the new plumed version, plumed2.1b, with mpi. But this time I met I errors at the make stage:

make[7]: mpic++: Command not found
make[7]: *** [Config.o] Error 127
make[7]: Leaving directory `/home/wlsong/Downloads/plumed-2.1b/src/config'
make[6]: *** [all] Error 2
make[6]: Leaving directory `/home/wlsong/Downloads/plumed-2.1b/src/config'
make[5]: *** [../config] Error 2
make[5]: Leaving directory `/home/wlsong/Downloads/plumed-2.1b/src/lib'
make[4]: *** [dirs] Error 2
make[4]: Leaving directory `/home/wlsong/Downloads/plumed-2.1b/src/lib'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/wlsong/Downloads/plumed-2.1b/src/lib'
make[2]: *** [lib] Error 2
make[2]: Leaving directory `/home/wlsong/Downloads/plumed-2.1b/src'
make[1]: *** [lib] Error 2
make[1]: Leaving directory `/home/wlsong/Downloads/plumed-2.1b'
make: *** [all] Error 2

I added openmpi bin path to $PATH and lib path to LD_LIBRARY_PATH in the bashrc, and it looks right when I type mpic++. So I don't know why plumed says mpic++ is not found. Does anyone has any idea how to solve this?  Thanks in advance. 

Linda


Also attach my Makefile.conf here;

CC=gcc
FC=gfortran
LDF90=gfortran
CFLAGS=-g -O2
CXX=mpic++
CXXFLAGS=-O -fPIC -Wall -pedantic -ansi
CPPFLAGS=-I/usr/local/include -DPACKAGE_NAME=\"PLUMED\" -DPACKAGE_TARNAME=\"plumed\" -DPACKAGE_VERSION=\"2\" -          DPACKAGE_STRING=\"PLUMED\ 2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -       DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -       DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D__PLUMED_INTERNAL_LAPACK=1 -D__PLUMED_INTERNAL_BLAS=1 -D__PLUMED_HAS_MOLFILE=1 -   D__PLUMED_INTERNAL_MOLFILE_PLUGINS=1 -D__PLUMED_MPI=1 -D__PLUMED_HAS_CLOCK_GETTIME=1 -D__PLUMED_HAS_CREGEX=1 -          D__PLUMED_HAS_DLOPEN=1 -D__PLUMED_HAS_EXECINFO=1 -D__PLUMED_HAS_ZLIB=1 -DNDEBUG=1 -D_REENTRANT=1
LDFLAGS=
DYNAMIC_LIBS=-lz -lrt -ldl  -L/usr/local/lib -rdynamic
LIBS=-ldl
SOEXT=so
LD=mpic++
LDSO=mpic++ -shared
GCCDEP=mpic++
prefix=/usr/local

davide branduardi

unread,
Jul 10, 2014, 3:07:17 AM7/10/14
to plumed...@googlegroups.com
Hi Linda, 
It looks like your environment is not properly exported.
A fast fix is just to add the complete path to mpicc+
So you do
>>which mpic++
/my/path/to/compiler/mpic++

and then you paste 
/my/path/to/compiler/mpic++
in place of mpic++ in the Makefile.conf

ciaociao
D

wlson...@gmail.com

unread,
Jul 10, 2014, 5:35:17 AM7/10/14
to plumed...@googlegroups.com
Hello Davide,

Yes, it worked, and solved the problem!

But when I moved to compile gromacs-4.6.5 that's patched with plumed (with mpi), I met problems. Compiling standalone gromacs before was fine, but now it complains about undefined reference to `MPI::Comm::Comm()` and undefined reference to `"MPI::Win::Free()"`. Something like this:

Linking C executable mdrun_mpi
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o: In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
Analysis.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)]+0x21): undefined reference to `ompi_mpi_cxx_op_intercept'
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o: In function `MPI::Graphcomm::Clone() const':
Analysis.cpp:(.text._ZNK3MPI9Graphcomm5CloneEv[MPI::Graphcomm::Clone() const]+0x23): undefined reference to `MPI::Comm::Comm()'
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o: In function `MPI::Intracomm::Clone() const':
Analysis.cpp:(.text._ZNK3MPI9Intracomm5CloneEv[MPI::Intracomm::Clone() const]+0x27): undefined reference to `MPI::Comm::Comm()'
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o: In function `MPI::Intracomm::Create_cart(int, int const*, bool const*, bool) const':
Analysis.cpp:(.text._ZNK3MPI9Intracomm11Create_cartEiPKiPKbb[MPI::Intracomm::Create_cart(int, int const*, bool const*, bool) const]+0x8e): undefined reference to `MPI::Comm::Comm()'
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o: In function `MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const':
Analysis.cpp:(.text._ZNK3MPI9Intracomm12Create_graphEiPKiS2_b[MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const]+0x26): undefined reference to `MPI::Comm::Comm()'
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o: In function `MPI::Cartcomm::Sub(bool const*) const':
Analysis.cpp:(.text._ZNK3MPI8Cartcomm3SubEPKb[MPI::Cartcomm::Sub(bool const*) const]+0x74): undefined reference to `MPI::Comm::Comm()'
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o:Analysis.cpp:(.text._ZNK3MPI8Cartcomm5CloneEv[MPI::Cartcomm::Clone() const]+0x23): more undefined references to `MPI::Comm::Comm()' follow
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[vtable for MPI::Datatype]+0x78): undefined reference to `MPI::Datatype::Free()'
/home/wlsong/Downloads/plumed-2.1b/src/analysis/Analysis.o:(.data.rel.ro._ZTVN3MPI3WinE[vtable for MPI::Win]+0x48): undefined reference to `MPI::Win::Free()'
collect2: ld returned 1 exit status
make[3]: *** [src/kernel/mdrun_mpi] Error 1
make[2]: *** [src/kernel/CMakeFiles/mdrun.dir/all] Error 2
make[1]: *** [src/kernel/CMakeFiles/mdrun.dir/rule] Error 2
make: *** [mdrun] Error 2

Do you have any idea how to solve this? Thanks in advance :)

Cheers,
Linda


在 2014年7月10日星期四UTC+8下午3时07分17秒,davide branduardi写道:

davide branduardi

unread,
Jul 10, 2014, 6:00:06 AM7/10/14
to plumed...@googlegroups.com
Hi Linda, 
try to add in gromacs setups with CMAKE an explicit call to the mpi library like -L/path/to/my/mpi/ -lmpi in linking phase
(i do not know from the top of my head the precise cmake commands that you have to use, you can dig them in gromacs manual or mailing list)
D

Reply all
Reply to author
Forward
0 new messages