diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-10-04 14:23:14 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-10-04 14:23:14 +0000 |
commit | 8719986292a076af51f9f4737aa719384dc870e8 (patch) | |
tree | c288000488c2ea98e9ddc1655a93dd8f97bb3b8a | |
parent | e076f0a4f2c6544b82c057476fd713d37989852a (diff) |
Fix configuration of Cactus with Globus (MPICH-G2) device.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4165 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | lib/make/extras/MPI/MPICH | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/lib/make/extras/MPI/MPICH b/lib/make/extras/MPI/MPICH index 3fde6f2d..48be672b 100644 --- a/lib/make/extras/MPI/MPICH +++ b/lib/make/extras/MPI/MPICH @@ -6,7 +6,7 @@ # @desc # Configuration options for MPI=MPICH # @enddesc -# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/extras/MPI/MPICH,v 1.22 2005-02-04 11:58:14 tradke Exp $ +# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/extras/MPI/MPICH,v 1.23 2005-10-04 14:23:14 tradke Exp $ # @@*/ @@ -85,29 +85,43 @@ case "$MPICH_DEVICE" in globus) ############################# Globus device ################################## -# We use the Makefile.mpich to obtain the include and library paths and libs -# for Globus. These are already prefixed by -I, -L, and -l resp. so we have to -# get rid of these. The Cactus makefile will add them later again. - if test -z "$GLOBUS_LIB_DIR" ; then - echo ' GLOBUS selected, but GLOBUS_LIB_DIR not set !' +# We use the globus-makefile-header command to obtain the include and +# library paths and libs for Globus. + if test -z "$GLOBUS_LOCATION"; then + echo 'MPICH_DEVICE globus selected by GLOBUS_LOCATION not set' exit 2 fi - GLOBUS_MPICH_MAKEFILE="$GLOBUS_LIB_DIR/../etc/Makefile.mpich" - if test ! -r "$GLOBUS_MPICH_MAKEFILE" ; then - echo " No Makefile \"$GLOBUS_MPICH_MAKEFILE\" found !" - echo ' Did you set GLOBUS_LIB_DIR correctly ?' + if test ! -x "$GLOBUS_LOCATION/sbin/gpt-flavor-configuration" -o \ + ! -x "$GLOBUS_LOCATION/bin/globus-makefile-header"; then + echo "Couldn't find globus setup programs in GLOBUS_LOCATION '$GLOBUS_LOCATION'" exit 2 fi - GLOBUS_INC_DIRS=`${MAKE-make} -s -f $GLOBUS_MPICH_MAKEFILE userincdir` - GLOBUS_INC_DIRS=`echo " $GLOBUS_INC_DIRS" | sed -e 's/ -I/ /g'` - MPICH_INC_DIRS="$MPICH_INC_DIRS $GLOBUS_INC_DIRS" + # if GLOBUS_FLAVOR is not set, choose the first flavor found + if test -z "$GLOBUS_FLAVOR"; then + GLOBUS_FLAVOR=`$GLOBUS_LOCATION/sbin/gpt-flavor-configuration | grep ':$' | head -n 1 | sed 's/:$//g'` + fi - GLOBUS_LIB_DIRS=`${MAKE-make} -s -f $GLOBUS_MPICH_MAKEFILE userlibpath` - MPICH_DEVICE_LIB_DIR=`echo " $GLOBUS_LIB_DIRS" | sed -e 's/ -L/ /g'` + # query the makefile settings used to build a globus program + globus_query_cmd="$GLOBUS_LOCATION/bin/globus-makefile-header -flavor=$GLOBUS_FLAVOR globus_nexus globus_ftp_control globus_duroc_runtime" + eval "$globus_query_cmd &> /dev/null" + if test $? != 0; then + if test -n "$GLOBUS_FLAVOR"; then + echo "Invalid GLOBUS_FLAVOR '$GLOBUS_FLAVOR' specified" + else + echo 'No globus flavor found' + fi + exit 2 + fi + + # now figure out the individual flags... + GLOBUS_INC_DIRS=`$globus_query_cmd | grep GLOBUS_INCLUDES | sed 's/GLOBUS_INCLUDES =//' | sed 's/ -I/ /g'` + GLOBUS_LIB_DIRS=`$globus_query_cmd | grep GLOBUS_LDFLAGS | sed 's/GLOBUS_LDFLAGS =//' | sed 's/ -L/ /g'` + GLOBUS_LIBS=` $globus_query_cmd | grep GLOBUS_PKG_LIBS | sed 's/GLOBUS_PKG_LIBS =//' | sed 's/ -l/ /g'` - GLOBUS_LIBS=`${MAKE-make} -s -f $GLOBUS_MPICH_MAKEFILE userlib` - MPICH_DEVICE_LIBS=`echo " $GLOBUS_LIBS" | sed -e 's/ -l/ /g'` + MPICH_INC_DIRS="$MPICH_INC_DIRS $GLOBUS_INC_DIRS" + MPICH_DEVICE_LIB_DIR="$GLOBUS_LIB_DIRS" + MPICH_DEVICE_LIBS="$GLOBUS_LIBS" ;; ch_gm) @@ -143,7 +157,9 @@ case "$MPICH_DEVICE" in esac # Work out what the MPICH library is called -if test -r "$MPICH_LIB_DIRS/libmpi.a" ; then +if test "$MPICH_DEVICE" = 'globus'; then + MPICH_LIB='mpichg2' +elif test -r "$MPICH_LIB_DIRS/libmpi.a" ; then MPICH_LIB='mpi' else MPICH_LIB='mpich' |