summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/make/CCTK_Functions.sh66
-rw-r--r--lib/make/config.h.in8
-rwxr-xr-xlib/make/configure278
-rw-r--r--lib/make/configure.in188
-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
-rw-r--r--lib/make/make.config.defn.in18
10 files changed, 389 insertions, 357 deletions
diff --git a/lib/make/CCTK_Functions.sh b/lib/make/CCTK_Functions.sh
new file mode 100644
index 00000000..ad500fb5
--- /dev/null
+++ b/lib/make/CCTK_Functions.sh
@@ -0,0 +1,66 @@
+#! /bin/sh
+# /*@@
+# @file CCTK_Functions.sh
+# @date Wed Jul 21 11:16:06 1999
+# @author Tom Goodale
+# @desc
+#
+# @enddesc
+# @version $Header$
+#
+# @@*/
+
+
+# /*@@
+# @routine CCTK_Search
+# @date Wed Jul 21 11:16:35 1999
+# @author Tom Goodale
+# @desc
+# Used to search for something in various directories
+# @enddesc
+# @calls
+# @calledby
+# @history
+#
+# @endhistory
+#
+#@@*/
+
+function CCTK_Search()
+{
+ eval $1=""
+ if test -z $4 ; then
+ cctk_basedir=""
+ else
+ cctk_basedir="$4/"
+ fi
+ for cctk_place in $2
+ do
+ echo $ac_n "Looking in $cctk_place""...$ac_c" #1>&6
+ if test -r "$cctk_basedir$cctk_place/$3" ; then
+ echo "$ac_t""...Found" #1>&6
+ eval $1="$cctk_place"
+ break
+ fi
+ if test -d "$cctk_basedir$cctk_place/$3" ; then
+ echo "$ac_t""...Found" #1>&6
+ eval $1="$cctk_place"
+ break
+ fi
+ echo "$ac_t""No" #1>&6
+ done
+
+ return
+}
+
+function CCTK_CreateFile
+{
+ echo $2 > $1
+ return
+}
+
+function CCTK_WriteLine
+{
+ echo $2 >> $1
+ return
+}
diff --git a/lib/make/config.h.in b/lib/make/config.h.in
index 788c514f..6b8c4ccc 100644
--- a/lib/make/config.h.in
+++ b/lib/make/config.h.in
@@ -57,11 +57,6 @@
#undef FMODIFIER
-/******************************************************************************
- *********************** MPI stuff ********************************************
- ******************************************************************************/
-
-#undef MPI
/******************************************************************************/
@@ -104,4 +99,7 @@ typedef CCTK_INT4 Int;
/* Include any other stuff which is specific to this architecture */
#include "cctk_archdefs.h"
+/* Include any extra stuff from optional extra packages. */
+#include "cctk_extradefs.h"
+
#endif /* _CONFIG_H_ */
diff --git a/lib/make/configure b/lib/make/configure
index caf98b3f..d3cff346 100755
--- a/lib/make/configure
+++ b/lib/make/configure
@@ -1340,152 +1340,48 @@ if test -z "$LD" ; then
LD=$CXX
fi
+# Include some CCTK auxiliary functions
-if test -n "$MPI" ; then
+. $srcdir/CCTK_Functions.sh
-echo "Configuring with MPI"
-
-cat >> confdefs.h <<\EOF
-#define MPI 1
+#########################################################################
+#Check for extra stuff
+#########################################################################
+cat > cctk_extradefs.h <<EOF
+/* Stuff from extra packages */
+#ifndef _CCTK_EXTRADEFS_H_
+#define _CCTK_EXTRADEFS_H_
EOF
+cat > make.extra.defn <<EOF
+# Stuff from extra packages
+EOF
-case "$MPI" in
- MPICH)
-
- # MPICH is pretty configerable itself
- if test -z "$MPICH_DIR" ; then
- echo "MPICH selected but no MPICH_DIR set... Checking some places"
-
- DIR_FOUND=""
- for MPICH_DIR in /usr /usr/local /usr/local/mpich /usr/local/packages/mpich /usr/local/apps/mpich
- do
- echo $ac_n "Looking in $MPICH_DIR""...$ac_c" 1>&6
- if test -r "$MPICH_DIR/include/mpe.h" ; then
- echo "$ac_t""...Found" 1>&6
- DIR_FOUND="yes"
- break
- fi
- echo "$ac_t""No" 1>&6
- done
-
- if test -z "$DIR_FOUND" ; then
- echo "Unable to locate the MPICH directory - please set MPICH_DIR"
- exit 2
- fi
- fi
-
- 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
-
- if test -z "$MPICH_DEVICE" ; then
- echo "MPICH selected but no MPICH_DEVICE set... Checking for one"
-
- DIR_FOUND=""
- for MPICH_DEVICE in ch_shmem ch_p4 globus
- do
- echo $ac_n "Looking for $MPICH_DEVICE""...$ac_c" 1>&6
- if test -d "$MPICH_DIR/build/$MPICH_ARCH/$MPICH_DEVICE" ; then
- echo "$ac_t""...Found" 1>&6
- DIR_FOUND="yes"
- break
- fi
- echo "$ac_t""No" 1>&6
- done
-
- if test -z "$DIR_FOUND" ; then
- echo "Unable to locate the MPICH device - please set MPICH_DEVICE"
- exit 2
- fi
- fi
-
- 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
- if test -r "$MPICH_DIR/build/$MPICH_ARCH/$MPICH_DEVICE/lib/libmpi.a" ; then
- MPICH_LIB=mpi
- else
- MPICH_LIB=mpich
- fi
-
- 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"
-
- ;;
-
- LAM)
- if test -z "$LAM_DIR" ; then
- echo "LAM selected but no LAM_DIR set... Checking some places"
-
- DIR_FOUND=""
- for LAM_DIR in /usr /usr/local /usr/local/lam /usr/local/packages/lam /usr/local/apps/lam
- do
- echo $ac_n "Looking in $LAM_DIR""...$ac_c" 1>&6
- if test -r "$LAM_DIR/h/lam.h" ; then
- echo "$ac_t""...Found" 1>&6
- DIR_FOUND="yes"
- break
- fi
- echo "$ac_t""No" 1>&6
- done
-
- if test -z "$DIR_FOUND" ; then
- echo "Unable to locate the LAM directory - please set LAM_DIR"
- exit 2
- fi
+for extra in `ls $srcdir/extras`
+do
+ if test -d $srcdir/extras/$extra ; then
+ if test -x $srcdir/extras/$extra/setup.sh ; then
+ # Put some comment lines in the files.
+ CCTK_WriteLine cctk_extradefs.h ""
+ CCTK_WriteLine cctk_extradefs.h "/*$extra definitions*/"
+ CCTK_WriteLine make.extra.defn ""
+ CCTK_WriteLine make.extra.defn "# $extra definitions"
+ # Call the setup script
+ . $srcdir/extras/$extra/setup.sh
+ # Put some more comments in
+ CCTK_WriteLine make.extra.defn "#End of $extra definitions"
+ CCTK_WriteLine make.extra.defn ""
fi
-
- MPI_LIBS="mpi tstdio args t trillium "
- MPI_LIB_DIRS="$LAM_DIR/lib"
- MPI_INC_DIRS="$LAM_DIR/h"
-
- ;;
-
- NATIVE)
-
- # This should be filled out by the know-architecture stuff.
- MPI_LIBS=""
- MPI_LIB_DIRS=""
- MPI_INC_DIRS=""
- ;;
-
- *)
- echo "MPI selected, but no known MPI method - what is $withval ?"
- exit 2;
- ;;
-
-esac
-
-fi
-
-
-
+ fi
+done
+# Finish the cctk_extradefs.h file
+cat >> cctk_extradefs.h <<EOF
+#endif /*_CCTK_EXTRADEFS_H_*/
+EOF
+#########################################################################
# If this is a known architecture, setup any specific flags.
# This has to be done here as flags given to the compiler may
# change the things detected later.
@@ -1507,6 +1403,9 @@ cat >> cctk_archdefs.h <<EOF
#endif /* _CCTK_ARCHDEFS_H_ */
EOF
+##########################################################################
+#########################################################################
+
# Deal with the Fortran compiler issues.
# If there's a Fortran 90 compiler use that for all the Fortran.
if test "x$F90" != "x" ; then
@@ -1527,7 +1426,7 @@ LDFLAGS=
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1531: checking how to run the C preprocessor" >&5
+echo "configure:1430: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1542,13 +1441,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1546 "configure"
+#line 1445 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1451: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1559,13 +1458,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1563 "configure"
+#line 1462 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1576,13 +1475,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1580 "configure"
+#line 1479 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1607,12 +1506,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1611: checking for ANSI C header files" >&5
+echo "configure:1510: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1616 "configure"
+#line 1515 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1620,7 +1519,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1624: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1637,7 +1536,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1641 "configure"
+#line 1540 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1655,7 +1554,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1659 "configure"
+#line 1558 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1676,7 +1575,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1680 "configure"
+#line 1579 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1687,7 +1586,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1713,14 +1612,14 @@ fi
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1717: checking whether byte ordering is bigendian" >&5
+echo "configure:1616: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 1724 "configure"
+#line 1623 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -1731,11 +1630,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:1735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 1739 "configure"
+#line 1638 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -1746,7 +1645,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:1750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -1766,7 +1665,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1770 "configure"
+#line 1669 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -1779,7 +1678,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -1803,12 +1702,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1807: checking for working const" >&5
+echo "configure:1706: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1812 "configure"
+#line 1711 "configure"
#include "confdefs.h"
int main() {
@@ -1857,7 +1756,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1878,21 +1777,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1882: checking for inline" >&5
+echo "configure:1781: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1889 "configure"
+#line 1788 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1918,7 +1817,7 @@ EOF
esac
echo $ac_n "checking for long double""... $ac_c" 1>&6
-echo "configure:1922: checking for long double" >&5
+echo "configure:1821: checking for long double" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1929,7 +1828,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1933 "configure"
+#line 1832 "configure"
#include "confdefs.h"
int main() {
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
@@ -1937,7 +1836,7 @@ long double foo = 0.0;
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
exit(sizeof(long double) < sizeof(double)); }
EOF
-if { (eval echo configure:1941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_long_double=yes
else
@@ -1963,7 +1862,7 @@ fi
# Check for sizes of integer types
echo $ac_n "checking size of long int""... $ac_c" 1>&6
-echo "configure:1967: checking size of long int" >&5
+echo "configure:1866: checking size of long int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1971,7 +1870,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1975 "configure"
+#line 1874 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1982,7 +1881,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_int=`cat conftestval`
else
@@ -2002,7 +1901,7 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:2006: checking size of int" >&5
+echo "configure:1905: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2010,7 +1909,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2014 "configure"
+#line 1913 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2021,7 +1920,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -2041,7 +1940,7 @@ EOF
echo $ac_n "checking size of short int""... $ac_c" 1>&6
-echo "configure:2045: checking size of short int" >&5
+echo "configure:1944: checking size of short int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2049,7 +1948,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2053 "configure"
+#line 1952 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2060,7 +1959,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short_int=`cat conftestval`
else
@@ -2082,7 +1981,7 @@ EOF
# Check for sizes of floating point types
echo $ac_n "checking size of long double""... $ac_c" 1>&6
-echo "configure:2086: checking size of long double" >&5
+echo "configure:1985: checking size of long double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2090,7 +1989,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2094 "configure"
+#line 1993 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2101,7 +2000,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_double=`cat conftestval`
else
@@ -2121,7 +2020,7 @@ EOF
echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:2125: checking size of double" >&5
+echo "configure:2024: checking size of double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2129,7 +2028,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2133 "configure"
+#line 2032 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2140,7 +2039,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_double=`cat conftestval`
else
@@ -2160,7 +2059,7 @@ EOF
echo $ac_n "checking size of float""... $ac_c" 1>&6
-echo "configure:2164: checking size of float" >&5
+echo "configure:2063: checking size of float" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2168,7 +2067,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2172 "configure"
+#line 2071 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2179,7 +2078,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_float=`cat conftestval`
else
@@ -2201,7 +2100,7 @@ EOF
# Check for sizes of pointers.
echo $ac_n "checking size of char *""... $ac_c" 1>&6
-echo "configure:2205: checking size of char *" >&5
+echo "configure:2104: checking size of char *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2209,7 +2108,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2213 "configure"
+#line 2112 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2220,7 +2119,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_char_p=`cat conftestval`
else
@@ -2672,9 +2571,6 @@ s%@F77@%$F77%g
s%@AR@%$AR%g
s%@MKDIR@%$MKDIR%g
s%@LD@%$LD%g
-s%@MPI_LIBS@%$MPI_LIBS%g
-s%@MPI_LIB_DIRS@%$MPI_LIB_DIRS%g
-s%@MPI_INC_DIRS@%$MPI_INC_DIRS%g
s%@ARFLAGS@%$ARFLAGS%g
s%@F90FLAGS@%$F90FLAGS%g
s%@F77FLAGS@%$F77FLAGS%g
diff --git a/lib/make/configure.in b/lib/make/configure.in
index 605e4d01..c5b3c6be 100644
--- a/lib/make/configure.in
+++ b/lib/make/configure.in
@@ -72,165 +72,48 @@ AC_SUBST(LD)
LD=$CXX
fi
-dnl Has the user asked for MPI ?
+# Include some CCTK auxiliary functions
-if test -n "$MPI" ; then
+. $srcdir/CCTK_Functions.sh
-echo "Configuring with MPI"
-
-AC_DEFINE(MPI)
-
-case "$MPI" in
-
- CUSTOM)
- # 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"
-
- ;;
-
- MPICH)
-
- echo "MPICH selected"
- # MPICH is pretty configerable itself
- if test -z "$MPICH_DIR" ; then
- echo "MPICH selected but no MPICH_DIR set... Checking some places"
-
- DIR_FOUND=""
- for MPICH_DIR in /usr /usr/local /usr/local/mpich /usr/local/packages/mpich /usr/local/apps/mpich
- do
- echo $ac_n "Looking in $MPICH_DIR""...$ac_c" 1>&6
- if test -r "$MPICH_DIR/include/mpe.h" ; then
- echo "$ac_t""...Found" 1>&6
- DIR_FOUND="yes"
- break
- fi
- echo "$ac_t""No" 1>&6
- done
-
- if test -z "$DIR_FOUND" ; then
- echo "Unable to locate the MPICH directory - please set MPICH_DIR"
- exit 2
- fi
- fi
-
- 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
-
- if test -z "$MPICH_DEVICE" ; then
- echo "MPICH selected but no MPICH_DEVICE set... Checking for one"
-
- DIR_FOUND=""
- for MPICH_DEVICE in ch_shmem ch_p4 globus
- do
- echo $ac_n "Looking for $MPICH_DEVICE""...$ac_c" 1>&6
- if test -d "$MPICH_DIR/build/$MPICH_ARCH/$MPICH_DEVICE" ; then
- echo "$ac_t""...Found" 1>&6
- DIR_FOUND="yes"
- break
- fi
- echo "$ac_t""No" 1>&6
- done
-
- if test -z "$DIR_FOUND" ; then
- echo "Unable to locate the MPICH device - please set MPICH_DEVICE"
- exit 2
- fi
- fi
+#########################################################################
+#Check for extra stuff
+#########################################################################
+cat > cctk_extradefs.h <<EOF
+/* Stuff from extra packages */
+#ifndef _CCTK_EXTRADEFS_H_
+#define _CCTK_EXTRADEFS_H_
+EOF
- 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
- if test -r "$MPICH_DIR/build/$MPICH_ARCH/$MPICH_DEVICE/lib/libmpi.a" ; then
- MPICH_LIB=mpi
- else
- MPICH_LIB=mpich
- fi
+cat > make.extra.defn <<EOF
+# Stuff from extra packages
+EOF
- 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"
-
- ;;
-
- LAM)
- echo "LAM selected"
-
- if test -z "$LAM_DIR" ; then
- echo "LAM selected but no LAM_DIR set... Checking some places"
-
- DIR_FOUND=""
- for LAM_DIR in /usr /usr/local /usr/local/lam /usr/local/packages/lam /usr/local/apps/lam
- do
- echo $ac_n "Looking in $LAM_DIR""...$ac_c" 1>&6
- if test -r "$LAM_DIR/h/lam.h" ; then
- echo "$ac_t""...Found" 1>&6
- DIR_FOUND="yes"
- break
- fi
- echo "$ac_t""No" 1>&6
- done
-
- if test -z "$DIR_FOUND" ; then
- echo "Unable to locate the LAM directory - please set LAM_DIR"
- exit 2
- fi
+for extra in `ls $srcdir/extras`
+do
+ if test -d $srcdir/extras/$extra ; then
+ if test -x $srcdir/extras/$extra/setup.sh ; then
+ # Put some comment lines in the files.
+ CCTK_WriteLine cctk_extradefs.h ""
+ CCTK_WriteLine cctk_extradefs.h "/*$extra definitions*/"
+ CCTK_WriteLine make.extra.defn ""
+ CCTK_WriteLine make.extra.defn "# $extra definitions"
+ # Call the setup script
+ . $srcdir/extras/$extra/setup.sh
+ # Put some more comments in
+ CCTK_WriteLine make.extra.defn "#End of $extra definitions"
+ CCTK_WriteLine make.extra.defn ""
fi
-
- MPI_LIBS="mpi tstdio args t trillium "
- MPI_LIB_DIRS="$LAM_DIR/lib"
- MPI_INC_DIRS="$LAM_DIR/h"
-
- ;;
-
- NATIVE)
-
- echo "Native MPI selected"
- # This should be filled out by the know-architecture stuff.
- MPI_LIBS=""
- MPI_LIB_DIRS=""
- MPI_INC_DIRS=""
- ;;
-
- *)
- echo "MPI selected, but no known MPI method - what is $withval ?"
- exit 2;
- ;;
-
-esac
+ fi
+done
-fi
-
-AC_SUBST(MPI_LIBS)
-AC_SUBST(MPI_LIB_DIRS)
-AC_SUBST(MPI_INC_DIRS)
+# Finish the cctk_extradefs.h file
+cat >> cctk_extradefs.h <<EOF
+#endif /*_CCTK_EXTRADEFS_H_*/
+EOF
+#########################################################################
# If this is a known architecture, setup any specific flags.
# This has to be done here as flags given to the compiler may
# change the things detected later.
@@ -252,6 +135,9 @@ cat >> cctk_archdefs.h <<EOF
#endif /* _CCTK_ARCHDEFS_H_ */
EOF
+##########################################################################
+#########################################################################
+
# Deal with the Fortran compiler issues.
# If there's a Fortran 90 compiler use that for all the Fortran.
if test "x$F90" != "x" ; then
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
+
+
diff --git a/lib/make/make.config.defn.in b/lib/make/make.config.defn.in
index 1f33327a..335e8492 100644
--- a/lib/make/make.config.defn.in
+++ b/lib/make/make.config.defn.in
@@ -11,6 +11,11 @@
# @version $Id$
# @@*/
+# Include stuff defined by optional extra packages
+
+include $(TOP)/config-data/make.extra.defn
+
+
# Compiler/executable info
SHELL = @SHELL@
@@ -66,21 +71,14 @@ F77_DEPEND_OUT = @F77_DEPEND_OUT@
# Command used to get the working directory
GET_WD = @GET_WD@
-# MPI stuff
-
-MPI_LIBS = @MPI_LIBS@
-MPI_LIB_DIRS = @MPI_LIB_DIRS@
-MPI_INC_DIRS = @MPI_INC_DIRS@
-
-
# Library info
-LIBS = $(MPI_LIBS) @LIBS@
-LIBDIRS = $(MPI_LIB_DIRS) @LIBDIRS@
+LIBS += @LIBS@
+LIBDIRS += @LIBDIRS@
# System include directories
-SYS_INC_DIRS = $(MPI_INC_DIRS) @SYS_INC_DIRS@
+SYS_INC_DIRS += @SYS_INC_DIRS@
# Stuff for the architecture