[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1rc2-168-geb42f62

mysql vizuser noreply at mpich.org
Sat Jan 18 20:11:21 CST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  eb42f62412655c0944e89a93dcd27f5a5feda0f3 (commit)
       via  be278b7c77c18766495d9bc756ba4a3dc6d258e2 (commit)
      from  38ef5818a883568e7dcc80f0e2aa0cfc972469be (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/eb42f62412655c0944e89a93dcd27f5a5feda0f3

commit eb42f62412655c0944e89a93dcd27f5a5feda0f3
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Fri Dec 20 15:39:42 2013 -0600

    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 <balaji at 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: Ken Raffenetti <raffenet at mcs.anl.gov>

diff --git a/configure.ac b/configure.ac
index 7b095b2..cd0eaf6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/src/env/Makefile.mk b/src/env/Makefile.mk
index e5480ae..b23a6c0 100644
--- a/src/env/Makefile.mk
+++ b/src/env/Makefile.mk
@@ -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
diff --git a/src/env/mpicc.bash.in b/src/env/mpicc.bash.in
index b1bcee1..29cc415 100644
--- a/src/env/mpicc.bash.in
+++ b/src/env/mpicc.bash.in
@@ -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@"
- at 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 at 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 at 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
 
diff --git a/src/env/mpicc.sh.in b/src/env/mpicc.sh.in
index db2074a..7a0f9db 100644
--- a/src/env/mpicc.sh.in
+++ b/src/env/mpicc.sh.in
@@ -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@"
- at 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 at 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 at 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
 
diff --git a/src/env/mpicxx.bash.in b/src/env/mpicxx.bash.in
index bb031c8..61e56fe 100644
--- a/src/env/mpicxx.bash.in
+++ b/src/env/mpicxx.bash.in
@@ -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@"
- at 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 at MPILIBNAME@"
 cxxlibs=
 if [ "@MPICXXLIBNAME@" != "@MPILIBNAME@" ] ; then
     cxxlibs="-l at 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 at 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
 
diff --git a/src/env/mpicxx.sh.in b/src/env/mpicxx.sh.in
index a135bf7..92424cc 100644
--- a/src/env/mpicxx.sh.in
+++ b/src/env/mpicxx.sh.in
@@ -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@"
- at 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 at MPILIBNAME@"
 cxxlibs=
 if [ "@MPICXXLIBNAME@" != "@MPILIBNAME@" ] ; then
     cxxlibs="-l at 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 at 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
 
diff --git a/src/env/mpif77.bash.in b/src/env/mpif77.bash.in
index 04d7817..9625dd3 100644
--- a/src/env/mpif77.bash.in
+++ b/src/env/mpif77.bash.in
@@ -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@"
- at 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 at 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 at 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
diff --git a/src/env/mpif77.sh.in b/src/env/mpif77.sh.in
index ab8077e..73f664d 100644
--- a/src/env/mpif77.sh.in
+++ b/src/env/mpif77.sh.in
@@ -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@"
- at 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 at 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 at 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
diff --git a/src/env/mpif90.bash.in b/src/env/mpif90.bash.in
index e3529af..c93ff1f 100644
--- a/src/env/mpif90.bash.in
+++ b/src/env/mpif90.bash.in
@@ -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@"
- at 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 at 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
-	    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 $FC $FCFLAGS $LDFLAGS "${allargs[@]}"
+        $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}"
         rc=$?
     else
-        $Show $FC $FCFLAGS $LDFLAGS "${allargs[@]}" $FCINCDIRS $FCMODDIRS ${path_list} $FCMODLIBS $mpilibs $LIBS
+        $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ "${allargs[@]}" $FCINCDIRS $FCMODDIRS -L$libdir $FCMODLIBS $PROFILE_PRELIB $PROFILE_FOO @LPMPILIBNAME@ -l at MPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@ @FC_OTHER_LIBS@
         rc=$?
     fi
 else
-    $Show $FC $FCFLAGS "${allargs[@]}" $FCINCDIRS $FCMODDIRS
+    $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ "${allargs[@]}" $FCINCDIRS $FCMODDIRS
     rc=$?
 fi
 if [ -n "$rmfiles" ] ; then
diff --git a/src/env/mpif90.sh.in b/src/env/mpif90.sh.in
index 238df12..6f862c0 100644
--- a/src/env/mpif90.sh.in
+++ b/src/env/mpif90.sh.in
@@ -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@"
- at fc_shlib_conf@
-
 # Internal variables
 # Show is set to echo to cause the compilation command to be echoed instead 
 # of executed.
@@ -276,13 +270,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 at 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
@@ -292,15 +286,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
 
@@ -344,33 +329,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 $FC $FCFLAGS $LDFLAGS $allargs
+        $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_LDFLAGS@ $allargs
         rc=$?
     else
-        $Show $FC $FCFLAGS $LDFLAGS $allargs $FCINCDIRS $FCMODDIRS ${path_list} $FCMODLIBS $mpilibs $LIBS
+        $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ $allargs $FCINCDIRS $FCMODDIRS -L$libdir $FCMODLIBS $PROFILE_PRELIB $PROFILE_FOO @LPMPILIBNAME@ -l at MPILIBNAME@ $PROFILE_POSTLIB @WRAPPER_LIBS@ @FC_OTHER_LIBS@
         rc=$?
     fi
 else
-    $Show $FC $FCFLAGS $allargs $FCINCDIRS $FCMODDIRS
+    $Show $FC $PROFILE_INCPATHS @WRAPPER_FCFLAGS@ $allargs $FCINCDIRS $FCMODDIRS
     rc=$?
 fi
 if [ -n "$rmfiles" ] ; then

http://git.mpich.org/mpich.git/commitdiff/be278b7c77c18766495d9bc756ba4a3dc6d258e2

commit be278b7c77c18766495d9bc756ba4a3dc6d258e2
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Mon Dec 9 08:01:58 2013 -0600

    Improve pkg-config support
    
    Add rpath flags to pkg-config to match compiler wrappers. Fixes #1044
    
    Signed-off-by: Pavan Balaji <balaji at mcs.anl.gov>

diff --git a/configure.ac b/configure.ac
index 21fc951..7b095b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1805,6 +1805,12 @@ 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\"
+fi
+AC_SUBST(WRAPPER_RPATH_LDFLAGS)
+
 # ---------------------------------------------------------------------------
 # Support for MPI_T performance variables
 
diff --git a/src/packaging/pkgconfig/mpich.pc.in b/src/packaging/pkgconfig/mpich.pc.in
index ece3e55..48657fa 100644
--- a/src/packaging/pkgconfig/mpich.pc.in
+++ b/src/packaging/pkgconfig/mpich.pc.in
@@ -9,7 +9,7 @@ Description: High Performance and portable MPI
 Version: @MPICH_VERSION@
 URL: http://www.mcs.anl.gov/research/projects/mpich
 Requires:
-Libs: @WRAPPER_LDFLAGS@ -L${libdir} @LPMPILIBNAME@ -l at MPILIBNAME@ @WRAPPER_LIBS@
+Libs: @WRAPPER_RPATH_LDFLAGS@ @WRAPPER_LDFLAGS@ -L${libdir} @LPMPILIBNAME@ -l at MPILIBNAME@ @WRAPPER_LIBS@
 Cflags: @WRAPPER_CPPFLAGS@ @WRAPPER_CFLAGS@ -I${includedir}
 
 # pkg-config does not understand Cxxflags, etc. So we allow users to

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                        |   27 ++++-----------------
 src/env/Makefile.mk                 |    6 +----
 src/env/mpicc.bash.in               |   45 ++++-------------------------------
 src/env/mpicc.sh.in                 |   44 ++++------------------------------
 src/env/mpicxx.bash.in              |   44 ++++------------------------------
 src/env/mpicxx.sh.in                |   43 ++++-----------------------------
 src/env/mpif77.bash.in              |   44 ++++------------------------------
 src/env/mpif77.sh.in                |   43 ++++-----------------------------
 src/env/mpif90.bash.in              |   44 ++++------------------------------
 src/env/mpif90.sh.in                |   43 ++++-----------------------------
 src/packaging/pkgconfig/mpich.pc.in |    2 +-
 11 files changed, 47 insertions(+), 338 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list