Fortran examples not building
I built MOAB from source. When I compile the examples, the fortran codes exit with error
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
iMesh_MOAB.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[_ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb]+0x13): undefined reference to
ompi_mpi_cxx_op_intercept'
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const':
iMesh_MOAB.cpp:(.text._ZNK3MPI9Intracomm12Create_graphEiPKiS2_b[_ZNK3MPI9Intracomm12Create_graphEiPKiS2_b]+0x28): undefined reference to
MPI::Comm::Comm()'
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function MPI::Graphcomm::Clone() const':
iMesh_MOAB.cpp:(.text._ZNK3MPI9Graphcomm5CloneEv[_ZNK3MPI9Graphcomm5CloneEv]+0x25): undefined reference to
MPI::Comm::Comm()'
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function MPI::Cartcomm::Clone() const':
iMesh_MOAB.cpp:(.text._ZNK3MPI8Cartcomm5CloneEv[_ZNK3MPI8Cartcomm5CloneEv]+0x25): undefined reference to
MPI::Comm::Comm()'
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function MPI::Intercomm::Merge(bool) const':
iMesh_MOAB.cpp:(.text._ZNK3MPI9Intercomm5MergeEb[_ZNK3MPI9Intercomm5MergeEb]+0x25): undefined reference to
MPI::Comm::Comm()'
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function MPI::Intracomm::Split(int, int) const':
iMesh_MOAB.cpp:(.text._ZNK3MPI9Intracomm5SplitEii[_ZNK3MPI9Intracomm5SplitEii]+0x26): undefined reference to
MPI::Comm::Comm()'
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o):iMesh_MOAB.cpp:(.text._ZNK3MPI9Intracomm6CreateERKNS_5GroupE[_ZNK3MPI9Intracomm6CreateERKNS_5GroupE]+0x27): more undefined references to MPI::Comm::Comm()' follow
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o):(.rodata._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to
MPI::Datatype::Free()'
/home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o):(.rodata._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
collect2: error: ld returned 1 exit status
make: *** [DirectAccessNoHolesF90] Error 1
Comments (11)
-
-
reporter Sorry about the limited information. I pulled directly from source.
commit e2a0a9c94204a6390164cfa027749cbb7f16c391 Author: Vijay Mahadevan vijay.m@gmail.com Date: Thu Jan 12 17:44:13 2017 +0530
Silence several debug outputs during UMR hierarchy generation
I configured using
FC=mpif90 F77=mpif90 CXX=mpic++ CC=mpicc ./configure --prefix=/home/vikram/usr/local/moab --enable-docs --with-mpi --download-hdf5 --with-metis=/home/vikram/usr/local/metis --with-parmetis=/home/vikram/usr/local/parmetis --with-zoltan=/home/vikram/usr/local/Zoltan
After installing I simply do
make examples
and I get this error. This only happens with the Fortran examples, the C++ examples seem to build fine.
This is an Linux Mint 17.3 machine with gcc 4.8.4.
-
What do you mean by "make examples"? Did you try
make run
in your examples folder?
Can you show us the output of command
make V=1 PushParMeshIntoMoabF90
in examples folder?
also the output of
make V=1 HelloMOAB
and
mpif90 -show and mpicxx -showthanks!
-
reporter I mean I simply did make in the examples folder. Sorry for the confusion. Here's the output of all the commands.
make V=1 PushParMeshIntoMoabF90 mpif90 -ftree-vectorize -O2 -fcray-pointer -I/home/vikram/usr/local/moab/include -isystem /home/vikram/usr/local/moab/include -I/home/vikram/usr/local/moab -I/home/vikram/usr/local/moab/include -isystem /home/vikram/usr/local/moab/include -I/home/vikram/usr/local/moab -I/home/vikram/usr/local/moab/include -DTEMPLATE_SPECIALIZATION -DTEMPLATE_FUNC_SPECIALIZATION -DMESH_DIR=\""/home/vikram/Downloads/Installs/src/moab/MeshFiles/unittest"\" -c PushParMeshIntoMoabF90.F90 mpif90 -o PushParMeshIntoMoabF90 PushParMeshIntoMoabF90.o -L/home/vikram/usr/local/parmetis/lib -L/home/vikram/usr/local/metis/lib -L/home/vikram/usr/local/Zoltan/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -liMesh -lMOAB -lhdf5 -lz -lz -lz -ldl -lm -lm -lm -lzoltan -lparmetis -lmetis -lstdc++ -lz -ldl -lm -lm -lm /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)': iMesh_MOAB.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[_ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb]+0x13): undefined reference to `ompi_mpi_cxx_op_intercept' /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function `MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const': iMesh_MOAB.cpp:(.text._ZNK3MPI9Intracomm12Create_graphEiPKiS2_b[_ZNK3MPI9Intracomm12Create_graphEiPKiS2_b]+0x28): undefined reference to `MPI::Comm::Comm()' /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function `MPI::Graphcomm::Clone() const': iMesh_MOAB.cpp:(.text._ZNK3MPI9Graphcomm5CloneEv[_ZNK3MPI9Graphcomm5CloneEv]+0x25): undefined reference to `MPI::Comm::Comm()' /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function `MPI::Cartcomm::Clone() const': iMesh_MOAB.cpp:(.text._ZNK3MPI8Cartcomm5CloneEv[_ZNK3MPI8Cartcomm5CloneEv]+0x25): undefined reference to `MPI::Comm::Comm()' /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function `MPI::Intercomm::Merge(bool) const': iMesh_MOAB.cpp:(.text._ZNK3MPI9Intercomm5MergeEb[_ZNK3MPI9Intercomm5MergeEb]+0x25): undefined reference to `MPI::Comm::Comm()' /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o): In function `MPI::Intracomm::Split(int, int) const': iMesh_MOAB.cpp:(.text._ZNK3MPI9Intracomm5SplitEii[_ZNK3MPI9Intracomm5SplitEii]+0x26): undefined reference to `MPI::Comm::Comm()' /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o):iMesh_MOAB.cpp:(.text._ZNK3MPI9Intracomm6CreateERKNS_5GroupE[_ZNK3MPI9Intracomm6CreateERKNS_5GroupE]+0x27): more undefined references to `MPI::Comm::Comm()' follow /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o):(.rodata._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()' /home/vikram/usr/local/moab/lib/libiMesh.a(iMesh_MOAB.o):(.rodata._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()' collect2: error: ld returned 1 exit status make: *** [PushParMeshIntoMoabF90] Error 1
make V=1 HelloMOAB mpic++ -ftree-vectorize -O2 -DNDEBUG -I/home/vikram/usr/local/moab/include -isystem /home/vikram/usr/local/moab/include -I/home/vikram/usr/local/moab -I/home/vikram/usr/local/moab/include -DMESH_DIR=\""/home/vikram/Downloads/Installs/src/moab/MeshFiles/unittest"\" -c HelloMOAB.cpp mpic++ -o HelloMOAB HelloMOAB.o -L/home/vikram/usr/local/parmetis/lib -L/home/vikram/usr/local/metis/lib -L/home/vikram/usr/local/Zoltan/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -lMOAB -lhdf5 -lz -lz -lz -ldl -lm -lm -lm -lzoltan -lparmetis -lmetis -lz -ldl -lm -lm -lm
mpif90 -show gfortran -I/usr/lib/openmpi/include -pthread -I/usr/lib/openmpi/lib -L/usr/lib -L/usr/lib/openmpi/lib -lmpi_f90 -lmpi_f77 -lmpi -ldl -lhwloc
mpicxx -show g++ -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -L/usr/lib -L/usr/lib/openmpi/lib -lmpi_cxx -lmpi -ldl -lhwloc
-
How did you install openmpi, with a package manager or did you build yourself?
for fortran example, can you try adding -lmpi_cxx to your command? Something like this:
mpif90 -o PushParMeshIntoMoabF90 PushParMeshIntoMoabF90.o -L/home/vikram/usr/local/parmetis/lib -L/home/vikram/usr/local/metis/lib -L/home/vikram/usr/local/Zoltan/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -L/home/vikram/usr/local/moab/lib -liMesh -lMOAB -lhdf5 -lz -lz -lz -ldl -lm -lm -lm -lzoltan -lparmetis -lmetis -lstdc++ -lz -ldl -lm -lm -lm -lmpi_cxx -lmpi -ldl -lhwloc
Does "make check" work for you in itaps/imesh folder? There are some fortran examples there that should build too; and a fortran example in test folder
In general, make check should work
-
reporter Yeah, I am using openmpi from the package manager.
The compilation works if I add
-lmpi_cxx
at the end. I get the same errors in the imesh folder and I guess a similar fix will apply there as well.
Thanks.
-
OK, thanks; we do not test on your platform and your configuration;
Although, it should work ; the MOAB library depends on mpi library, but it should depend on mpi c library, not on mpi c++ (mpi c++ is obsolete, and we are not using in moab library MPI c++ calls, only MPI C calls. )
I am not sure what is the correct fix, Vijay might have ideas
Thanks
-
@vsingh001 Sorry about the very late reply. I don't see why we need MPI C++ interfaces in MOAB. I'm wondering whether this is showing up through your Zoltan installation. Can you verify ?
Perhaps if you look into libZoltan.la or its configuration, it can provide more clues.
-
I'm not sure whether this should still be an open issue. @vsingh001 let us know if you've upgraded to the newest versions of the platform/source code and if the problem persists.
-
reporter I can close this if you want. I did not follow up, but am not using MOAB anymore.
-
- changed status to wontfix
User no longer interested in a solution for the issue.
- Log in to comment
what source, what configuration command? what platform? It looks like you are linking against a C++ MPI library. What implementation? How can we reproduce your issue ?
We have several builds on MOAB, check this buildbot server.
http://gnep.mcs.anl.gov:8010/
most of them have fortran enabled