Commit eb42f624 authored by Kenneth Raffenetti's avatar Kenneth Raffenetti Committed by Pavan Balaji
Browse files

compile wrapper cleanup



Simplify logic in compile wrapper scripts. Use configure substitutions
where possible to better match pkg-config style.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>

Includes the following modifications by Pavan Balaji:

Remove the PAC_COMPILER_SHLIB_FLAGS usage, instead of modifying the
macro in confdb.

The ordering of flags in mpicc and friends does not match that of
pkg-config.  This is because of two reasons.

1. pkg-config reorders flags when it outputs them.  This requires us
to manually adjust the flags in mpicc to match up, and is error prone.

2. mpicc and friends provide LDFLAGS before the user-specified flags,
followed by the include and library directories.  This is to make sure
that the LDFLAGS are listed before the application source file.
Reordering them to match pkg-config loses this flexibility.
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
parent be278b7c
......@@ -1797,14 +1797,6 @@ export NEEDSPLIB
AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "$NEEDSPLIB" = "yes"])
# ---------------------------------------------------------------------------
# determine rpath and other shared library flags for CC
# src/env may not exist yet in a vpath build
$MKDIR_P src/env
cc_shlib_conf=src/env/cc_shlib.conf
PAC_COMPILER_SHLIB_FLAGS([CC],[$cc_shlib_conf])
AC_SUBST_FILE([cc_shlib_conf])
# output rpath flags in a usable format for mpich.pc (pkg-config)
if test "X$enable_wrapper_rpath" = "Xyes"; then
eval WRAPPER_RPATH_LDFLAGS=\"$hardcode_libdir_flag_spec\"
......@@ -2090,11 +2082,6 @@ fi
# Now test for Fortran compiler characteristics
# ----------------------------------------------------------------------------
if test "$enable_f77" = "yes" ; then
# determine rpath and other shared library flags for F77
f77_shlib_conf=src/env/f77_shlib.conf
PAC_COMPILER_SHLIB_FLAGS([F77],[$f77_shlib_conf])
AC_SUBST_FILE([f77_shlib_conf])
AC_LANG_FORTRAN77
PAC_PROG_F77_EXCLAIM_COMMENTS(has_exclaim="yes",has_exclaim="no")
PAC_PROG_F77_HAS_INCDIR(src)
......@@ -2191,11 +2178,6 @@ MPICONSTMODNAME=mpi_constants
MPISIZEOFMODNAME=mpi_sizeofs
MPIBASEMODNAME=mpi_base
if test "$enable_fc" = "yes" ; then
# determine rpath and other shared library flags for FC
fc_shlib_conf=src/env/fc_shlib.conf
PAC_COMPILER_SHLIB_FLAGS([FC],[$fc_shlib_conf])
AC_SUBST_FILE([fc_shlib_conf])
# Determine characteristics of the Fortran 90 compiler
# Find a Fortran 90 compiler. Sets FC
# Work around bug in autoconf that adds -g to FCFLAGS
......@@ -2430,11 +2412,6 @@ int main() {
AC_SUBST(MPIR_CXX_COMPLEX)
AC_SUBST(MPIR_CXX_DOUBLE_COMPLEX)
AC_SUBST(MPIR_CXX_LONG_DOUBLE_COMPLEX)
# determine rpath and other shared library flags for CXX
cxx_shlib_conf=src/env/cxx_shlib.conf
PAC_COMPILER_SHLIB_FLAGS([CXX],[$cxx_shlib_conf])
AC_SUBST_FILE([cxx_shlib_conf])
fi
if test "$enable_cxx" = yes; then
......
......@@ -59,11 +59,7 @@ src/env/mpif90: $(top_builddir)/src/env/mpif90.sh
cp -p $? $@
endif !BUILD_BASH_SCRIPTS
DISTCLEANFILES += $(top_builddir)/src/env/cc_shlib.conf \
$(top_builddir)/src/env/cxx_shlib.conf \
$(top_builddir)/src/env/f77_shlib.conf \
$(top_builddir)/src/env/fc_shlib.conf \
$(top_builddir)/src/env/mpicc \
DISTCLEANFILES += $(top_builddir)/src/env/mpicc \
$(top_builddir)/src/env/mpicxx \
$(top_builddir)/src/env/mpif77 \
$(top_builddir)/src/env/mpif90
......
......@@ -37,15 +37,8 @@ libdir=@libdir@
# Determined by a combination of environment variables and tests within
# configure (e.g., determining whehter -lsocket is needee)
CC="@CC@"
CFLAGS="@WRAPPER_CFLAGS@"
CPPFLAGS="@WRAPPER_CPPFLAGS@"
LDFLAGS="@WRAPPER_LDFLAGS@"
LIBS="@WRAPPER_LIBS@"
MPICH_VERSION="@MPICH_VERSION@"
enable_wrapper_rpath="@enable_wrapper_rpath@"
@cc_shlib_conf@
# Internal variables
# Show is set to echo to cause the compilation command to be echoed instead
# of executed.
......@@ -189,13 +182,13 @@ fi
# Derived variables. These are assembled from variables set from the
# default, environment, configuration file (if any) and command-line
# options (if any)
mpilibs="@LPMPILIBNAME@ -l@MPILIBNAME@"
PROFILE_FOO=
# Handle the case of a profile switch
if [ -n "$profConf" ] ; then
profConffile=
if [ -s "$libdir/lib$profConf.a" -o -s "$libdir/lib$profConf.so" ] ; then
mpilibs="-l$profConf $mpilibs"
PROFILE_FOO="-l$profConf"
elif [ -s "$sysconfdir/$profConf.conf" ] ; then
profConffile="$sysconfdir/$profConf.conf"
elif [ -s "$profConf.conf" ] ; then
......@@ -205,15 +198,6 @@ if [ -n "$profConf" ] ; then
fi
if [ -n "$profConffile" -a -s "$profConffile" ] ; then
. $profConffile
if [ -n "$PROFILE_INCPATHS" ] ; then
CFLAGS="$PROFILE_INCPATHS $CFLAGS"
fi
if [ -n "$PROFILE_PRELIB" ] ; then
mpilibs="$PROFILE_PRELIB $mpilibs"
fi
if [ -n "$PROFILE_POSTLIB" ] ; then
mpilibs="$mpilibs $PROFILE_POSTLIB"
fi
fi
fi
......@@ -230,34 +214,15 @@ fi
# file or an object file. Instead, we just check for an option that
# suppressing linking, such as -c or -M.
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
# platform.
# TODO configure and config.rpath are computing more sophisticated rpath
# schemes than this simple one. Consider updating this logic accordingly.
if test "X$enable_wrapper_rpath" = "Xyes" ; then
# prepend the path for the shared libraries to the library list
eval mpilibs=\"${hardcode_libdir_flag_spec} \$mpilibs\"
fi
path_list=""
for path in "-L$libdir" ; do
found_path=0
for p in $path_list ; do
if [ "$path" = "$p" ] ; then found_path=1 ; break ; fi
done
if [ "$found_path" = "0" ] ; then path_list="$path_list $path" ; fi
done
if [ "$nativelinking" = yes ] ; then
$Show $CC $CPPFLAGS $CFLAGS $LDFLAGS "${allargs[@]}" -I$includedir
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
else
$Show $CC $CPPFLAGS $CFLAGS $LDFLAGS "${allargs[@]}" -I$includedir ${path_list} $mpilibs $LIBS
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO @LPMPILIBNAME@ -l@MPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@
rc=$?
fi
else
$Show $CC $CPPFLAGS $CFLAGS "${allargs[@]}" -I$includedir
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
fi
......
......@@ -37,15 +37,8 @@ libdir=@libdir@
# Determined by a combination of environment variables and tests within
# configure (e.g., determining whehter -lsocket is needee)
CC="@CC@"
CFLAGS="@WRAPPER_CFLAGS@"
CPPFLAGS="@WRAPPER_CPPFLAGS@"
LDFLAGS="@WRAPPER_LDFLAGS@"
LIBS="@WRAPPER_LIBS@"
MPICH_VERSION="@MPICH_VERSION@"
enable_wrapper_rpath="@enable_wrapper_rpath@"
@cc_shlib_conf@
# Internal variables
# Show is set to echo to cause the compilation command to be echoed instead
# of executed.
......@@ -198,13 +191,13 @@ fi
# Derived variables. These are assembled from variables set from the
# default, environment, configuration file (if any) and command-line
# options (if any)
mpilibs="@LPMPILIBNAME@ -l@MPILIBNAME@"
PROFILE_FOO=
# Handle the case of a profile switch
if [ -n "$profConf" ] ; then
profConffile=
if [ -s "$libdir/lib$profConf.a" -o -s "$libdir/lib$profConf.so" ] ; then
mpilibs="-l$profConf $mpilibs"
PROFILE_FOO="-l$profConf"
elif [ -s "$sysconfdir/$profConf.conf" ] ; then
profConffile="$sysconfdir/$profConf.conf"
elif [ -s "$profConf.conf" ] ; then
......@@ -214,15 +207,6 @@ if [ -n "$profConf" ] ; then
fi
if [ -n "$profConffile" -a -s "$profConffile" ] ; then
. $profConffile
if [ -n "$PROFILE_INCPATHS" ] ; then
CFLAGS="$PROFILE_INCPATHS $CFLAGS"
fi
if [ -n "$PROFILE_PRELIB" ] ; then
mpilibs="$PROFILE_PRELIB $mpilibs"
fi
if [ -n "$PROFILE_POSTLIB" ] ; then
mpilibs="$mpilibs $PROFILE_POSTLIB"
fi
fi
fi
......@@ -239,33 +223,15 @@ fi
# file or an object file. Instead, we just check for an option that
# suppressing linking, such as -c or -M.
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
# platform.
# TODO configure and config.rpath are computing more sophisticated rpath
# schemes than this simple one. Consider updating this logic accordingly.
if test "X$enable_wrapper_rpath" = "Xyes" ; then
eval mpilibs=\"${hardcode_libdir_flag_spec} \$mpilibs\"
fi
path_list=""
for path in "-L$libdir" ; do
found_path=0
for p in $path_list ; do
if [ "$path" = "$p" ] ; then found_path=1 ; break ; fi
done
if [ "$found_path" = "0" ] ; then path_list="$path_list $path" ; fi
done
if [ "$nativelinking" = yes ] ; then
$Show $CC $CPPFLAGS $CFLAGS $LDFLAGS $allargs -I$includedir
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
rc=$?
else
$Show $CC $CPPFLAGS $CFLAGS $LDFLAGS $allargs -I$includedir ${path_list} $mpilibs $LIBS
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO @LPMPILIBNAME@ -l@MPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@
rc=$?
fi
else
$Show $CC $CPPFLAGS $CFLAGS $allargs -I$includedir
$Show $CC @WRAPPER_CPPFLAGS@ $PROFILE_INCPATHS @WRAPPER_CFLAGS@ $allargs -I$includedir
rc=$?
fi
......
......@@ -34,14 +34,8 @@ libdir=@libdir@
# Default settings for compiler, flags, and libraries
CXX="@CXX@"
CXXFLAGS="@WRAPPER_CXXFLAGS@"
LDFLAGS="@WRAPPER_LDFLAGS@"
LIBS="@WRAPPER_LIBS@"
MPICH_VERSION="@MPICH_VERSION@"
enable_wrapper_rpath="@enable_wrapper_rpath@"
@cxx_shlib_conf@
# Internal variables
# Show is set to echo to cause the compilation command to be echoed instead
# of executed.
......@@ -190,17 +184,17 @@ fi
# Derived variables. These are assembled from variables set from the
# default, environment, configuration file (if any) and command-line
# options (if any)
mpilibs="@LPMPILIBNAME@ -l@MPILIBNAME@"
cxxlibs=
if [ "@MPICXXLIBNAME@" != "@MPILIBNAME@" ] ; then
cxxlibs="-l@MPICXXLIBNAME@"
fi
PROFILE_FOO=
# Handle the case of a profile switch
if [ -n "$profConf" ] ; then
profConffile=
if [ -s "$libdir/lib$profConf.a" -o -s "$libdir/lib$profConf.so" ] ; then
mpilibs="-l$profConf $mpilibs"
PROFILE_FOO="-l$profConf"
elif [ -s "$sysconfdir/$profConf.conf" ] ; then
profConffile="$sysconfdir/$profConf.conf"
elif [ -s "$profConf.conf" ] ; then
......@@ -210,15 +204,6 @@ if [ -n "$profConf" ] ; then
fi
if [ -n "$profConffile" -a -s "$profConffile" ] ; then
. $profConffile
if [ -n "$PROFILE_INCPATHS" ] ; then
CXXFLAGS="$PROFILE_INCPATHS $CXXFLAGS"
fi
if [ -n "$PROFILE_PRELIB" ] ; then
mpilibs="$PROFILE_PRELIB $mpilibs"
fi
if [ -n "$PROFILE_POSTLIB" ] ; then
mpilibs="$mpilibs $PROFILE_POSTLIB"
fi
fi
fi
# A temporary statement to invoke the compiler
......@@ -226,34 +211,15 @@ fi
# 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
# platform.
# TODO configure and config.rpath are computing more sophisticated rpath
# schemes than this simple one. Consider updating this logic accordingly.
if test "X$enable_wrapper_rpath" = "Xyes" ; then
# prepend the path for the shared libraries to the library list
eval mpilibs=\"${hardcode_libdir_flag_spec} \$mpilibs\"
fi
path_list=""
for path in "-L$libdir" ; do
found_path=0
for p in $path_list ; do
if [ "$path" = "$p" ] ; then found_path=1 ; break ; fi
done
if [ "$found_path" = "0" ] ; then path_list="$path_list $path" ; fi
done
if [ "$nativelinking" = yes ] ; then
$Show $CXX $CXXFLAGS $LDFLAGS "${allargs[@]}" -I$includedir
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
else
$Show $CXX $CXXFLAGS $LDFLAGS "${allargs[@]}" -I$includedir ${path_list} $shllibpath $cxxlibs $mpilibs $LIBS
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO @LPMPILIBNAME@ -l@MPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@
rc=$?
fi
else
$Show $CXX $CXXFLAGS "${allargs[@]}" -I$includedir
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
fi
......
......@@ -34,14 +34,8 @@ libdir=@libdir@
# Default settings for compiler, flags, and libraries
CXX="@CXX@"
CXXFLAGS="@WRAPPER_CXXFLAGS@"
LDFLAGS="@WRAPPER_LDFLAGS@"
LIBS="@WRAPPER_LIBS@"
MPICH_VERSION="@MPICH_VERSION@"
enable_wrapper_rpath="@enable_wrapper_rpath@"
@cxx_shlib_conf@
# Internal variables
# Show is set to echo to cause the compilation command to be echoed instead
# of executed.
......@@ -199,17 +193,17 @@ fi
# Derived variables. These are assembled from variables set from the
# default, environment, configuration file (if any) and command-line
# options (if any)
mpilibs="@LPMPILIBNAME@ -l@MPILIBNAME@"
cxxlibs=
if [ "@MPICXXLIBNAME@" != "@MPILIBNAME@" ] ; then
cxxlibs="-l@MPICXXLIBNAME@"
fi
PROFILE_FOO=
# Handle the case of a profile switch
if [ -n "$profConf" ] ; then
profConffile=
if [ -s "$libdir/lib$profConf.a" -o -s "$libdir/lib$profConf.so" ] ; then
mpilibs="-l$profConf $mpilibs"
PROFILE_FOO="-l$profConf"
elif [ -s "$sysconfdir/$profConf.conf" ] ; then
profConffile="$sysconfdir/$profConf.conf"
elif [ -s "$profConf.conf" ] ; then
......@@ -219,15 +213,6 @@ if [ -n "$profConf" ] ; then
fi
if [ -n "$profConffile" -a -s "$profConffile" ] ; then
. $profConffile
if [ -n "$PROFILE_INCPATHS" ] ; then
CXXFLAGS="$PROFILE_INCPATHS $CXXFLAGS"
fi
if [ -n "$PROFILE_PRELIB" ] ; then
mpilibs="$PROFILE_PRELIB $mpilibs"
fi
if [ -n "$PROFILE_POSTLIB" ] ; then
mpilibs="$mpilibs $PROFILE_POSTLIB"
fi
fi
fi
# A temporary statement to invoke the compiler
......@@ -235,33 +220,15 @@ fi
# 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
# platform.
# TODO configure and config.rpath are computing more sophisticated rpath
# schemes than this simple one. Consider updating this logic accordingly.
if test "X$enable_wrapper_rpath" = "Xyes" ; then
eval mpilibs=\"${hardcode_libdir_flag_spec} \$mpilibs\"
fi
path_list=""
for path in "-L$libdir" ; do
found_path=0
for p in $path_list ; do
if [ "$path" = "$p" ] ; then found_path=1 ; break ; fi
done
if [ "$found_path" = "0" ] ; then path_list="$path_list $path" ; fi
done
if [ "$nativelinking" = yes ] ; then
$Show $CXX $CXXFLAGS $LDFLAGS $allargs -I$includedir
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
rc=$?
else
$Show $CXX $CXXFLAGS $LDFLAGS $allargs -I$includedir ${path_list} $shllibpath $cxxlibs $mpilibs $LIBS
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $cxxlibs $PROFILE_PRELIB $PROFILE_FOO @LPMPILIBNAME@ -l@MPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@
rc=$?
fi
else
$Show $CXX $CXXFLAGS $allargs -I$includedir
$Show $CXX $PROFILE_INCPATHS @WRAPPER_CXXFLAGS@ $allargs -I$includedir
rc=$?
fi
......
......@@ -40,14 +40,8 @@ libdir=@libdir@
# configure (e.g., determining whehter -lsocket is needee)
F77="@F77@"
F77CPP="@F77CPP@"
FFLAGS="@WRAPPER_FFLAGS@"
LDFLAGS="@WRAPPER_LDFLAGS@"
LIBS="@WRAPPER_LIBS@ @F77_OTHER_LIBS@"
MPICH_VERSION="@MPICH_VERSION@"
enable_wrapper_rpath="@enable_wrapper_rpath@"
@f77_shlib_conf@
# Internal variables
# Show is set to echo to cause the compilation command to be echoed instead
# of executed.
......@@ -242,13 +236,13 @@ fi
# Derived variables. These are assembled from variables set from the
# default, environment, configuration file (if any) and command-line
# options (if any)
mpilibs="@LPMPILIBNAME@ -l@MPILIBNAME@"
PROFILE_FOO=
# Handle the case of a profile switch
if [ -n "$profConf" ] ; then
profConffile=
if [ -s "$libdir/lib$profConf.a" -o -s "$libdir/lib$profConf.so" ] ; then
mpilibs="-l$profConf $mpilibs"
PROFILE_FOO="-l$profConf"
elif [ -s "$sysconfdir/$profConf.conf" ] ; then
profConffile="$sysconfdir/$profConf.conf"
elif [ -s "$profConf.conf" ] ; then
......@@ -258,15 +252,6 @@ if [ -n "$profConf" ] ; then
fi
if [ -n "$profConffile" -a -s "$profConffile" ] ; then
. $profConffile
if [ -n "$PROFILE_INCPATHS" ] ; then
FFLAGS="$PROFILE_INCPATHS $FFLAGS"
fi
if [ -n "$PROFILE_PRELIB" ] ; then
mpilibs="$PROFILE_PRELIB $mpilibs"
fi
if [ -n "$PROFILE_POSTLIB" ] ; then
mpilibs="$mpilibs $PROFILE_POSTLIB"
fi
fi
fi
#
......@@ -276,34 +261,15 @@ fi
# 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
# platform.
# TODO configure and config.rpath are computing more sophisticated rpath
# schemes than this simple one. Consider updating this logic accordingly.
if test "X$enable_wrapper_rpath" = "Xyes" ; then
# prepend the path for the shared libraries to the library list
eval mpilibs=\"${hardcode_libdir_flag_spec} \$mpilibs\"
fi
path_list=""
for path in "-L$libdir" ; do
found_path=0
for p in $path_list ; do
if [ "$path" = "$p" ] ; then found_path=1 ; break ; fi
done
if [ "$found_path" = "0" ] ; then path_list="$path_list $path" ; fi
done
if [ "$nativelinking" = yes ] ; then
$Show $F77 $FFLAGS $LDFLAGS "${allargs[@]}" -I$includedir
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
else
$Show $F77 $FFLAGS $LDFLAGS "${allargs[@]}" -I$includedir ${path_list} $mpilibs $LIBS
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO @LPMPILIBNAME@ -l@MPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@ @F77_OTHER_LIBS@
rc=$?
fi
else
$Show $F77 $FFLAGS "${allargs[@]}" -I$includedir
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ "${allargs[@]}" -I$includedir
rc=$?
fi
if [ -n "$rmfiles" ] ; then
......
......@@ -40,14 +40,8 @@ libdir=@libdir@
# configure (e.g., determining whehter -lsocket is needee)
F77="@F77@"
F77CPP="@F77CPP@"
FFLAGS="@WRAPPER_FFLAGS@"
LDFLAGS="@WRAPPER_LDFLAGS@"
LIBS="@WRAPPER_LIBS@ @F77_OTHER_LIBS@"
MPICH_VERSION="@MPICH_VERSION@"
enable_wrapper_rpath="@enable_wrapper_rpath@"
@f77_shlib_conf@
# Internal variables
# Show is set to echo to cause the compilation command to be echoed instead
# of executed.
......@@ -264,13 +258,13 @@ fi
# Derived variables. These are assembled from variables set from the
# default, environment, configuration file (if any) and command-line
# options (if any)
mpilibs="@LPMPILIBNAME@ -l@MPILIBNAME@"
PROFILE_FOO=
# Handle the case of a profile switch
if [ -n "$profConf" ] ; then
profConffile=
if [ -s "$libdir/lib$profConf.a" -o -s "$libdir/lib$profConf.so" ] ; then
mpilibs="-l$profConf $mpilibs"
PROFILE_FOO="-l$profConf"
elif [ -s "$sysconfdir/$profConf.conf" ] ; then
profConffile="$sysconfdir/$profConf.conf"
elif [ -s "$profConf.conf" ] ; then
......@@ -280,15 +274,6 @@ if [ -n "$profConf" ] ; then
fi
if [ -n "$profConffile" -a -s "$profConffile" ] ; then
. $profConffile
if [ -n "$PROFILE_INCPATHS" ] ; then
FFLAGS="$PROFILE_INCPATHS $FFLAGS"
fi
if [ -n "$PROFILE_PRELIB" ] ; then
mpilibs="$PROFILE_PRELIB $mpilibs"
fi
if [ -n "$PROFILE_POSTLIB" ] ; then
mpilibs="$mpilibs $PROFILE_POSTLIB"
fi
fi
fi
#
......@@ -298,33 +283,15 @@ fi
# 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
# platform.
# TODO configure and config.rpath are computing more sophisticated rpath
# schemes than this simple one. Consider updating this logic accordingly.
if test "X$enable_wrapper_rpath" = "Xyes" ; then
eval mpilibs=\"${hardcode_libdir_flag_spec} \$mpilibs\"
fi
path_list=""
for path in "-L$libdir" ; do
found_path=0
for p in $path_list ; do
if [ "$path" = "$p" ] ; then found_path=1 ; break ; fi
done
if [ "$found_path" = "0" ] ; then path_list="$path_list $path" ; fi
done
if [ "$nativelinking" = yes ] ; then
$Show $F77 $FFLAGS $LDFLAGS $allargs -I$includedir
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir
rc=$?
else
$Show $F77 $FFLAGS $LDFLAGS $allargs -I$includedir ${path_list} $mpilibs $LIBS
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ $allargs -I$includedir -L$libdir $PROFILE_PRELIB $PROFILE_FOO @LPMPILIBNAME@ -l@MPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@ @F77_OTHER_LIBS@
rc=$?
fi
else
$Show $F77 $FFLAGS $allargs -I$includedir
$Show $F77 $PROFILE_INCPATHS @WRAPPER_FFLAGS@ $allargs -I$includedir
rc=$?
fi
if [ -n "$rmfiles" ] ; then
......
......@@ -53,14 +53,8 @@ FCMODINC="@FCMODINCFLAG@"
FCMODINCSPEC="@FCMODINCSPEC@"
FCEXT="@FCEXT@"
FCFLAGS="@WRAPPER_FCFLAGS@"
LDFLAGS="@WRAPPER_LDFLAGS@"
LIBS="@WRAPPER_LIBS@ @FC_OTHER_LIBS@"
MPICH_VERSION="@MPICH_VERSION@"
enable_wrapper_rpath="@enable_wrapper_rpath@"
@fc_shlib_conf@
# Internal variables
# Show is set to echo to cause the compilation command to be echoed instead
# of executed.
......@@ -259,13 +253,13 @@ fi
# The library lib${MPILIBNAME}f90 contains the f90-specific features,
# such as the module objects and the routines defined by them
# (MPI_SIZEOF is handled in lib${MPILIBNAME)f90, for example).
mpilibs="@LPMPILIBNAME@ -l@MPILIBNAME@"
PROFILE_FOO=
# Handle the case of a profile switch
if [ -n "$profConf" ] ; then
profConffile=
if [ -s "$libdir/lib$profConf.a" -o -s "$libdir/lib$profConf.so" ] ; then
mpilibs="-l$profConf $mpilibs"
PROFILE_FOO="-l$profConf"
elif [ -s "$sysconfdir/$profConf.conf" ] ; then
profConffile="$sysconfdir/$profConf.conf"
elif [ -s "$profConf.conf" ] ; then
......@@ -275,15 +269,6 @@ if [ -n "$profConf" ] ; then
fi
if [ -n "$profConffile" -a -s "$profConffile" ] ; then
. $profConffile
if [ -n "$PROFILE_INCPATHS" ] ; then
FCFLAGS="$PROFILE_INCPATHS $FCFLAGS"
fi
if [ -n "$PROFILE_PRELIB" ] ; then
mpilibs="$PROFILE_PRELIB $mpilibs"
fi
if [ -n "$PROFILE_POSTLIB" ] ; then
mpilibs="$mpilibs $PROFILE_POSTLIB"
fi
fi
fi
......@@ -327,34 +312,15 @@ fi
# 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
# platform.
# TODO configure and config.rpath are computing more sophisticated rpath
# schemes than this simple one. Consider updating this logic accordingly.
if test "X$enable_wrapper_rpath" = "Xyes" ; then
# prepend the path for the shared libraries to the library list
eval mpilibs=\"${hardcode_libdir_flag_spec} \$mpilibs\"
fi
path_list=""
for path in "-L$libdir" ; do
found_path=0
for p in $path_list ; do