Commit 90100837 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

Cleaned up the management of wrapper flags in MPICH.



This includes several changes:

1. Merged WRAPPER and EXTERNAL LIBS.  There is no reason to maintain
two names for these flags.  These are eventually appended and added to
the compiler wrappers anyway.

2. Updated mpicc and friend to add the necessary flags directly
instead of trying to merge these flags in configure.
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
parent 4d93cefa
......@@ -49,7 +49,7 @@ errnames_txt_files =
external_subdirs = @mplsrcdir@ @opasrcdir@
external_ldflags = @mpllibdir@ @opalibdir@
external_libs = @EXTERNAL_LIBS@
external_libs = @WRAPPER_LIBS@
mpi_convenience_libs =
pmpi_convenience_libs = @mpllib@ @opalib@
......
......@@ -297,11 +297,11 @@ them. This is a temporary hack for certain cases that advanced
developers might be interested in, but which break existing configure
tests (e.g., -Werror). These are NOT recommended for regular users.
(d) MPICH_MPICC_FLAGS, MPICH_MPICPP_FLAGS, MPICH_MPICXX_FLAGS,
MPICH_MPIFC_FLAGS, MPICH_LDFLAGS and MPICH_LIBS (abbreviated as
MPICH_MPIX_FLAGS): These flags do *not* affect the compilation of the
MPICH library itself, but will be internally used by mpicc and
friends.
(d) MPICH_MPICC_CFLAGS, MPICH_MPICC_CPPFLAGS, MPICH_MPICC_LDFLAGS,
MPICH_MPICC_LIBS, and so on for MPICXX, MPIF77 and MPIFORT
(abbreviated as MPICH_MPIX_FLAGS): These flags do *not* affect the
compilation of the MPICH library itself, but will be internally used
by mpicc and friends.
+--------------------------------------------------------------------+
......
......@@ -269,21 +269,39 @@ PAC_PREFIX_ALL_FLAGS(USER)
# as include paths).
#
# All libraries that are detected by MPICH as needed for some of its
# functionality (such as -lpthread) should be added to EXTERNAL_LIBS
# functionality (such as -lpthread) should be added to WRAPPER_LIBS
# so executables built within MPICH use them. If inter-library
# dependencies are not supported on the platform, these libraries are
# added to the MPICH wrappers (mpicc and friends) as well.
PAC_PREFIX_ALL_FLAGS(WRAPPER)
WRAPPER_CFLAGS="$CFLAGS $MPICH_MPICC_FLAGS"
WRAPPER_CPPFLAGS="$CPPFLAGS $MPICH_MPICPP_FLAGS"
WRAPPER_CXXFLAGS="$CXXFLAGS $MPICH_MPICXX_FLAGS"
WRAPPER_FFLAGS="$FFLAGS $MPICH_MPIF77_FLAGS"
WRAPPER_FCFLAGS="$FCFLAGS $MPICH_MPIFC_FLAGS"
WRAPPER_LDFLAGS="$MPICH_LDFLAGS"
WRAPPER_LIBS="$MPICH_LIBS"
EXTERNAL_LIBS=""
export EXTERNAL_LIBS
AC_SUBST(EXTERNAL_LIBS)
AC_SUBST(WRAPPER_CFLAGS)
AC_SUBST(WRAPPER_CPPFLAGS)
AC_SUBST(WRAPPER_CXXFLAGS)
AC_SUBST(WRAPPER_FFLAGS)
AC_SUBST(WRAPPER_FCFLAGS)
AC_SUBST(WRAPPER_LDFLAGS)
AC_SUBST(WRAPPER_LIBS)
# MPICH_MPIx_FLAGS are used by mpicc and friends. They are like
# WRAPPER flags, but these are provided by the user.
AC_SUBST(MPICH_MPICC_CPPFLAGS)
AC_SUBST(MPICH_MPICC_CFLAGS)
AC_SUBST(MPICH_MPICC_LDFLAGS)
AC_SUBST(MPICH_MPICC_LIBS)
AC_SUBST(MPICH_MPICXX_CPPFLAGS)
AC_SUBST(MPICH_MPICXX_CXXFLAGS)
AC_SUBST(MPICH_MPICXX_LDFLAGS)
AC_SUBST(MPICH_MPICXX_LIBS)
AC_SUBST(MPICH_MPIF77_CPPFLAGS)
AC_SUBST(MPICH_MPIF77_FFLAGS)
AC_SUBST(MPICH_MPIF77_LDFLAGS)
AC_SUBST(MPICH_MPIF77_LIBS)
AC_SUBST(MPICH_MPIFORT_CPPFLAGS)
AC_SUBST(MPICH_MPIFORT_FCFLAGS)
AC_SUBST(MPICH_MPIFORT_LDFLAGS)
AC_SUBST(MPICH_MPIFORT_LIBS)
# Add MPICHLIB_* to the appropriate flags
AC_ARG_VAR(MPICHLIB_CFLAGS,
......@@ -1171,7 +1189,7 @@ else
AS_IF([test -s "${with_mpl_prefix}/include/mplconfig.h"],
[:],[AC_MSG_ERROR([the MPL installation in "${with_mpl_prefix}" appears broken])])
PAC_APPEND_FLAG([-I${with_mpl_prefix}/include],[CPPFLAGS])
PAC_PREPEND_FLAG([-l${MPLLIBNAME}],[EXTERNAL_LIBS])
PAC_PREPEND_FLAG([-l${MPLLIBNAME}],[WRAPPER_LIBS])
PAC_APPEND_FLAG([-L${with_mpl_prefix}/lib],[WRAPPER_LDFLAGS])
mpllibdir="-L${with_mpl_prefix}/lib"
fi
......@@ -1235,7 +1253,7 @@ if test "$with_openpa_prefix" = "embedded" ; then
AC_MSG_WARN([Attempted to use the embedded OpenPA source tree in "src/openpa", but it is missing. Configuration or compilation may fail later.])
fi
elif test "$with_openpa_prefix" = "system" ; then
PAC_PREPEND_FLAG([-l${OPALIBNAME}],[EXTERNAL_LIBS])
PAC_PREPEND_FLAG([-l${OPALIBNAME}],[WRAPPER_LIBS])
elif test "$with_openpa_prefix" = "no" ; then
# The user doesn't want to use OPA. This may or may not cause MPICH to
# fail to configure/build, depending on many other factors.
......@@ -1246,7 +1264,7 @@ else
AS_IF([test -s "${with_openpa_prefix}/include/opa_primitives.h" -a -s "${with_openpa_prefix}/include/opa_config.h"],
[:],[AC_MSG_ERROR([the OpenPA installation in "${with_openpa_prefix}" appears broken])])
PAC_APPEND_FLAG([-I${with_openpa_prefix}/include],[CPPFLAGS])
PAC_PREPEND_FLAG([-l${OPALIBNAME}],[EXTERNAL_LIBS])
PAC_PREPEND_FLAG([-l${OPALIBNAME}],[WRAPPER_LIBS])
if test -d ${with_openpa_prefix}/lib64 ; then
PAC_APPEND_FLAG([-L${with_openpa_prefix}/lib64],[WRAPPER_LDFLAGS])
opalibdir="-L${with_openpa_prefix}/lib64"
......@@ -5331,7 +5349,6 @@ case $with_thread_package in
AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
if test "$have_pthreads" = "yes" ; then
PAC_PREPEND_FLAG([-lpthread],[LIBS])
PAC_PREPEND_FLAG([-lpthread],[EXTERNAL_LIBS])
fi
AC_CHECK_FUNCS(pthread_yield)
......@@ -5555,7 +5572,7 @@ AC_ARG_ENABLE(checkpointing,
PAC_SET_HEADER_LIB_PATH(blcr)
PAC_PUSH_FLAG([LIBS])
PAC_CHECK_HEADER_LIB_FATAL(blcr, libcr.h, cr, cr_init)
PAC_APPEND_FLAG([-lblcr],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-lblcr],[WRAPPER_LIBS])
PAC_POP_FLAG([LIBS])
AC_DEFINE(ENABLE_CHECKPOINTING,1,[Application checkpointing enabled])
fi ],
......@@ -6021,13 +6038,6 @@ AC_OUTPUT_COMMANDS([chmod a+x test/commands/cmdtests])
AC_DEFINE(HAVE_MPICHCONF,1,[Define so that we can test whether the mpichconf.h file has been included])
# If the platform does not support inter-library dependencies,
# add the LDFLAGS/LIBS we got so far to WRAPPERs
if test "$INTERLIB_DEPS" = "no" ; then
WRAPPER_LDFLAGS="$WRAPPER_LDFLAGS $LDFLAGS"
WRAPPER_LIBS="$WRAPPER_LIBS $EXTERNAL_LIBS"
fi
if test "$USE_PMI2_API" = "yes" ; then
AC_DEFINE(USE_PMI2_API, 1, [Define if PMI2 API must be used])
fi
......
......@@ -204,6 +204,15 @@ if [ -n "$profConf" ] ; then
fi
fi
final_cflags="@MPICH_MPICC_CFLAGS@ @WRAPPER_CFLAGS@"
final_cppflags="@MPICH_MPICC_CPPFLAGS@ @WRAPPER_CPPFLAGS@"
final_ldflags="@MPICH_MPICC_LDFLAGS@"
final_libs="@MPICH_MPICC_LIBS@"
if test "@INTERLIB_DEPS@" = "no" ; then
final_ldflags="$ldflags @LDFLAGS@ @WRAPPER_LDFLAGS@"
final_libs="$libs @LIBS@ @WRAPPER_LIBS@"
fi
# -----------------------------------------------------------------------
#
# A temporary statement to invoke the compiler
......@@ -229,14 +238,14 @@ if [ "$linking" = yes ] ; then
fi
if [ "$nativelinking" = yes ] ; then
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
$Show $CC ${final_cppflags} $PROFILE_INCPATHS ${final_cflags} ${final_ldflags} "${allargs[@]}" -I$includedir
rc=$?
else
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@
$Show $CC ${final_cppflags} $PROFILE_INCPATHS ${final_cflags} ${final_ldflags} "${allargs[@]}" -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs}
rc=$?
fi
else
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ "${allargs[@]}" -I$includedir
$Show $CC ${final_cppflags} $PROFILE_INCPATHS ${final_cflags} "${allargs[@]}" -I$includedir
rc=$?
fi
......
......@@ -213,6 +213,15 @@ if [ -n "$profConf" ] ; then
fi
fi
final_cflags="@MPICH_MPICC_CFLAGS@ @WRAPPER_CFLAGS@"
final_cppflags="@MPICH_MPICC_CPPFLAGS@ @WRAPPER_CPPFLAGS@"
final_ldflags="@MPICH_MPICC_LDFLAGS@"
final_libs="@MPICH_MPICC_LIBS@"
if test "@INTERLIB_DEPS@" = "no" ; then
final_ldflags="$ldflags @LDFLAGS@ @WRAPPER_LDFLAGS@"
final_libs="$libs @LIBS@ @WRAPPER_LIBS@"
fi
# -----------------------------------------------------------------------
#
# A temporary statement to invoke the compiler
......@@ -238,14 +247,14 @@ if [ "$linking" = yes ] ; then
fi
if [ "$nativelinking" = yes ] ; then
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
$Show $CC ${final_cppflags} $PROFILE_INCPATHS ${final_cflags} ${final_ldflags} $allargs -I$includedir
rc=$?
else
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@
$Show $CC ${final_cppflags} $PROFILE_INCPATHS ${final_cflags} ${final_ldflags} $allargs -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs}
rc=$?
fi
else
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ $allargs -I$includedir
$Show $CC ${final_cppflags} $PROFILE_INCPATHS ${final_cflags} $allargs -I$includedir
rc=$?
fi
......
......@@ -210,6 +210,15 @@ if [ -n "$profConf" ] ; then
fi
fi
final_cxxflags="@MPICH_MPICXX_CXXFLAGS@ @WRAPPER_CXXFLAGS@"
final_cppflags="@MPICH_MPICXX_CPPFLAGS@ @WRAPPER_CPPFLAGS@"
final_ldflags="@MPICH_MPICXX_LDFLAGS@"
final_libs="@MPICH_MPICXX_LIBS@"
if test "@INTERLIB_DEPS@" = "no" ; then
final_ldflags="$ldflags @LDFLAGS@ @WRAPPER_LDFLAGS@"
final_libs="$libs @LIBS@ @WRAPPER_LIBS@"
fi
# A temporary statement to invoke the compiler
# Place the -L before any args incase there are any mpi libraries in there.
# Eventually, we'll want to move this after any non-MPI implementation
......@@ -227,14 +236,14 @@ if [ "$linking" = yes ] ; then
fi
if [ "$nativelinking" = yes ] ; then
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
$Show $CXX ${final_cppflags} $PROFILE_INCPATHS ${final_cxxflags} ${final_ldflags} "${allargs[@]}" -I$includedir
rc=$?
else
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@
$Show $CXX ${final_cppflags} $PROFILE_INCPATHS ${final_cxxflags} ${final_ldflags} "${allargs[@]}" -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs}
rc=$?
fi
else
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ "${allargs[@]}" -I$includedir
$Show $CXX ${final_cppflags} $PROFILE_INCPATHS ${final_cxxflags} "${allargs[@]}" -I$includedir
rc=$?
fi
......
......@@ -219,6 +219,15 @@ if [ -n "$profConf" ] ; then
fi
fi
final_cxxflags="@MPICH_MPICXX_CXXFLAGS@ @WRAPPER_CXXFLAGS@"
final_cppflags="@MPICH_MPICXX_CPPFLAGS@ @WRAPPER_CPPFLAGS@"
final_ldflags="@MPICH_MPICXX_LDFLAGS@"
final_libs="@MPICH_MPICXX_LIBS@"
if test "@INTERLIB_DEPS@" = "no" ; then
final_ldflags="$ldflags @LDFLAGS@ @WRAPPER_LDFLAGS@"
final_libs="$libs @LIBS@ @WRAPPER_LIBS@"
fi
# A temporary statement to invoke the compiler
# Place the -L before any args incase there are any mpi libraries in there.
# Eventually, we'll want to move this after any non-MPI implementation
......@@ -236,14 +245,14 @@ if [ "$linking" = yes ] ; then
fi
if [ "$nativelinking" = yes ] ; then
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
$Show $CXX ${final_cppflags} $PROFILE_INCPATHS ${final_cxxflags} ${final_ldflags} $allargs -I$includedir
rc=$?
else
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@
$Show $CXX ${final_cppflags} $PROFILE_INCPATHS ${final_cxxflags} ${final_ldflags} $allargs -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs}
rc=$?
fi
else
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ $allargs -I$includedir
$Show $CXX ${final_cppflags} $PROFILE_INCPATHS ${final_cxxflags} $allargs -I$includedir
rc=$?
fi
......
......@@ -262,6 +262,14 @@ if [ -n "$profConf" ] ; then
fi
fi
final_fflags="@MPICH_MPIF77_FFLAGS@ @WRAPPER_FFLAGS@"
final_ldflags="@MPICH_MPIF77_LDFLAGS@"
final_libs="@MPICH_MPIF77_LIBS@"
if test "@INTERLIB_DEPS@" = "no" ; then
final_ldflags="$ldflags @LDFLAGS@ @WRAPPER_LDFLAGS@"
final_libs="$libs @LIBS@ @WRAPPER_LIBS@"
fi
# A temporary statement to invoke the compiler
# Place the -L before any args incase there are any mpi libraries in there.
# Eventually, we'll want to move this after any non-MPI implementation
......@@ -280,14 +288,14 @@ if [ "$linking" = yes ] ; then
fi
if [ "$nativelinking" = yes ] ; then
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
$Show $F77 $PROFILE_INCPATHS ${final_fflags} ${final_ldflags} "${allargs[@]}" -I$includedir
rc=$?
else
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $f77libs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@ @F77_OTHER_LIBS@
$Show $F77 $PROFILE_INCPATHS ${final_fflags} ${final_ldflags} "${allargs[@]}" -I$includedir -L$libdir $f77libs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs} @F77_OTHER_LIBS@
rc=$?
fi
else
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ "${allargs[@]}" -I$includedir
$Show $F77 $PROFILE_INCPATHS ${final_fflags} "${allargs[@]}" -I$includedir
rc=$?
fi
if [ -n "$rmfiles" ] ; then
......
......@@ -284,6 +284,14 @@ if [ -n "$profConf" ] ; then
fi
fi
final_fflags="@MPICH_MPIF77_FFLAGS@ @WRAPPER_FFLAGS@"
final_ldflags="@MPICH_MPIF77_LDFLAGS@"
final_libs="@MPICH_MPIF77_LIBS@"
if test "@INTERLIB_DEPS@" = "no" ; then
final_ldflags="$ldflags @LDFLAGS@ @WRAPPER_LDFLAGS@"
final_libs="$libs @LIBS@ @WRAPPER_LIBS@"
fi
# A temporary statement to invoke the compiler
# Place the -L before any args incase there are any mpi libraries in there.
# Eventually, we'll want to move this after any non-MPI implementation
......@@ -302,14 +310,14 @@ if [ "$linking" = yes ] ; then
fi
if [ "$nativelinking" = yes ] ; then
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
$Show $F77 $PROFILE_INCPATHS ${final_fflags} ${final_ldflags} $allargs -I$includedir
rc=$?
else
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $f77libs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@ @F77_OTHER_LIBS@
$Show $F77 $PROFILE_INCPATHS ${final_fflags} ${final_ldflags} $allargs -I$includedir -L$libdir $f77libs $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs} @F77_OTHER_LIBS@
rc=$?
fi
else
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ $allargs -I$includedir
$Show $F77 $PROFILE_INCPATHS ${final_fflags} $allargs -I$includedir
rc=$?
fi
if [ -n "$rmfiles" ] ; then
......
......@@ -303,11 +303,18 @@ elif [ -n "$FCMODINC" ] ; then
FCMODDIRS="${FCMODINC}$modincdir"
fi
final_fcflags="@MPICH_MPIFORT_FCFLAGS@ @WRAPPER_FCFLAGS@"
final_ldflags="@MPICH_MPIFORT_LDFLAGS@"
final_libs="@MPICH_MPIFORT_LIBS@"
if test "@INTERLIB_DEPS@" = "no" ; then
final_ldflags="$ldflags @LDFLAGS@ @WRAPPER_LDFLAGS@"
final_libs="$libs @LIBS@ @WRAPPER_LIBS@"
fi
# A temporary statement to invoke the compiler
# Place the -L before any args incase there are any mpi libraries in there.
# Eventually, we'll want to move this after any non-MPI implementation
# libraries
if [ "$linking" = yes ] ; then
# Attempt to encode rpath info into the executable if the user has not
# disabled rpath usage and some flavor of rpath makes sense on this
......@@ -322,14 +329,14 @@ if [ "$linking" = yes ] ; then
fi
if [ "$nativelinking" = yes ] ; then
$Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}"
$Show $FC $PROFILE_INCPATHS ${final_fcflags} ${final_ldflags} "${allargs[@]}"
rc=$?
else
$Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@ @FC_OTHER_LIBS@
$Show $FC $PROFILE_INCPATHS ${final_fcflags} ${final_ldflags} "${allargs[@]}" $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs} @FC_OTHER_LIBS@
rc=$?
fi
else
$Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ "${allargs[@]}" $FCINCDIRS $FCMODDIRS
$Show $FC $PROFILE_INCPATHS ${final_fcflags} "${allargs[@]}" $FCINCDIRS $FCMODDIRS
rc=$?
fi
if [ -n "$rmfiles" ] ; then
......
......@@ -320,11 +320,18 @@ elif [ -n "$FCMODINC" ] ; then
FCMODDIRS="${FCMODINC}$modincdir"
fi
final_fcflags="@MPICH_MPIFORT_FCFLAGS@ @WRAPPER_FCFLAGS@"
final_ldflags="@MPICH_MPIFORT_LDFLAGS@"
final_libs="@MPICH_MPIFORT_LIBS@"
if test "@INTERLIB_DEPS@" = "no" ; then
final_ldflags="$ldflags @LDFLAGS@ @WRAPPER_LDFLAGS@"
final_libs="$libs @LIBS@ @WRAPPER_LIBS@"
fi
# A temporary statement to invoke the compiler
# Place the -L before any args incase there are any mpi libraries in there.
# Eventually, we'll want to move this after any non-MPI implementation
# libraries
if [ "$linking" = yes ] ; then
# Attempt to encode rpath info into the executable if the user has not
# disabled rpath usage and some flavor of rpath makes sense on this
......@@ -338,14 +345,14 @@ if [ "$linking" = yes ] ; then
fi
if [ "$nativelinking" = yes ] ; then
$Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ $allargs
$Show $FC $PROFILE_INCPATHS ${final_fcflags} ${final_ldflags} $allargs
rc=$?
else
$Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ $allargs $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@ @FC_OTHER_LIBS@
$Show $FC $PROFILE_INCPATHS ${final_fcflags} ${final_ldflags} $allargs $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs} @FC_OTHER_LIBS@
rc=$?
fi
else
$Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ $allargs $FCINCDIRS $FCMODDIRS
$Show $FC $PROFILE_INCPATHS ${final_fcflags} $allargs $FCINCDIRS $FCMODDIRS
rc=$?
fi
if [ -n "$rmfiles" ] ; then
......
#! /bin/sh
# Append ROMIO library dependencies to the global list
EXTERNAL_LIBS="$EXTERNAL_LIBS @LIBS@"
WRAPPER_LIBS="$WRAPPER_LIBS @LIBS@"
MPI_OFFSET_TYPE="@MPI_OFFSET_TYPE@"
FORTRAN_MPI_OFFSET="@FORTRAN_MPI_OFFSET@"
......@@ -23,14 +23,14 @@ AM_COND_IF([BUILD_NEMESIS_NETMOD_IB],[
PAC_POP_FLAG(LIBS)
if test "${dcfa_found}" = "yes" ; then
AC_MSG_NOTICE([libdcfa is going to be linked.])
PAC_APPEND_FLAG([-ldcfa],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-ldcfa],[WRAPPER_LIBS])
else
PAC_PUSH_FLAG(LIBS)
PAC_CHECK_HEADER_LIB([infiniband/verbs.h],ibverbs,ibv_open_device,ibverbs_found=yes,ibverbs_found=no)
PAC_POP_FLAG(LIBS)
if test "${ibverbs_found}" = "yes" ; then
AC_MSG_NOTICE([libibverbs is going to be linked.])
PAC_APPEND_FLAG([-libverbs],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-libverbs],[WRAPPER_LIBS])
else
AC_MSG_ERROR([Internal error: neither ibverbs nor dcfa was found])
fi
......
......@@ -37,7 +37,7 @@ AM_COND_IF([BUILD_NEMESIS_NETMOD_MXM],[
AC_MSG_ERROR(['MXM API version Problem. Are you running a recent version of MXM (at least 3.1)?'])
fi;
AC_DEFINE([ENABLE_COMM_OVERRIDES], 1, [define to add per-vc function pointers to override send and recv functions])
PAC_APPEND_FLAG([-lmxm],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-lmxm],[WRAPPER_LIBS])
])dnl end AM_COND_IF(BUILD_NEMESIS_NETMOD_MXM,...)
])dnl end _BODY
......
......@@ -17,7 +17,7 @@ AM_COND_IF([BUILD_NEMESIS_NETMOD_OFI],[
PAC_SET_HEADER_LIB_PATH(ofi)
PAC_PUSH_FLAG(LIBS)
PAC_CHECK_HEADER_LIB_FATAL(ofi, rdma/fabric.h, fabric, fi_getinfo)
PAC_APPEND_FLAG([-lfabric],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-lfabric],[WRAPPER_LIBS])
PAC_POP_FLAG(LIBS)
AC_DEFINE([ENABLE_COMM_OVERRIDES], 1, [define to add per-vc function pointers to override send and recv functions])
......
......@@ -19,7 +19,7 @@ AM_COND_IF([BUILD_NEMESIS_NETMOD_PORTALS4],[
PAC_SET_HEADER_LIB_PATH(portals4)
PAC_PUSH_FLAG(LIBS)
PAC_CHECK_HEADER_LIB_FATAL(portals4, portals4.h, portals, PtlInit)
PAC_APPEND_FLAG([-lportals],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-lportals],[WRAPPER_LIBS])
PAC_POP_FLAG(LIBS)
AC_DEFINE([ENABLE_COMM_OVERRIDES], 1, [define to add per-vc function pointers to override send and recv functions])
......
......@@ -78,7 +78,7 @@ AC_ARG_ENABLE([ftb],
PAC_SET_HEADER_LIB_PATH([ftb])
PAC_PUSH_FLAG(LIBS)
PAC_CHECK_HEADER_LIB_FATAL([ftb], [libftb.h], [ftb], [FTB_Connect])
PAC_APPEND_FLAG([-lftb],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-lftb],[WRAPPER_LIBS])
PAC_POP_FLAG(LIBS)]
)
......
......@@ -5,7 +5,7 @@ AC_DEFUN([PAC_SUBCFG_PREREQ_]PAC_SUBCFG_AUTO_SUFFIX,[
PAC_PUSH_FLAG(LIBS)
PAC_CHECK_HEADER_LIB([hcoll/api/hcoll_api.h],[hcoll],[hcoll_init],[have_hcoll=yes],[have_hcoll=no])
if test "$have_hcoll" = "yes" ; then
PAC_APPEND_FLAG([-lhcoll],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-lhcoll],[WRAPPER_LIBS])
fi
PAC_POP_FLAG(LIBS)
AM_CONDITIONAL([BUILD_HCOLL],[test "$have_hcoll" = "yes"])
......
......@@ -7,7 +7,7 @@
external_subdirs = @mpl_srcdir@
external_dist_subdirs = @mpl_dist_srcdir@
external_ldflags = -L$(top_builddir)/@mpl_srcdir@
external_libs = -lmpl @EXTERNAL_LIBS@
external_libs = -lmpl @WRAPPER_LIBS@
bin_PROGRAMS =
noinst_HEADERS =
......
......@@ -44,9 +44,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Reset link flags
PAC_RESET_LINK_FLAGS()
EXTERNAL_LIBS=""
export EXTERNAL_LIBS
AC_SUBST(EXTERNAL_LIBS)
WRAPPER_LIBS=""
export WRAPPER_LIBS
AC_SUBST(WRAPPER_LIBS)
PAC_ARG_STRICT
......@@ -277,7 +277,7 @@ for hydra_bss_name in ${hydra_bss_names}; do
PAC_POP_FLAG(LIBS)
if test "$have_pbs_launcher" = "yes" ; then
available_launchers="$available_launchers pbs"
PAC_APPEND_FLAG([-ltorque],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-ltorque],[WRAPPER_LIBS])
fi
available_rmks="$available_rmks pbs"
;;
......@@ -518,7 +518,7 @@ for hydra_ckpointlib in ${hydra_ckpointlibs}; do
if test "$have_blcr" = "yes" ; then
AC_DEFINE(HAVE_BLCR,1,[Define if blcr is available])
available_ckpointlibs="$available_ckpointlibs blcr"
PAC_APPEND_FLAG([-lcr],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-lcr],[WRAPPER_LIBS])
fi
;;
*)
......@@ -691,7 +691,7 @@ if test "$have_ftb" = "yes" ; then
# FIXME: We need to test to make sure FTB works correctly
PAC_APPEND_FLAG([-lpthread],[LIBS])
AC_DEFINE(ENABLE_FTB,1,[Define if FTB is enabled])
PAC_APPEND_FLAG([-lftb],[EXTERNAL_LIBS])
PAC_APPEND_FLAG([-lftb],[WRAPPER_LIBS])
fi
AM_CONDITIONAL([hydra_have_ftb], [test "${have_ftb}" = "yes"])
......
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