2003-12-22 19:29:21 +03:00
|
|
|
dnl -*- shell-script -*-
|
|
|
|
dnl
|
2004-01-07 10:46:37 +03:00
|
|
|
dnl $HEADER$
|
2003-12-22 19:29:21 +03:00
|
|
|
dnl
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_CONFIGURE_SETUP],[
|
2003-12-22 19:29:21 +03:00
|
|
|
|
|
|
|
# Some helper script functions. Unfortunately, we cannot use $1 kinds
|
|
|
|
# of arugments here because of the m4 substitution. So we have to set
|
|
|
|
# special variable names before invoking the function. :-\
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_show_title() {
|
2003-12-22 19:29:21 +03:00
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
============================================================================
|
|
|
|
== ${1}
|
|
|
|
============================================================================
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_show_subtitle() {
|
2003-12-22 19:29:21 +03:00
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
*** ${1}
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
#
|
|
|
|
# Save some stats about this build
|
|
|
|
#
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_CONFIGURE_USER="`whoami`"
|
|
|
|
OMPI_CONFIGURE_HOST="`hostname | head -n 1`"
|
|
|
|
OMPI_CONFIGURE_DATE="`date`"
|
2004-01-21 02:16:52 +03:00
|
|
|
|
2004-01-19 08:42:58 +03:00
|
|
|
#
|
2004-06-07 19:33:53 +04:00
|
|
|
# Save these details so that they can be used in ompi_info later
|
2004-01-19 08:42:58 +03:00
|
|
|
#
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_SUBST(OMPI_CONFIGURE_USER)
|
|
|
|
AC_SUBST(OMPI_CONFIGURE_HOST)
|
|
|
|
AC_SUBST(OMPI_CONFIGURE_DATE)])dnl
|
2004-01-07 10:46:37 +03:00
|
|
|
|
2004-01-12 00:35:37 +03:00
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_BASIC_SETUP],[
|
2004-01-12 00:35:37 +03:00
|
|
|
#
|
|
|
|
# Save some stats about this build
|
|
|
|
#
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_CONFIGURE_USER="`whoami`"
|
|
|
|
OMPI_CONFIGURE_HOST="`hostname | head -n 1`"
|
|
|
|
OMPI_CONFIGURE_DATE="`date`"
|
2004-01-12 00:35:37 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Make automake clean emacs ~ files for "make clean"
|
|
|
|
#
|
|
|
|
|
2004-02-14 09:02:16 +03:00
|
|
|
CLEANFILES="*~ .\#*"
|
2004-01-12 00:35:37 +03:00
|
|
|
AC_SUBST(CLEANFILES)
|
|
|
|
|
|
|
|
#
|
2004-06-07 19:33:53 +04:00
|
|
|
# This is useful later (ompi_info, and therefore mpiexec)
|
2004-01-12 00:35:37 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
AC_CANONICAL_HOST
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFINE_UNQUOTED(OMPI_ARCH, "$host", [OMPI architecture string])
|
2004-01-12 00:35:37 +03:00
|
|
|
|
|
|
|
#
|
2004-06-07 19:33:53 +04:00
|
|
|
# See if we can find an old installation of OMPI to overwrite
|
2004-01-12 00:35:37 +03:00
|
|
|
#
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
# Stupid autoconf 2.54 has a bug in AC_PREFIX_PROGRAM -- if ompi_clean
|
2004-01-12 00:35:37 +03:00
|
|
|
# is not found in the path and the user did not specify --prefix,
|
|
|
|
# we'll get a $prefix of "."
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_prefix_save="$prefix"
|
|
|
|
AC_PREFIX_PROGRAM(ompi_clean)
|
2004-01-12 00:35:37 +03:00
|
|
|
if test "$prefix" = "."; then
|
2004-06-07 19:33:53 +04:00
|
|
|
prefix="$ompi_prefix_save"
|
2004-01-12 00:35:37 +03:00
|
|
|
fi
|
2004-06-07 19:33:53 +04:00
|
|
|
unset ompi_prefix_save
|
2004-01-12 00:35:37 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Basic sanity checking; we can't install to a relative path
|
|
|
|
#
|
|
|
|
|
|
|
|
case "$prefix" in
|
|
|
|
/*/bin)
|
|
|
|
prefix="`dirname $prefix`"
|
|
|
|
echo installing to directory \"$prefix\"
|
|
|
|
;;
|
|
|
|
/*)
|
|
|
|
echo installing to directory \"$prefix\"
|
|
|
|
;;
|
|
|
|
NONE)
|
|
|
|
echo installing to directory \"$ac_default_prefix\"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR(prefix \"$prefix\" must be an absolute directory path)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Allow the --enable-dist flag to be passed in
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(dist,
|
|
|
|
AC_HELP_STRING([--enable-dist],
|
|
|
|
[guarantee that that the "dist" make target will be functional, although may not guarantee that any other make target will be functional.]),
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_WANT_DIST=yes, OMPI_WANT_DIST=no)
|
2004-01-12 00:35:37 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
if test "$OMPI_WANT_DIST" = "yes"; then
|
2004-01-12 00:35:37 +03:00
|
|
|
AC_MSG_WARN([Configuring in 'make dist' mode])
|
|
|
|
AC_MSG_WARN([Most make targets may be non-functional!])
|
|
|
|
fi])dnl
|
|
|
|
|
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_LOG_MSG],[
|
2004-01-12 00:35:37 +03:00
|
|
|
# 1 is the message
|
|
|
|
# 2 is whether to put a prefix or not
|
|
|
|
if test -n "$2"; then
|
|
|
|
echo "configure:__oline__: $1" >&5
|
|
|
|
else
|
|
|
|
echo $1 >&5
|
|
|
|
fi])dnl
|
|
|
|
|
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_LOG_FILE],[
|
2004-01-12 00:35:37 +03:00
|
|
|
# 1 is the filename
|
|
|
|
if test -n "$1" -a -f "$1"; then
|
|
|
|
cat $1 >&5
|
|
|
|
fi])dnl
|
|
|
|
|
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_LOG_COMMAND],[
|
2004-01-12 00:35:37 +03:00
|
|
|
# 1 is the command
|
|
|
|
# 2 is actions to do if success
|
|
|
|
# 3 is actions to do if fail
|
|
|
|
echo "configure:__oline__: $1" >&5
|
|
|
|
$1 1>&5 2>&1
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_status=$?
|
|
|
|
OMPI_LOG_MSG([\$? = $ompi_status], 1)
|
|
|
|
if test "$ompi_status" = "0"; then
|
|
|
|
unset ompi_status
|
2004-01-12 00:35:37 +03:00
|
|
|
$2
|
|
|
|
else
|
2004-06-07 19:33:53 +04:00
|
|
|
unset ompi_status
|
2004-01-12 00:35:37 +03:00
|
|
|
$3
|
|
|
|
fi])dnl
|
|
|
|
|
|
|
|
dnl #######################################################################
|
|
|
|
dnl #######################################################################
|
2004-01-07 10:46:37 +03:00
|
|
|
dnl #######################################################################
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_UNIQ],[
|
2004-01-07 10:46:37 +03:00
|
|
|
# 1 is the variable name to be uniq-ized
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_name=$1
|
2004-01-07 10:46:37 +03:00
|
|
|
|
|
|
|
# Go through each item in the variable and only keep the unique ones
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_count=0
|
2004-01-07 10:46:37 +03:00
|
|
|
for val in ${$1}; do
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_done=0
|
|
|
|
ompi_i=1
|
|
|
|
ompi_found=0
|
2004-01-07 10:46:37 +03:00
|
|
|
|
|
|
|
# Loop over every token we've seen so far
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_done="`expr $ompi_i \> $ompi_count`"
|
|
|
|
while test "$ompi_found" = "0" -a "$ompi_done" = "0"; do
|
2004-01-07 10:46:37 +03:00
|
|
|
|
|
|
|
# Have we seen this token already? Prefix the comparison with
|
|
|
|
# "x" so that "-Lfoo" values won't be cause an error.
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_eval="expr x$val = x\$ompi_array_$ompi_i"
|
|
|
|
ompi_found=`eval $ompi_eval`
|
2004-01-07 10:46:37 +03:00
|
|
|
|
|
|
|
# Check the ending condition
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_done="`expr $ompi_i \>= $ompi_count`"
|
2004-01-07 10:46:37 +03:00
|
|
|
|
|
|
|
# Increment the counter
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_i="`expr $ompi_i + 1`"
|
2004-01-07 10:46:37 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
# If we didn't find the token, add it to the "array"
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
if test "$ompi_found" = "0"; then
|
|
|
|
ompi_eval="ompi_array_$ompi_i=$val"
|
|
|
|
eval $ompi_eval
|
|
|
|
ompi_count="`expr $ompi_count + 1`"
|
2004-01-07 10:46:37 +03:00
|
|
|
else
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_i="`expr $ompi_i - 1`"
|
2004-01-07 10:46:37 +03:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Take all the items in the "array" and assemble them back into a
|
|
|
|
# single variable
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_i=1
|
|
|
|
ompi_done="`expr $ompi_i \> $ompi_count`"
|
|
|
|
ompi_newval=
|
|
|
|
while test "$ompi_done" = "0"; do
|
|
|
|
ompi_eval="ompi_newval=\"$ompi_newval \$ompi_array_$ompi_i\""
|
|
|
|
eval $ompi_eval
|
2004-01-07 10:46:37 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_eval="unset ompi_array_$ompi_i"
|
|
|
|
eval $ompi_eval
|
2004-01-07 10:46:37 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_done="`expr $ompi_i \>= $ompi_count`"
|
|
|
|
ompi_i="`expr $ompi_i + 1`"
|
2004-01-07 10:46:37 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
# Done; do the assignment
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_newval="`echo $ompi_newval`"
|
|
|
|
ompi_eval="$ompi_name=\"$ompi_newval\""
|
|
|
|
eval $ompi_eval
|
2004-01-07 10:46:37 +03:00
|
|
|
|
|
|
|
# Clean up
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
unset ompi_name ompi_i ompi_done ompi_newval ompi_eval ompi_count])dnl
|
2004-01-07 10:46:37 +03:00
|
|
|
|