[lammps-users] Problem compiling LAMMPS (g++ parallel)

Dear Friends,

I downloaded and reinstalled MPICH2. Then changed the path and linking variables.When i make LAMMPS, I get the following error(s). Is it because of some unmet dependency?

make[1]: Entering directory `/home/nandu/Desktop/lammps/src/Obj_purna’
/home/nandu/Desktop/openmpi/prefix/bin/mpicc -O -L/home/nandu/mpich2-install/lib -L/home/nandu/Desktop/fftw/prefix/lib angle_charmm.o angle_cosine.o angle_cosine_delta.o angle_cosine_squared.o angle.o … region_intersect.o region_plane.o region_prism.o region_sphere.o region_union.o remap.o remap_wrap.o replicate.o respa.o run.o set.o shell.o special.o temper.o thermo.o timer.o universe.o update.o variable.o velocity.o verlet.o write_restart.o -lmpich -lpthread -lstdc++ -o …/lmp_purna

angle_charmm.o: In function MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)': angle_charmm.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)]+0x1f): undefined reference to ompi_mpi_cxx_op_intercept’
angle_charmm.o: In function MPI::Graphcomm::Clone() const': angle_charmm.cpp:(.text._ZNK3MPI9Graphcomm5CloneEv[MPI::Graphcomm::Clone() const]+0x25): undefined reference to MPI::Comm::Comm()’
angle_charmm.o: In function MPI::Intracomm::Create(MPI::Group const&) const': angle_charmm.cpp:(.text._ZNK3MPI9Intracomm6CreateERKNS_5GroupE[MPI::Intracomm::Create(MPI::Group const&) const]+0x34): undefined reference to MPI::Comm::Comm()’
angle_charmm.o: In function MPI::Intracomm::Create_cart(int, int const*, bool const*, bool) const': angle_charmm.cpp:(.text._ZNK3MPI9Intracomm11Create_cartEiPKiPKbb[MPI::Intracomm::Create_cart(int, int const*, bool const*, bool) const]+0x9f): undefined reference to MPI::Comm::Comm()’
angle_charmm.o: In function MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const': angle_charmm.cpp:(.text._ZNK3MPI9Intracomm12Create_graphEiPKiS2_b[MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const]+0x31): undefined reference to MPI::Comm::Comm()’
angle_charmm.o: In function MPI::Cartcomm::Clone() const': angle_charmm.cpp:(.text._ZNK3MPI8Cartcomm5CloneEv[MPI::Cartcomm::Clone() const]+0x25): undefined reference to MPI::Comm::Comm()’
angle_charmm.o:angle_charmm.cpp:(.text._ZN3MPI8Cartcomm3SubEPKb[MPI::Cartcomm::Sub(bool const*)]+0x7c): more undefined references to MPI::Comm::Comm()' follow angle_charmm.o:(.rodata._ZTVN3MPI3WinE[vtable for MPI::Win]+0x48): undefined reference to MPI::Win::Free()’
angle_charmm.o:(.rodata._ZTVN3MPI8DatatypeE[vtable for MPI::Datatype]+0x78): undefined reference to `MPI::Datatype::Free()’

collect2: ld returned 1 exit status

make[1]: *** […/lmp_purna] Error 1
make[1]: Leaving directory `/home/nandu/Desktop/lammps/src/Obj_purna’
make: *** [purna] Error 2
[[email protected]…1677… src]$

Regards,
Nandu Gopan

Dear Friends,

I downloaded and reinstalled MPICH2. Then changed the path and linking
variables.When i make LAMMPS, I get the following error(s). Is it
because of some unmet dependency?

make[1]: Entering directory `/home/nandu/Desktop/lammps/src/Obj_purna'
/home/nandu/Desktop/openmpi/prefix/bin/mpicc -O
-L/home/nandu/mpich2-install/lib -L/home/nandu/Desktop/fftw/prefix/lib
angle_charmm.o angle_cosine.o angle_cosine_delta.o
angle_cosine_squared.o angle.o ......... region_intersect.o
region_plane.o region_prism.o region_sphere.o region_union.o remap.o
remap_wrap.o replicate.o respa.o run.o set.o shell.o special.o
temper.o thermo.o timer.o universe.o update.o variable.o velocity.o
verlet.o write_restart.o -lmpich -lpthread -lstdc++ -o ../lmp_purna

you are compiling with the mpicc wrapper that comes with
openmpi yet are linking to the libraries from MPICH.
this _cannot_ work. you must use only one package consistently.

cheers,
    axel.

Thanks Axel,
That solved the issue. Now the compilation is happening…:slight_smile:

Regards,
Nandu Gopan