From f272dd31e699d9a806ce900c2e4994bd03d5b68b Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 28 May 2015 08:52:52 -0700 Subject: [PATCH] mpi-f: link the opal-pal.la library directly libmpi_mpifh.la makes some direct calls to libopen-pal.la. In many (most?) cases, having libmpi_mpifh link against libmpi is sufficient (because libmpi pulls in libopen-pal). But when building RPMs on SLES, some compiler/linker flags are used that seem to make this implicit linking not sufficient -- we get missing opal symbols when creating libmpi_mpifh.la. So link in open-pal directly (vs. indirectly), which solves the problem. --- ompi/mpi/fortran/mpif-h/Makefile.am | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ompi/mpi/fortran/mpif-h/Makefile.am b/ompi/mpi/fortran/mpif-h/Makefile.am index caad0fae3ef..effaba22ee4 100644 --- a/ompi/mpi/fortran/mpif-h/Makefile.am +++ b/ompi/mpi/fortran/mpif-h/Makefile.am @@ -9,7 +9,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. -# Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. # Copyright (c) 2011-2013 Inria. All rights reserved. # Copyright (c) 2011-2013 Universite Bordeaux 1 # Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights @@ -55,7 +55,14 @@ AM_CPPFLAGS = -DOMPI_PROFILE_LAYER=0 -DOMPI_COMPILING_FORTRAN_WRAPPERS=1 lib_LTLIBRARIES = CLEANFILES = -libmpi_mpifh_la_LIBADD = $(top_builddir)/ompi/libmpi.la $(OMPI_MPIEXT_MPIFH_LIBS) +# Note that we invoke some OPAL functions directly in libmpi_mpifh.la, +# so we need to link in the OPAL library directly (pulling it in +# indirectly via libmpi.la does not work on all platforms). +libmpi_mpifh_la_LIBADD = \ + $(top_builddir)/ompi/libmpi.la \ + $(OMPI_MPIEXT_MPIFH_LIBS) \ + $(OMPI_TOP_BUILDDIR)/opal/lib@OPAL_LIB_PREFIX@open-pal.la + libmpi_mpifh_la_LDFLAGS = -version-info $(libmpi_mpifh_so_version) # Are we building the mpif.h bindings at all?