undefined reference to `moab::ParallelComm::ParallelComm

Issue #21 resolved
Nico Schlömer created an issue

When linking a simple MOAB test code with parallel I/O (HelloMOABPar or whatever it's called), I'm getting

Scanning dependencies of target mytest
[100%] Building CXX object CMakeFiles/mytest.dir/main.cpp.o
Linking CXX executable mytest
CMakeFiles/mytest.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x192): undefined reference to `moab::ParallelComm::ParallelComm(moab::Interface*, int, int*)'
collect2: error: ld returned 1 exit status
CMakeFiles/mytest.dir/build.make:98: recipe for target 'mytest' failed
make[2]: *** [mytest] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/mytest.dir/all' failed
make[1]: *** [CMakeFiles/mytest.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2

on the Debian install. I'm not sure what might have gone wrong here.

Comments (2)

  1. Nico Schlömer reporter

    Digging a little further, I see the symbols actually present in the library:

    nm -DC /opt/moab/lib/libMOAB.so | grep ParallelComm::ParallelComm
    00000000005a5a56 T moab::ParallelComm::ParallelComm(moab::Interface*, ompi_communicator_t*, int*)
    00000000005a5d6c T moab::ParallelComm::ParallelComm(moab::Interface*, std::vector<unsigned char, std::allocator<unsigned char> >&, ompi_communicator_t*, int*)
    00000000005a5a56 T moab::ParallelComm::ParallelComm(moab::Interface*, ompi_communicator_t*, int*)
    00000000005a5d6c T moab::ParallelComm::ParallelComm(moab::Interface*, std::vector<unsigned char, std::allocator<unsigned char> >&, ompi_communicator_t*, int*)
    

    Could there be a discrepancy between int and ompi_communicator_t*?

  2. Nico Schlömer reporter

    Ah, okay. I need to compile the application code with and MPI compiler, too, of course. Closing.

  3. Log in to comment