Hi Jeff,
 
Thanks for the feedback.
 
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.
 
Any other sugestions on to solve this issue?
 
Thank you,
 
L.
 
 
 
 
Sent: Friday, June 22, 2018 at 9:57 PM
From: "Jeff Squyres (jsquyres) via devel" <devel@lists.open-mpi.org>
To: "Open MPI Developers List" <devel@lists.open-mpi.org>
Cc: "Jeff Squyres (jsquyres)" <jsquy...@cisco.com>
Subject: Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork
I think Ralph is a little confused -- 2.1.3 is recent enough. :-)

Are you using "mpic++" to compile your application? That should add in all the relevant flags that are needed to compile an Open MPI C++ application.


> On Jun 22, 2018, at 3:29 PM, r...@open-mpi.org wrote:
>
> OMPI 2.1.3??? Is there any way you could update to something more recent?
>
>> On Jun 22, 2018, at 12:28 PM, lille stor <lille.s...@gmx.com> wrote:
>>
>> Hi,
>>
>>
>> When compiling a C++ source file named test.cpp that needs a shared library named libUtils.so (which in its turn needs Open MPI shared library, hence the parameter -Wl,-rpath-link,/home/dummy/openmpi/build/lib ) as follows:
>>
>> g++ test.cpp -lUtils -Wl,-rpath-link,/home/dummy/openmpi/build/lib
>> An error is thrown /home/dummy/openmpi/build/lib/libopen-pal.so.20: undefined reference to pthread_atfork.
>>
>> I passed -pthread and -lpthread (before and after -lUtils) to g++ but none of these solved the error.
>>
>>
>> Environment where this error is thrown:
>>
>> OS: Ubuntu 14.04
>> Compiler: g++ 4.9
>> MPI: Open MPI 2.1.3
>>
>> Thank you for your help,
>>
>> L.
>>
>>
>> _______________________________________________
>> devel mailing list
>> devel@lists.open-mpi.org
>> https://lists.open-mpi.org/mailman/listinfo/devel
>
> _______________________________________________
> devel mailing list
> devel@lists.open-mpi.org
> https://lists.open-mpi.org/mailman/listinfo/devel


--
Jeff Squyres
jsquy...@cisco.com

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

Reply via email to