Commit 44bc2209 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r7081] Experimental support for inter-library dependencies. This allows users

to just link with libmpich.so, and the remaining libraries are
dynamically loaded. This support is only for shared libraries at this
point (static library support might require libtool). Also, this is
experimental, as it has a bunch of gotchas that we cannot handle
unless we reimplement libtool.

Reviewed by goodell.
parent a203714e
# -*- Mode: makefile; -*-
SUBDIRS = . @EXTERNAL_SRC_DIRS@ src examples
SUBDIRS = . @EXTERNAL_SRC_DIRS@ src
# Do not include test in the basic build.
OTHER_DIRS = test
OTHER_DIRS = test examples
DOC_SUBDIRS = doc
# The all-local target makes sure that when different subsystems are selected
# for the configure step, the libraries are removed and the object files
......@@ -74,6 +74,7 @@ all-preamble:
# 1) Build the debugger interface if requested
# Move the "pkglist.new" file to "pkglist" on successful completion
all-postamble:
( cd examples && $(MAKE) )
@if [ "@BUILD_TVDLL@" = "yes" ] ; then \
( cd src/mpi/debugger && $(MAKE) ./libtvmpich2.@SHLIB_EXT@ ) ; fi
@if [ -s lib/pkglist.new ] ; then mv -f lib/pkglist.new lib/pkglist ; fi
......@@ -148,9 +149,10 @@ optinstall_LIB = lib/lib${MPIFWRAPNAME}.a
# UNUSED, example for experimentation only
#lib${MPILIBNAME}_so_EXPORTS = maint/mpi.def
#libf${MPILIBNAME}_so_EXPORTS = maint/fmpi.def
libf${MPILIBNAME}_so_LIBS = -L. -l$(MPILIBNAME)
lib${MPILIBNAME}f90_so_LIBS = -L. -l$(MPILIBNAME)
lib${MPICXXLIBNAME}_so_LIBS = -L. -l$(MPILIBNAME)
lib${MPILIBNAME}_so_LIBS = -L. @LIB_DEPS@
libf${MPILIBNAME}_so_LIBS = -L. -l$(MPILIBNAME) @LIB_DEPS@
lib${MPILIBNAME}f90_so_LIBS = -L. -l$(MPILIBNAME) @LIB_DEPS@
lib${MPICXXLIBNAME}_so_LIBS = -L. -l$(MPILIBNAME) @LIB_DEPS@
install_INCLUDE = src/include/mpi.h
......
......@@ -250,9 +250,9 @@ PAC_PREFIX_ALL_FLAGS(USER)
# functionality (such as -lpthread) should be added to LIBS so
# autoconf link tests can use them. Libraries that are built by MPICH2
# at make time (and hence are not available for autoconf link tests to
# use), such as OPA and MPL, should be added to WRAPPER_LIBS. All
# libraries in LIBS are added to WRAPPER_LIBS as well, at the end of
# configure.
# use), such as OPA and MPL, should be added to WRAPPER_LIBS for
# static builds. All libraries in LIBS are added to WRAPPER_LIBS as
# well, at the end of configure.
PAC_PREFIX_ALL_FLAGS(WRAPPER)
WRAPPER_CFLAGS="$CFLAGS $MPICH2_MPICC_FLAGS"
WRAPPER_CPPFLAGS="$CPPFLAGS $MPICH2_MPICPP_FLAGS"
......@@ -260,7 +260,7 @@ WRAPPER_CXXFLAGS="$CXXFLAGS $MPICH2_MPICXX_FLAGS"
WRAPPER_FFLAGS="$FFLAGS $MPICH2_MPIF77_FLAGS"
WRAPPER_FCFLAGS="$FCFLAGS $MPICH2_MPIFC_FLAGS"
WRAPPER_LDFLAGS="$LDFLAGS $MPICH2_LDFLAGS"
WRAPPER_LIBS="$LIBS $MPICH2_LIBS"
WRAPPER_LIBS="$MPICH2_LIBS"
# Add MPICH2LIB_* to the appropriate flags
AC_ARG_VAR(MPICH2LIB_CFLAGS, [extra CFLAGS used in building MPICH2 libraries])
......@@ -285,6 +285,11 @@ PAC_ARG_CACHING
# it may influence the output of the other tests
PAC_ARG_STRICT
# Experimental library dependencies for shared libraries
AC_ARG_ENABLE(lib-depend,
[AC_HELP_STRING(--enable-lib-depend - Turn on library dependencies (experimental))],
enable_lib_depend=$enableval,enable_lib_depend=no)
AC_ARG_ENABLE(echo,
[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
dnl
......@@ -6317,6 +6322,12 @@ AC_DEFINE(HAVE_MPICHCONF,1,[Define so that we can test whether the mpichconf.h f
# Add the LIBS we got so far to WRAPPER_LIBS
WRAPPER_LIBS="$WRAPPER_LIBS $LIBS"
LIB_DEPS=""
if test "$ENABLE_SHLIB" != "none" -a "$enable_lib_depend" = "yes" ; then
LIB_DEPS="$WRAPPER_LIBS"
WRAPPER_LIBS=""
fi
AC_SUBST(LIB_DEPS)
if test "$USE_PMI2_API" = "yes" ; then
AC_DEFINE(USE_PMI2_API, 1, [Define if PMI2 API must be used])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment