Thanks again Jeff.
Here is the output of running "mpic++" with parameter "--showme" (in bold what "mpic++" added):
g++ test.cpp -lUtils -pthread -Wl,-rpath -Wl,/home/dummy/openmpi/build/lib -Wl,--enable-new-dtags -L/home/dummy/openmpi/build/lib -lmpi
This fails to compile with the error "Undefined reference to pthread_atfork".
Nonetheless, if a program uses directly "libmpi.so" it can be compiled successfully with the parameters "-L/home/dummy/openmpi/build/lib -lmpi" like you suggested in a previous email).
The problem is that the program I am trying to compile does not use directly "libmpi.so" but through the library "libMyUtils.so". This makes the usage of parameters "-L/home/dummy/openmpi/build/lib -lmpi" not possible.
Any more suggestions?
Thanks,
L.
Sent: Friday, June 22, 2018 at 10:17 PM
From: "Jeff Squyres (jsquyres)" <jsquy...@cisco.com>
To: "lille stor" <lille.s...@gmx.com>
Cc: "Open MPI Developers List" <devel@lists.open-mpi.org>
Subject: Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork
From: "Jeff Squyres (jsquyres)" <jsquy...@cisco.com>
To: "lille stor" <lille.s...@gmx.com>
Cc: "Open MPI Developers List" <devel@lists.open-mpi.org>
Subject: Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork
On Jun 22, 2018, at 4:09 PM, lille stor <lille.s...@gmx.com> wrote:
>
> I tried compile the C++ program using "mpic++" like you suggested but unfortunately g++ still throws the same errror ("/home/dummy/openmpi/build/lib/libopen-pal.so.20: undefined reference to pthread_atfork").
>
> I suspect that the problem maybe to the fact that the C++ program does not use directly Open MPI library but through another library (hence the parameter "-Wl,-rpath-link,/home/dummy/openmpi/build/lib" when compiling it), therefore one cannot pass the usual parameters "-L/home/dummy/openmpi/build/lib -lmpi" to g++. To summarize the dependency flow: program -> library -> Open MPI library.
If your program uses mpic++ instead of g++, then mpic++ should add all the relevant parameters to compile an Open MPI program (including, if necessary, -pthread or -lpthread).
What does "mpic++ --showme" show?
Can you compile a simple C or C++ MPI program manually? (using mpicc / mpic++, without going through the secondary program)
--
Jeff Squyres
jsquy...@cisco.com
>
> I tried compile the C++ program using "mpic++" like you suggested but unfortunately g++ still throws the same errror ("/home/dummy/openmpi/build/lib/libopen-pal.so.20: undefined reference to pthread_atfork").
>
> I suspect that the problem maybe to the fact that the C++ program does not use directly Open MPI library but through another library (hence the parameter "-Wl,-rpath-link,/home/dummy/openmpi/build/lib" when compiling it), therefore one cannot pass the usual parameters "-L/home/dummy/openmpi/build/lib -lmpi" to g++. To summarize the dependency flow: program -> library -> Open MPI library.
If your program uses mpic++ instead of g++, then mpic++ should add all the relevant parameters to compile an Open MPI program (including, if necessary, -pthread or -lpthread).
What does "mpic++ --showme" show?
Can you compile a simple C or C++ MPI program manually? (using mpicc / mpic++, without going through the secondary program)
--
Jeff Squyres
jsquy...@cisco.com
_______________________________________________ devel mailing list devel@lists.open-mpi.org https://lists.open-mpi.org/mailman/listinfo/devel