Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork

2018-06-22 Thread Jeff Squyres (jsquyres) via devel
Can you send all the information listed here:

https://www.open-mpi.org/community/help/


> On Jun 22, 2018, at 4:44 PM, lille stor  wrote:
> 
> 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)" 
> To: "lille stor" 
> Cc: "Open MPI Developers List" 
> Subject: Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork
> On Jun 22, 2018, at 4:09 PM, lille stor  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
>  


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

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


Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork

2018-06-22 Thread lille stor

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)" 
To: "lille stor" 
Cc: "Open MPI Developers List" 
Subject: Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork

On Jun 22, 2018, at 4:09 PM, lille stor  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
 



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

Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork

2018-06-22 Thread Jeff Squyres (jsquyres) via devel
On Jun 22, 2018, at 4:09 PM, lille stor  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

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


Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork

2018-06-22 Thread lille stor

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" 
To: "Open MPI Developers List" 
Cc: "Jeff Squyres (jsquyres)" 
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  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

Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork

2018-06-22 Thread Jeff Squyres (jsquyres) via devel
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  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


Re: [OMPI devel] Open MPI: Undefined reference to pthread_atfork

2018-06-22 Thread r...@open-mpi.org
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  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

[OMPI devel] Open MPI: Undefined reference to pthread_atfork

2018-06-22 Thread lille stor

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