All,
I've noticed that the quality of the log entries in the release branch
is not equivalent to those for trunk. Could you use the text from the
log entries from trunk instead of referring to the trunk revisions.
Providing rXXX is very cryptic and requires unnecessary investigation by
those reviewing and utilizing the patches.
Brian
-------- Original Message --------
Subject: [mpich2-commits] r673 - in
mpich2/branches/release/MPICH2_1_0_7: . confdb doc/installguide
Date: Sun, 16 Mar 2008 19:49:05 -0500 (CDT)
From: chan(a)mcs.anl.gov
Reply-To: chan(a)mcs.anl.gov
To: mpich2-commits(a)mcs.anl.gov
Author: chan
Date: 2008-03-16 19:49:01 -0500 (Sun, 16 Mar 2008)
New Revision: 673
Added:
mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal_util.m4
Modified:
mpich2/branches/release/MPICH2_1_0_7/README.vin
mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal.m4
mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal_subcfg.m4
mpich2/branches/release/MPICH2_1_0_7/configure.in
mpich2/branches/release/MPICH2_1_0_7/doc/installguide/install.tex.vin
Log:
merged with r664-r672 from trunk
Modified: mpich2/branches/release/MPICH2_1_0_7/README.vin
===================================================================
--- mpich2/branches/release/MPICH2_1_0_7/README.vin 2008-03-17 00:14:39
UTC (rev 672)
+++ mpich2/branches/release/MPICH2_1_0_7/README.vin 2008-03-17 00:49:01
UTC (rev 673)
@@ -74,15 +74,15 @@
tar xf mpich2.tar
cd mpich2-%VERSION%
-3. Choose an installation directory (the default is /usr/local/bin):
-
- mkdir /home/you/mpich2-install
-
+3. Choose an installation directory (the default is /usr/local/bin),
+ /home/you/mpich2-install which is assumed to non-existent or empty.
It will be most convenient if this directory is shared by all of the
machines where you intend to run processes. If not, you will have
to duplicate it on the other machines after installation.
-4. Configure MPICH2, specifying the installation directory:
+4. Configure MPICH2 (The steps described here are called inpath-build,
+ we recommend user to do vpath build if possible), specifying the
+ installation directory:
for csh and tcsh:
@@ -347,29 +347,40 @@
Compiler Flags
==============
-MPICH2 uses two sets of flags: CFLAGS (and family -- CXXFLAGS, FFLAGS,
-F90FLAGS) and MPICH2LIB_CFLAGS (and family) for compilation; LDFLAGS
-and MPICH2LIB_LDFLAGS for linking. All these flags can be set through
-environment variables during configure.
+MPICH2 can be configured with two sets of compiler flags:
+CFLAGS, CXXFLAGS, FFLAGS, F90FLAGS (abbreviated as xFLAGS) and
+MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS, MPICH2LIB_FFLAGS, MPICH2LIB_F90FLAGS
+(abbreviated as MPICH2LIB_xFLAGS) for compilation;
+LDFLAGS and MPICH2LIB_LDFLAGS for linking. All these flags can be set
+as part of configure command or through environment variables.
+(CPPFLAGS stands for C preprocessor flags, which should NOT be set)
-Both CFLAGS and MPICH2LIB_CFLAGS affect the compilation of the MPICH2
-library. However, only CFLAGS is appended to mpicc.
+Both xFLAGS and MPICH2LIB_xFLAGS affect the compilation of the MPICH2
+libraries. However, only xFLAGS is appended to MPI wrapper scripts, mpicc
+and friends.
-By default, MPICH2LIB_CFLAGS are set to -O2. If the user specifies any
-other flags, they are appended to this default flag. The default flag
-can be disabled with the configure option
-"--disable-default-optimization". CFLAGS is empty by default.
+MPICH2 libraries are built with default compiler optimization, -O2,
+which can be modified by --enable-fast configure option. For instance,
+--disable-fast disables the default optimization option.
+--enable-fast=O<n> sets default compiler optimization as -O<n>.
+For more details of --enable-fast, see the output of "configure --help".
+Any other complicated optimization flags for MPICH2 libraries have
+to be set throught MPICH2LIB_xFLAGS. CFLAGS and friends
+are empty by default.
-For example, to build a "production" MPICH2 in a GNU environment, you
-may want to do:
+For example, to build a "production" MPICH2 environment with -O3 for all
+language bindings, one can simply do
- setenv MPICH2LIB_CFLAGS -O3
- ./configure --disable-default-optimization
+ ./configure --enable-fast=O3
-This will cause the MPICH2 library to be built with -O3, and -O3 will
-not be included in the mpicc script.
+or
+ ./configure --disable-fast MPICH2LIB_CFLAGS=-O3 MPICH2LIB_FFLAGS=-O3
MPICH2LIB_CXXFLAGS=-O3 MPICH2LIB_F90FLAGS=-O3
+This will cause the MPICH2 libraries to be built with -O3, and -O3 will
+not be included in the mpicc and other MPI wrapper script.
+
+
Alternative Process Managers
============================
Modified: mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal.m4
===================================================================
--- mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal.m4 2008-03-17
00:14:39 UTC (rev 672)
+++ mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal.m4 2008-03-17
00:49:01 UTC (rev 673)
@@ -9,6 +9,7 @@
builtin(include,aclocal_cross.m4)
builtin(include,aclocal_cxx.m4)
builtin(include,aclocal_f77.m4)
+builtin(include,aclocal_util.m4)
builtin(include,aclocal_subcfg.m4)
dnl If we're using 2.52, include new support for F90
dnl If we're using 2.13, use the old version
Modified: mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal_subcfg.m4
===================================================================
--- mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal_subcfg.m4
2008-03-17 00:14:39 UTC (rev 672)
+++ mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal_subcfg.m4
2008-03-17 00:49:01 UTC (rev 673)
@@ -5,10 +5,11 @@
AC_DEFUN(PAC_MPICH2_INIT,[
# Exporting the MPICH2_INTERNAL_xFLAGS with modified xFLAGS
# before calling subconfigure.
- MPICH2_INTERNAL_CFLAGS=$CFLAGS
- MPICH2_INTERNAL_CXXFLAGS=$CXXFLAGS
- MPICH2_INTERNAL_FFLAGS=$FFLAGS
- MPICH2_INTERNAL_F90FLAGS=$F90FLAGS
+dnl Use user-supplied flags, WRAPPER_xFLAGS, and uniq'ed
MPICH2_EXTRA_xFLAGS.
+ MPICH2_INTERNAL_CFLAGS="$WRAPPER_CFLAGS $MPICH2_EXTRA_CFLAGS"
+ MPICH2_INTERNAL_CXXFLAGS="$WRAPPER_CXXFLAGS $MPICH2_EXTRA_CXXFLAGS"
+ MPICH2_INTERNAL_FFLAGS="$WRAPPER_FFLAGS $MPICH2_EXTRA_FFLAGS"
+ MPICH2_INTERNAL_F90FLAGS="$WRAPPER_F90FLAGS $MPICH2_EXTRA_F90FLAGS"
export MPICH2_INTERNAL_CFLAGS
export MPICH2_INTERNAL_CXXFLAGS
export MPICH2_INTERNAL_FFLAGS
Copied: mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal_util.m4
(from rev 672, mpich2/trunk/confdb/aclocal_util.m4)
===================================================================
--- mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal_util.m4
(rev 0)
+++ mpich2/branches/release/MPICH2_1_0_7/confdb/aclocal_util.m4
2008-03-17 00:49:01 UTC (rev 673)
@@ -0,0 +1,131 @@
+dnl
+dnl PAC_APPEND_UNIQ_TOKEN( VARIABLE_NAME, TOKEN )
+dnl token is defined as string without any blank space in it.
+dnl
+AC_DEFUN(PAC_APPEND_UNIQ_TOKEN,[
+dnl Since PAC_APPEND_UNIQ_TOKEN may be called by PAC_MAKE_UNIQ_STRING
+dnl saved IFS should be in a different variable than MAKE_UNIQ_STRING's.
+dnl Otherwise bad thing will happen.
+save_IFS="$IFS"
+dnl eval flags=\$$1
+flags="[$]$1"
+token=$2
+dnl
+IFS=' '
+match=no
+for flag in $flags ; do
+ if test "$flag" = "$token" ; then
+ match=yes
+ break
+ fi
+done
+if test "$match" = "no" ; then
+ flags="$flags $token"
+fi
+dnl
+dnl eval $1='$flags'
+$1="$flags"
+dnl
+IFS="$save_IFS"
+])dnl
+dnl
+dnl
+dnl PAC_MAKE_UNIQ_STRING - Eliminate the duplicated substrings in the input
+dnl string variable.
+dnl Assumptions:
+dnl 1) substring separator of the input string is blank space.
+dnl 2) the input string does not contain any '\n' or '\&' character.
+dnl
+dnl The function has the following properties:
+dnl 1) preserves the blank space within pair of double and single quotes.
+dnl 2) preserves the order of the unique substring.
+dnl 3) elminated duplicated substring will be later in order.
+dnl
+dnl PAC_MAKE_UNIQ_STRING( VARIABLE_NAME, [REMOVED_NAME] )
+dnl
+dnl Input/Output
+dnl VARIABLE_NAME - name of the variable containing duplicated substrings.
+dnl On output, VARIABLE will contain no duplicated
substring.
+dnl REMOVED_NAME - name of the (optional) variable containing the
elminated
+dnl duplicated substings.
+dnl
+AC_DEFUN(PAC_MAKE_UNIQ_STRING, [
+saveIFS="$IFS"
+dnl eval inflags=\$$1
+inflags="[$]$1"
+dnl Define separator to be used as replacement of blanks in "..." or '...'
+pac_ifs='\&'
+dnl
+dnl For Double Quote: Replace "pppp qqqq" as "pppp&&qqqq"
+dnl
+IFS=$pac_ifs
+dnl Prepend '\&' before beginning '\"', Append '\&' after ending '\"'
+outflags=`echo $inflags | sed -e
's%\"\([^\"]*\)\"%'"$pac_ifs"'&'"$pac_ifs"'%g'`
+dnl
+dnl Use \& as separator to locate "...." where ' ' will be replaced by '\&'
+dnl
+tokens=""
+for outflag in $outflags ; do
+ case $outflag in
+ \"*\")
+ dnl Replace ' ' by $pac_ifs
+ flag=`echo $outflag | sed -e 's/ /'"$pac_ifs"'/g'`
+ tokens=$tokens$flag
+ ;;
+ *)
+ tokens=$tokens$outflag
+ ;;
+ esac
+done
+inflags=$tokens
+dnl
+dnl For Single Quote: Replace 'pppp qqqq' as 'pppp&&qqqq'
+dnl
+IFS=$pac_ifs
+dnl Prepend '\&' before beginning '\'', Append '\&' after ending '\''
+outflags=`echo $inflags | sed -e
"s%\'\([^\']*\)\'%""$pac_ifs""&""$pac_ifs""%g"`
+dnl
+dnl Use \& as separator to locate '....' where ' ' will be replaced by '\&'
+dnl
+tokens=""
+for outflag in $outflags ; do
+ case $outflag in
+ \'*\')
+ dnl Replace ' ' by $pac_ifs
+ flag=`echo $outflag | sed -e 's/ /'"$pac_ifs"'/g'`
+ tokens=$tokens$flag
+ ;;
+ *)
+ tokens=$tokens$outflag
+ ;;
+ esac
+done
+dnl
+dnl Compute the unique token list and duplicated token list.
+dnl
+IFS=' '
+uniqtokens=""
+dupltokens=""
+for token in $tokens ; do
+ match=no
+ for uniqtoken in $uniqtokens ; do
+ if test "$uniqtoken" = "$token" ; then
+ match=yes
+ break
+ fi
+ done
+ if test "$match" = "yes" ; then
+ dupltokens="$dupltokens $token"
+ else
+ uniqtokens="$uniqtokens $token"
+ fi
+done
+dnl Restore $pac_ifs to the original, i.e. ' '.
+uniqflags=`echo $uniqtokens | sed -e 's%'"$pac_ifs"'% %g'`
+duplflags=`echo $dupltokens | sed -e 's%'"$pac_ifs"'% %g'`
+dnl eval $1='$uniqflags'
+$1="$uniqflags"
+ifelse([$2],[],:,[$2="$duplflags"])
+dnl
+IFS="$saveIFS"
+])dnl
Modified: mpich2/branches/release/MPICH2_1_0_7/configure.in
===================================================================
--- mpich2/branches/release/MPICH2_1_0_7/configure.in 2008-03-17
00:14:39 UTC (rev 672)
+++ mpich2/branches/release/MPICH2_1_0_7/configure.in 2008-03-17
00:49:01 UTC (rev 673)
@@ -275,7 +275,7 @@
dnl
AC_ARG_ENABLE(g,
[--enable-g=option - Control the level of debugging support in the MPICH
-implementation. option may be a list of common separated names including
+implementation. option is a list of comma separated names including
none - No debugging
mem - Memory usage tracing
handle - Trace handle operations
@@ -294,9 +294,20 @@
dnl
dnl --enable-fast
AC_ARG_ENABLE(fast,
-[--enable-fast - pick the appropriate options for fast execution. This
- turns off error checking and timing collection],,
-enable_fast=no)
+[--enable-fast=option - Control the level of fast execution in the MPICH
+implementation. option is a list of comma separated names including
+ defopt - Default compiler optimization -O2 for all language bindings.
+ when neither --enable-fast nor --disable-fast is specified.
+ nochkmsg - No error checking and no error messages, i.e.
+ --disable-error-checking and --disable-error-messages.
+ notiming - No timing collection, i.e. --disable-timing.
+ ndebug - Appends -DNDEBUG to CFLAGS.
+ all|yes - "defopt", "nochkmsg", "notiming" and "ndebug" are enabled
+ when --enable-fast is specified without any option.
+ O<n> - Appends default optimization flags, -O<n>, to
+ CFLAGS, FFLAGS, CXXFLAGS, F90FLAGS.
+ none - None of above options, i.e. --disable-fast.
+],,enable_fast=defopt)
dnl
dnl We enable f77 and f90 if we can find compilers for them.
@@ -564,30 +575,81 @@
# We'll set FORTRAN_BINDING to 1 if we support Fortran
FORTRAN_BINDING=0
+# Set up default compiler optimization
+MPI_DEFAULT_COPTS="-O2"
+MPI_DEFAULT_CXXOPTS="-O2"
+MPI_DEFAULT_FOPTS="-O2"
+MPI_DEFAULT_F90OPTS="-O2"
+
+# enable-fast
+# strip off multiple options, separated by commas
+save_IFS="$IFS"
+IFS=","
+for option in $enable_fast ; do
+ case "$option" in
+ defopt)
+ enable_default_optimize=yes
+ ;;
+ nochkmsg)
+ enable_fast_nochkmsg=yes
+ ;;
+ notiming)
+ enable_timing=no
+ ;;
+ ndebug)
+ enable_append_ndebug=yes
+ ;;
+#
+# [BRT] removed the reseting of enable_g so that --with-enable=dbg,meminit
+# can be specified with -enable-fast. This change was largely made for the
+# PETSc folks who want to use --enable-fast to eliminate parameter checking
+# overhead, but also wish to use meminit to eliminate initialization
+# warnings from valgrind.
+#
+ all|yes)
+ enable_default_optimize=yes
+ enable_fast_nochkmsg=yes
+ # Disable timing/logging stuffs
+ enable_timing=no
+ enable_append_ndebug=yes
+ ;;
+ O*)
+ # Allows O<n> where <n> can be [0-9] or ' '.
+ opt_flags=`echo $option | sed -e 's%\(O[0-9] \)%\1%g'`
+ if test -n "$opt_flags" ; then
+ enable_default_optimize=yes
+ MPI_DEFAULT_COPTS="-$option"
+ MPI_DEFAULT_CXXOPTS="-$option"
+ MPI_DEFAULT_FOPTS="-$option"
+ MPI_DEFAULT_F90OPTS="-$option"
+ else
+ AC_MSG_WARN([Unknown value $option for --enable-fast])
+ fi
+ ;;
+ none|no)
+ enable_default_optimize=no
+ enable_fast_nochkmsg=no
+ # Reset timing/logging stuffs to when --enable-timing isn't
specified.
+ enable_timing=default
+ enable_append_ndebug=no
+ ;;
+ *)
+ AC_MSG_WARN([Unknown value $option for --enable-fast])
+ ;;
+ esac
+done
+IFS="$save_IFS"
+
#
----------------------------------------------------------------------------
# Process any enable or with values
# We must do enable-fast first, because it changes the other enable values
-if test "$enable_fast" = "yes" ; then
+if test "$enable_fast_nochkmsg" = "yes" ; then
enable_error_checking=no
enable_error_messages=no
- enable_timing=no
# Export a variable that will allow the test suite to detect that
# MPICH has no error testing
MPICH_FAST=yes
export MPICH_FAST
-#
-# [BRT] removed the reseting of enable_g so that --with-enable=dbg,meminit
-# can be specified with -enable-fast. This change was largely made for the
-# PETSc folks who want to use --enable-fast to eliminate parameter checking
-# overhead, but also wish to use meminit to eliminate initialization
-# warnings from valgrind.
-#
-# enable_g=no
-#
- CFLAGS="$CFLAGS -DNDEBUG"
- CXXFLAGS="$CXXFLAGS -DNDEBUG"
- FFLAGS="$FFLAGS -DNDEBUG"
- F90FLAGS="$F90FLAGS -DNDEBUG"
fi
# error-checking
@@ -942,14 +1004,6 @@
fi
export MPE_THREAD_DEFAULT
-# MPICH2_EXTRA_xFLAGS contains MPICH2LIB_xFLAGS and
-# all the extra compiler flags added by MPICH2.
-# Initial all MPICH2_EXTRA_xFLAGS to empty string.
-MPICH2_EXTRA_CFLAGS=""
-MPICH2_EXTRA_CXXFLAGS=""
-MPICH2_EXTRA_FFLAGS=""
-MPICH2_EXTRA_F90FLAGS=""
-
# enable-g
# strip off multiple options, separated by commas
save_IFS="$IFS"
@@ -957,14 +1011,7 @@
for option in $enable_g ; do
case "$option" in
debug|dbg)
- CFLAGS="$CFLAGS -g"
- CXXFLAGS="$CXXFLAGS -g"
- FFLAGS="$FFLAGS -g"
- F90FLAGS="$F90FLAGS -g"
- MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS -g"
- MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS -g"
- MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS -g"
- MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS -g"
+ enable_append_g=yes
;;
no|none)
;;
@@ -993,28 +1040,11 @@
mutex)
perform_dbgmutex=yes
;;
- ndebug)
- CFLAGS="$CFLAGS -DNDEBUG"
- CXXFLAGS="$CXXFLAGS -DNDEBUG"
- FFLAGS="$FFLAGS -DNDEBUG"
- F90FLAGS="$F90FLAGS -DNDEBUG"
- MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS -DNDEBUG"
- MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS -DNDEBUG"
- MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS -DNDEBUG"
- MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS -DNDEBUG"
- ;;
all|yes)
perform_memtracing=yes
perform_nesttesting=yes
perform_dbglog=yes
- CFLAGS="$CFLAGS -g"
- CXXFLAGS="$CXXFLAGS -g"
- FFLAGS="$FFLAGS -g"
- F90FLAGS="$F90FLAGS -g"
- MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS -g"
- MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS -g"
- MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS -g"
- MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS -g"
+ enable_append_g=yes
perform_meminit=yes
perform_dbgmutex=yes
;;
@@ -1024,6 +1054,35 @@
esac
done
IFS="$save_IFS"
+
+# MPICH2_EXTRA_xFLAGS contains MPICH2LIB_xFLAGS and
+# all the extra compiler flags added by MPICH2.
+# Initial all MPICH2_EXTRA_xFLAGS to empty string.
+MPICH2_EXTRA_CFLAGS=""
+MPICH2_EXTRA_CXXFLAGS=""
+MPICH2_EXTRA_FFLAGS=""
+MPICH2_EXTRA_F90FLAGS=""
+
+if test "$enable_append_g" = "yes" ; then
+ CFLAGS="$CFLAGS -g"
+ CXXFLAGS="$CXXFLAGS -g"
+ FFLAGS="$FFLAGS -g"
+ F90FLAGS="$F90FLAGS -g"
+ MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS -g"
+ MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS -g"
+ MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS -g"
+ MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS -g"
+fi
+if test "$enable_append_ndebug" = "yes" ; then
+ CFLAGS="$CFLAGS -DNDEBUG"
+ CXXFLAGS="$CXXFLAGS -DNDEBUG"
+ FFLAGS="$FFLAGS -DNDEBUG"
+ F90FLAGS="$F90FLAGS -DNDEBUG"
+ MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS -DNDEBUG"
+ MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS -DNDEBUG"
+ MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS -DNDEBUG"
+ MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS -DNDEBUG"
+fi
if test -n "$perform_meminit" ; then
AC_DEFINE(MPICH_DEBUG_MEMINIT,1,[Define to enable
preinitialization of memory used by structures and unions])
fi
@@ -1349,11 +1408,6 @@
AC_SUBST(mpe_dir)
AC_SUBST(other_install_dirs)
-AC_ARG_ENABLE(default-optimization,
-[--enable-default-optimization - Turn on default compiler optimization
- in building MPICH2 libraries, default is -O2],
-default_optimization=$enableval,default_optimization=yes)
-
dnl
dnl The recommended order for items in a configure.in file is
dnl check for programs
@@ -1399,18 +1453,6 @@
CFLAGS=$saveCFLAGS
fi
-# Check if $MPICH2LIB_CFLAGS is valid with $CC
-MPI_DEFAULT_COPTS="-O2"
-if test "$default_optimization" = "yes" ; then
- MPICH2LIB_CFLAGS="$MPICH2LIB_CFLAGS $MPI_DEFAULT_COPTS"
-fi
-if test -n "$MPICH2LIB_CFLAGS" ; then
- PAC_C_CHECK_COMPILER_OPTION( [$MPICH2LIB_CFLAGS], [
- CFLAGS="$CFLAGS $MPICH2LIB_CFLAGS"
- MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $MPICH2LIB_CFLAGS"
- ] )
-fi
-
# Check whether shared libraries are enabled. We need to know this
# before we start chosing the Fortran, Fortran 90, and C++ compilers
ENABLE_SHLIB=$enable_sharedlibs
@@ -1436,6 +1478,27 @@
if test -n "$pac_cc_strict_flags" ; then
MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $pac_cc_strict_flags"
fi
+
+# Check if $MPI_DEFAULT_COPTS is valid with $CC
+if test "$enable_default_optimize" = "yes" \
+ -a -n "$MPI_DEFAULT_COPTS" ; then
+ PAC_C_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_COPTS], [
+ CFLAGS="$CFLAGS $MPI_DEFAULT_COPTS"
+ MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $MPI_DEFAULT_COPTS"
+ ] )
+fi
+# Up till here, MPICH2_EXTRA_CFLAGS contains only flags added by MPICH2.
+# Check with "grep -n MPICH2_EXTRA_CFLAGS configure.in"
+# Remove duplicated flags from MPICH2_EXTRA_CFLAGS.
+PAC_MAKE_UNIQ_STRING([MPICH2_EXTRA_CFLAGS])
+# Check if $MPICH2LIB_CFLAGS is valid with $CC
+if test -n "$MPICH2LIB_CFLAGS" ; then
+ PAC_C_CHECK_COMPILER_OPTION( [$MPICH2LIB_CFLAGS], [
+ CFLAGS="$CFLAGS $MPICH2LIB_CFLAGS"
+ MPICH2_EXTRA_CFLAGS="$MPICH2_EXTRA_CFLAGS $MPICH2LIB_CFLAGS"
+ ] )
+fi
+
# Check for support for weak symbols. If not found, set NO_WEAK_SYM
# to the Make target name understood by simplemake.
# Set NEEDSPLIB to yes if link commands need both -l$MPILIBNAME
@@ -1516,12 +1579,20 @@
FFLAGS=$saveFFLAGS
fi
-# Check if $MPICH2LIB_FFLAGS is valid with $F77
if test "$enable_f77" = yes ; then
- MPI_DEFAULT_FOPTS="-O2"
- if test "$default_optimization" = "yes" ; then
- MPICH2LIB_FFLAGS="$MPICH2LIB_FFLAGS $MPI_DEFAULT_FOPTS"
+ # Check if $MPI_DEFAULT_FOPTS is valid with $F77
+ if test "$enable_default_optimize" = "yes" \
+ -a -n "$MPI_DEFAULT_FOPTS" ; then
+ PAC_F77_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_FOPTS], [
+ FFLAGS="$FFLAGS $MPI_DEFAULT_FOPTS"
+ MPICH2_EXTRA_FFLAGS="$MPICH2_EXTRA_FFLAGS $MPI_DEFAULT_FOPTS"
+ ] )
fi
+ # Up till here, MPICH2_EXTRA_FFLAGS contains only flags added by
MPICH2.
+ # Check with "grep -n MPICH2_EXTRA_FFLAGS configure.in"
+ # Remove duplicated flags from MPICH2_EXTRA_FFLAGS.
+ PAC_MAKE_UNIQ_STRING([MPICH2_EXTRA_FFLAGS])
+ # Check if $MPICH2LIB_FFLAGS is valid with $F77
if test -n "$MPICH2LIB_FFLAGS" ; then
PAC_F77_CHECK_COMPILER_OPTION( [$MPICH2LIB_FFLAGS], [
FFLAGS="$FFLAGS $MPICH2LIB_FFLAGS"
@@ -1902,11 +1973,19 @@
F90EXT=$pac_cv_f90_ext
AC_SUBST(F90EXT)
+ # Check if $MPI_DEFAULT_F90OPTS is valid with $F90
+ if test "$enable_default_optimize" = "yes" \
+ -a -n "$MPI_DEFAULT_F90OPTS" ; then
+ PAC_F90_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_F90OPTS], [
+ F90FLAGS="$F90FLAGS $MPI_DEFAULT_F90OPTS"
+ MPICH2_EXTRA_F90FLAGS="$MPICH2_EXTRA_F90FLAGS
$MPI_DEFAULT_F90OPTS"
+ ] )
+ fi
+ # Up till here, MPICH2_EXTRA_F90FLAGS contains only flags added by
MPICH2.
+ # Check with "grep -n MPICH2_EXTRA_F90FLAGS configure.in"
+ # Remove duplicated flags from MPICH2_EXTRA_F90FLAGS.
+ PAC_MAKE_UNIQ_STRING([MPICH2_EXTRA_F90FLAGS])
# Check if $MPICH2LIB_F90FLAGS works with $F90
- MPI_DEFAULT_F90OPTS="-O2"
- if test "$default_optimization" = "yes" ; then
- MPICH2LIB_F90FLAGS="$MPICH2LIB_F90FLAGS $MPI_DEFAULT_F90OPTS"
- fi
if test -n "$MPICH2LIB_F90FLAGS" ; then
PAC_F90_CHECK_COMPILER_OPTION( [$MPICH2LIB_F90FLAGS], [
F90FLAGS="$F90FLAGS $MPICH2LIB_F90FLAGS"
@@ -2274,10 +2353,19 @@
fi
if test "$enable_cxx" = yes; then
- MPI_DEFAULT_CXXOPTS="-O2"
- if test "$default_optimization" = "yes" ; then
- MPICH2LIB_CXXFLAGS="$MPICH2LIB_CXXFLAGS $MPI_DEFAULT_CXXOPTS"
+ # Check if $MPI_DEFAULT_CXXOPTS is valid with $CXX
+ if test "$enable_default_optimize" = "yes" \
+ -a -n "$MPI_DEFAULT_CXXOPTS" ; then
+ PAC_CXX_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_CXXOPTS], [
+ CXXFLAGS="$CXXFLAGS $MPI_DEFAULT_CXXOPTS"
+ MPICH2_EXTRA_CXXFLAGS="$MPICH2_EXTRA_CXXFLAGS
$MPI_DEFAULT_CXXOPTS"
+ ] )
fi
+ # Up till here, MPICH2_EXTRA_CXXFLAGS contains only flags added by
MPICH2.
+ # Check with "grep -n MPICH2_EXTRA_CXXFLAGS configure.in"
+ # Remove duplicated flags from MPICH2_EXTRA_CXXFLAGS.
+ PAC_MAKE_UNIQ_STRING([MPICH2_EXTRA_CXXFLAGS])
+ # Check if $MPICH2LIB_CXXFLAGS is valid with $CXX
if test -n "$MPICH2LIB_CXXFLAGS" ; then
PAC_CXX_CHECK_COMPILER_OPTION( [$MPICH2LIB_CXXFLAGS], [
CXXFLAGS="$CXXFLAGS $MPICH2LIB_CXXFLAGS"
Modified:
mpich2/branches/release/MPICH2_1_0_7/doc/installguide/install.tex.vin
===================================================================
---
mpich2/branches/release/MPICH2_1_0_7/doc/installguide/install.tex.vin
2008-03-17 00:14:39 UTC (rev 672)
+++
mpich2/branches/release/MPICH2_1_0_7/doc/installguide/install.tex.vin
2008-03-17 00:49:01 UTC (rev 673)
@@ -483,34 +483,49 @@
\subsection{Compiler Optimization Levels}
-MPICH2 uses two sets of flags: \texttt{CFLAGS} (and family --
-\texttt{CXXFLAGS}, \texttt{FFLAGS}, \texttt{F90FLAGS}) and
-\texttt{MPICH2LIB_CFLAGS} (and family) for compilation;
-\texttt{LDFLAGS} and \texttt{MPICH2LIB_LDFLAGS} for linking. All these
-flags can be set through environment variables during configure.
+MPICH2 can be configured with two sets of compiler flags:
+\texttt{CFLAGS}, \texttt{CXXFLAGS}, \texttt{FFLAGS}, \texttt{F90FLAGS}
+(abbreviated as \texttt{xFLAGS}) and \texttt{MPICH2LIB\_CFLAGS},
+\texttt{MPICH2LIB\_CXXFLAGS}, \texttt{MPICH2LIB\_FFLAGS},
+\texttt{MPICH2LIB\_F90FLAGS} (abbreviated as \texttt{MPICH2LIB\_xFLAGS})
+for compilation; \texttt{LDFLAGS} and \texttt{MPICH2LIB\_LDFLAGS} for
linking.
+All these flags can be set as part of configure command or
+through environment variables.
+(\texttt{CPPFLAGS} stands for C preprocessor flags, which should NOT be
set)
-Both \texttt{CFLAGS} and \texttt{MPICH2LIB_CFLAGS} affect the
-compilation of the MPICH2 library. However, only \texttt{CFLAGS} is
-appended to mpicc.
+Both \texttt{xFLAGS} and \texttt{MPICH2LIB\_xFLAGS} affect the compilation
+of the MPICH2 libraries. However, only \texttt{xFLAGS} is appended to
+MPI wrapper scripts, \texttt{mpicc} and friends.
-By default, \texttt{MPICH2LIB_CFLAGS} are set to -O2. If the user
-specifies any other flags, they are appended to this default flag. The
-default flag can be disabled with the configure option
-\texttt{--disable-default-optimization}. \texttt{CFLAGS} is empty by
-default.
+MPICH2 libraries are built with default compiler optimization, -O2,
+which can be modified by --enable-fast configure option. For instance,
+--disable-fast disables the default optimization option.
+--enable-fast=O<n> sets default compiler optimization as -O<n>.
+For more details of --enable-fast, see the output of "configure --help".
+Any other complicated optimization flags for MPICH2 libraries have
+to be set throught \texttt{MPICH2LIB\_xFLAGS}. \texttt{CFLAGS} and friends
+are empty by default.
-For example, to build a {\em production} MPICH2 in a GNU environment,
-you may want to do:
+For example, to build a "production" MPICH2 environment with -O3 for all
+language bindings, one can simply do
\begin{verbatim}
- setenv MPICH2LIB_CFLAGS -O3
- ./configure --disable-default-optimization
+ ./configure --enable-fast=O3
\end{verbatim}
-This will cause the MPICH2 library to be built with -O3, and -O3 will
-not be included in the mpicc script.
+or
+\begin{verbatim}
+ ./configure --disable-fast MPICH2LIB_CFLAGS=-O3 \
+ MPICH2LIB_FFLAGS=-O3 \
+ MPICH2LIB_CXXFLAGS=-O3 \
+ MPICH2LIB_F90FLAGS=-O3
+\end{verbatim}
+This will cause the MPICH2 libraries to be built with -O3, and -O3 will
+not be included in the mpicc and other MPI wrapper script.
+
+
\subsection{Common Non-Default Configuration Options}
\label{sec:non-default}