summaryrefslogtreecommitdiff
path: root/lib/make/extras/MPI
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-21 12:25:02 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-21 12:25:02 +0000
commit003f061973eacadb509d9910a333e00be0c16635 (patch)
tree4bd59f6b10eb4509b6e54af568f535011626cb09 /lib/make/extras/MPI
parentebeaa68430da4417c6de5113b7c17a63a3baf0f9 (diff)
I've re-done the MPI stuff to make it more flexible. It is now easy to add other
extra packages, e.g. PVM, without having to rerun autoconf. Basically 'configure' now looks in a directory called 'extras', and for every subdirectory of that is checks for the presence of an executable file call 'setup.sh' which can do configuration stuff. 'setup.sh' should put extra definitions in a file called 'cctk_extradefs.h' and extra make stuff in 'make.extra.defn'. To help this process there is a function CCTK_WriteLine which takes two arguments, the name of the file, and what to write. E.g. CCTK_WriteLine cctk_extradefs.h "#define MPI" and CCTK_WriteLine make.extra.defn 'LIBS += $(MPI_LIBS)' with the usual shell expansions happening. To help search for files and things there is function CCTK_Search which takes four arguments - the name of a variable - a list of names - a filename - an (optional) basename E.g. CCTK_Search MPI_DEVICE "ch_shmem ch_p4 globus" lib $MPICH_DIR/build would look for directories called ch_shmem or ch_p4 or globus containing a file or directory called 'lib' and all this would be done in the directory $MPICH_DIR/build. On return from the function the value of MPI_DEVICE would be ch_shmem, ch_p4, globus, or empty depending on which one was found first. So, to add an optional extra package: - add a directory with its name under lib/make/extras - in this directory add an executable shell file called setup.sh - in this file check if the extra thing is enabled, check for any configuration things and add them to cctk_extradefs.h or make.extra.defn as necessary. Note you will need to do a cvs update -d to get the new directories I've just added. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@752 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/extras/MPI')
-rw-r--r--lib/make/extras/MPI/CUSTOM19
-rw-r--r--lib/make/extras/MPI/LAM25
-rw-r--r--lib/make/extras/MPI/MPICH85
-rw-r--r--lib/make/extras/MPI/NATIVE17
-rwxr-xr-xlib/make/extras/MPI/setup.sh42
5 files changed, 188 insertions, 0 deletions
diff --git a/lib/make/extras/MPI/CUSTOM b/lib/make/extras/MPI/CUSTOM
new file mode 100644
index 00000000..d77b6329
--- /dev/null
+++ b/lib/make/extras/MPI/CUSTOM
@@ -0,0 +1,19 @@
+#! /bin/sh
+# /*@@
+# @file CUSTOM
+# @date Wed Jul 21 13:27:07 1999
+# @author Tom Goodale
+# @desc
+#
+# @enddesc
+# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/extras/MPI/CUSTOM,v 1.1 1999-07-21 12:25:01 goodale Exp $
+# @@*/
+
+
+# Allow the user to completely specify at the command line,
+echo "Custom MPI selected"
+
+MPI_LIBS="$MPI_LIBS"
+MPI_LIB_DIRS="$MPI_LIB_DIRS"
+MPI_INC_DIRS="$MPI_INC_DIRS"
+
diff --git a/lib/make/extras/MPI/LAM b/lib/make/extras/MPI/LAM
new file mode 100644
index 00000000..e07e04d5
--- /dev/null
+++ b/lib/make/extras/MPI/LAM
@@ -0,0 +1,25 @@
+#! /bin/sh
+# /*@@
+# @file LAM
+# @date Wed Jul 21 13:27:07 1999
+# @author Tom Goodale
+# @desc
+#
+# @enddesc
+# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/extras/MPI/LAM,v 1.1 1999-07-21 12:25:02 goodale Exp $
+# @@*/
+
+echo "LAM selected"
+
+if test -z "$LAM_DIR" ; then
+ echo "LAM selected but no LAM_DIR set... Checking some places"
+ CCTK_Search LAM_DIR "/usr /usr/local /usr/local/lam /usr/local/packages/lam /usr/local/apps/lam" h/lam.h
+ if test -z "$LAM_DIR" ; then
+ echo "Unable to locate the LAM directory - please set LAM_DIR"
+ exit 2
+ fi
+fi
+
+MPI_LIBS="mpi tstdio args t trillium "
+MPI_LIB_DIRS="$LAM_DIR/lib"
+MPI_INC_DIRS="$LAM_DIR/h"
diff --git a/lib/make/extras/MPI/MPICH b/lib/make/extras/MPI/MPICH
new file mode 100644
index 00000000..3f7faff1
--- /dev/null
+++ b/lib/make/extras/MPI/MPICH
@@ -0,0 +1,85 @@
+#! /bin/sh
+# /*@@
+# @file CUSTOM
+# @date Wed Jul 21 13:27:07 1999
+# @author Tom Goodale
+# @desc
+#
+# @enddesc
+# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/extras/MPI/MPICH,v 1.1 1999-07-21 12:25:02 goodale Exp $
+# @@*/
+
+
+echo "MPICH selected"
+
+# MPICH is pretty configerable itself
+
+# Find the directory.
+if test -z "$MPICH_DIR" ; then
+ echo "MPICH selected but no MPICH_DIR set... Checking some places"
+ CCTK_Search MPICH_DIR "/usr /usr/local /usr/local/mpich /usr/local/packages/mpich /usr/local/apps/mpich" include/mpe.h
+ if test -z "$MPICH_DIR" ; then
+ echo "Unable to locate the MPICH directory - please set MPICH_DIR"
+ exit 2
+ fi
+fi
+
+# Find the MPICH architecture
+
+if test -x "$MPICH_DIR/bin/tarch" ; then
+ MPICH_ARCH=`$MPICH_DIR/bin/tarch`
+ echo "MPICH architecture is $MPICH_ARCH"
+else
+ echo "Cannot execute $MPICH_DIR/bin/tarch"
+ exit 2
+fi
+
+# Find the MPICH device
+
+if test -z "$MPICH_DEVICE" ; then
+ echo "MPICH selected but no MPICH_DEVICE set... Checking for one"
+ CCTK_Search MPICH_DEVICE "ch_shmem ch_p4 globus" lib $MPICH_DIR/build/$MPICH_ARCH/$MPICH_DEVICE
+ if test -z "$MPICH_DEVICE" ; then
+ echo "Unable to locate the MPICH device - please set MPICH_DEVICE"
+ exit 2
+ fi
+fi
+
+
+# Select the device and any special options for it.
+
+case "$MPICH_DEVICE" in
+ globus)
+ if test -z "$GLOBUS_DIR" ; then
+ echo "GLOBUS selected, but GLOBUS_DIR not set !"
+ exit 2
+ fi
+ MPICH_DEVICE_LIB_DIR="$GLOBUS_DIR"
+ MPICH_DEVICE_LIBS="globus_common globus_dc globus_duct_control \
+ globus_duct_runtime globus_duroc_bootstrap globus_duroc_control\
+ globus_duroc_runtime globus_gass_cache globus_gass_client \
+ globus_gass_file globus_gass_server globus_gass_server_ez \
+ globus_gram_client globus_gram_myjob globus_gss globus_gss_assist \
+ globus_hbm_client globus_hbm_datacollector globus_mp globus_nexus \
+ globus_rsl globus_utp lber ldap ldif netperf"
+ ;;
+ *)
+ MPICH_DEVICE_LIB_DIR=""
+ MPICH_DEVICE_LIBS=""
+ ;;
+esac
+
+# Work out what the MPICH library is called
+
+if test -r "$MPICH_DIR/build/$MPICH_ARCH/$MPICH_DEVICE/lib/libmpi.a" ; then
+ MPICH_LIB=mpi
+else
+ MPICH_LIB=mpich
+fi
+
+# Finally set the library lines.
+
+MPI_LIBS="$MPICH_LIB $MPICH_DEVICE_LIBS"
+MPI_LIB_DIRS="$MPICH_DEVICE_LIB_DIR $MPICH_DIR/build/$MPICH_ARCH/$MPICH_DEVICE/lib"
+MPI_INC_DIRS="$MPICH_DIR/include $MPICH_DIR/build/$MPICH_ARCH/$MPICH_DEVICE/include"
+
diff --git a/lib/make/extras/MPI/NATIVE b/lib/make/extras/MPI/NATIVE
new file mode 100644
index 00000000..4c397599
--- /dev/null
+++ b/lib/make/extras/MPI/NATIVE
@@ -0,0 +1,17 @@
+#! /bin/sh
+# /*@@
+# @file NATIVE
+# @date Wed Jul 21 13:27:07 1999
+# @author Tom Goodale
+# @desc
+#
+# @enddesc
+# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/extras/MPI/NATIVE,v 1.1 1999-07-21 12:25:02 goodale Exp $
+# @@*/
+
+echo "Native MPI selected"
+
+# This should be filled out by the know-architecture stuff.
+MPI_LIBS=""
+MPI_LIB_DIRS=""
+MPI_INC_DIRS=""
diff --git a/lib/make/extras/MPI/setup.sh b/lib/make/extras/MPI/setup.sh
new file mode 100755
index 00000000..abc054af
--- /dev/null
+++ b/lib/make/extras/MPI/setup.sh
@@ -0,0 +1,42 @@
+#! /bin/sh
+# /*@@
+# @file setup.sh
+# @date Wed Jul 21 11:18:40 1999
+# @author Tom Goodale
+# @desc
+# Setup MPI
+# @enddesc
+# @version $Header$
+# @@*/
+
+if test -n "$MPI" ; then
+
+echo "Configuring with MPI"
+
+CCTK_WriteLine cctk_extradefs.h "#define MPI"
+
+# Work out which variation of MPI is installed
+
+if test -r $srcdir/extras/MPI/$MPI ; then
+ . $srcdir/extras/MPI/$MPI
+else
+ echo "MPI selected, but no known MPI method - what is $MPI ?"
+ exit 2
+fi
+
+# Write the data out to the header and make files.
+
+CCTK_WriteLine make.extra.defn "MPI_LIBS = $MPI_LIBS"
+CCTK_WriteLine make.extra.defn "MPI_LIB_DIRS = $MPI_LIB_DIRS"
+CCTK_WriteLine make.extra.defn "MPI_INC_DIRS = $MPI_INC_DIRS"
+
+CCTK_WriteLine make.extra.defn ""
+CCTK_WriteLine make.extra.defn ""
+
+CCTK_WriteLine make.extra.defn 'LIBS += $(MPI_LIBS)'
+CCTK_WriteLine make.extra.defn 'LIBDIRS += $(MPI_LIB_DIRS)'
+CCTK_WriteLine make.extra.defn 'SYS_INC_DIRS += $(MPI_INC_DIRS)'
+
+fi
+
+