Hi,

 

I have successfully built Open MPI version 2.1.3 from scratch in Ubuntu 14.04 64 bit and using GCC 4.9. The result was the following shared libraries (needed for a program to use Open MPI):

        dummy@machine:~/$ ldd /home/dummy/openmpi/build/lib/libmpi.so /home/dummy/openmpi/build/lib/libopen-rte.so /home/dummy/openmpi/build/lib/libopen-pal.so

        /home/dummy/openmpi/build/lib/libmpi.so:
        linux-vdso.so.1 =>  (0x00007ffecfb87000)
        libopen-rte.so.20 => not found
        libopen-pal.so.20 => not found
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fcc99058000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcc98d51000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fcc98b33000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcc9876a000)
        /lib64/ld-linux-x86-64.so.2 (0x00005574ed2b8000)

        /home/dummy/openmpi/build/lib/libopen-rte.so:
        linux-vdso.so.1 =>  (0x00007ffc99743000)
        libopen-pal.so.20 => not found
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff6f498f000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff6f45c6000)
        /lib64/ld-linux-x86-64.so.2 (0x00005622db738000)

        /home/dummy/openmpi/build/lib/libopen-pal.so:
        linux-vdso.so.1 =>  (0x00007ffdfc374000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f46b6bb5000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f46b69ad000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f46b67aa000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f46b63e0000)
        /lib64/ld-linux-x86-64.so.2 (0x000055eca0708000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f46b61c2000)
 
 
Now, when I try to compile a small program with g++ version 4.9 using Open MPI shared library it fails with an /home/dummy/openmpi/build/lib/libopen-pal.so: undefined reference to pthread_atfork error. The small program is the following:


        #include <stdio.h>
        #include "mpi.h"

        int main(void)
        {
                MPI_Comm comm;
                int rank;

                MPI_Comm_rank(comm, &rank);
                printf("<%d>\n", rank);

                return 0;
        }

 

The compilation statement is:

        g++ test.c -pthread -I/home/dummy/openmpi/build/include -L/home/dummy/openmpi/build/lib -lmpi -lopen-rte -lopen-pal


Any idea why g++ (i.e. C++ compiler) is throwing the aforementioned error? FYI, when I compile the same program with gcc (i.e. C compiler) it works perfectly.

 

Thank you,

L.

_______________________________________________
users mailing list
users@lists.open-mpi.org
https://lists.open-mpi.org/mailman/listinfo/users

Reply via email to