[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mixing LDFLAGS/inherited_linker_flags between languages/compilers

From: Jeff Squyres
Subject: Mixing LDFLAGS/inherited_linker_flags between languages/compilers
Date: Wed, 1 Apr 2009 17:10:23 -0400

Greetings! Here's another from-the-wild Libtool report from the Open MPI project.

As was recently reported on our users mailing list (thread started here: http://www.open-mpi.org/community/lists/users/2009/03/8613.php), we have a situation where a user is trying to use the following compiler set: gcc, g++, pgf77, pgf90. gcc and g++ understand the "- pthread" command line switch, but pgf77 and pgf90 do not. I've CC'ed the original reported on this mail.

Open MPI builds a few C support libraries; one of them is libmpi.la (completely built with gcc). In libmpi.la, I can see a field containing -lpthread:

inherited_linker_flags=' -pthread'

Then Open MPI builds an F90-based library, libmpi_f90.la. This library links against libmpi.la via the following:

libmpi_f90_la_LIBADD = $(top_builddir)/ompi/libmpi.la

Libtool therefore pulls in $inherited_linker_flags from libmpi.la; when it tries to use the F90 compiler to make the final link of the libmpi_f90.la library, it fails because pgf90 does not understand the - pthread switch. Specifically, Open MPI's Makefile.am ends up issuing the following command:

/bin/sh ../../../libtool --mode=link pgf90 -I../../../ompi/include - I../../../ompi/include -I. -I. -I../../../ompi/mpi/f90 -export-dynamic -o libmpi_f90.la -rpath /home/jsquyres/bogus/lib mpi.lo mpi_sizeof.lo mpi_comm_spawn_multiple_f90.lo mpi_testall_f90.lo mpi_testsome_f90.lo mpi_waitall_f90.lo mpi_waitsome_f90.lo mpi_wtick_f90.lo mpi_wtime_f90.lo ../../../ompi/libmpi.la -lnsl -lutil -lm

(note the lack of -pthread)

which then translates to:

pgf90 -shared -fpic -Mnomain .libs/mpi.o .libs/mpi_sizeof.o .libs/ mpi_comm_spawn_multiple_f90.o .libs/mpi_testall_f90.o .libs/ mpi_testsome_f90.o .libs/mpi_waitall_f90.o .libs/ mpi_waitsome_f90.o .libs/mpi_wtick_f90.o .libs/mpi_wtime_f90.o -Wl,- rpath -Wl,/users/jsquyres/svn/ompi/ompi/.libs -Wl,-rpath -Wl,/users/ jsquyres/svn/ompi/orte/.libs -Wl,-rpath -Wl,/users/jsquyres/svn/ompi/ opal/.libs -Wl,-rpath -Wl,/home/jsquyres/bogus/lib -L/users/jsquyres/ svn/ompi/orte/.libs -L/users/jsquyres/svn/ompi/opal/.libs ../../../ ompi/.libs/libmpi.so /users/jsquyres/svn/ompi/orte/.libs/libopen- rte.so /users/jsquyres/svn/ompi/opal/.libs/libopen-pal.so -ldl -lnsl - lutil -lm -pthread -Wl,-soname -Wl,libmpi_f90.so.0 -o .libs/ libmpi_f90.so.0.0.0

(note the addition of -pthread)

Is there anything that can be done about this, perchance? I'm not quite sure what the proper fix would be, but I thought I'd ask anyway...

Jeff Squyres
Cisco Systems

reply via email to

[Prev in Thread] Current Thread [Next in Thread]