2004-01-14 10:06:57 +03:00
|
|
|
dnl
|
|
|
|
dnl $HEADER$
|
|
|
|
dnl
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFUN([OMPI_CONFIG_THREADS],[
|
2004-01-14 10:06:57 +03:00
|
|
|
#
|
|
|
|
# Arguments: none
|
|
|
|
#
|
|
|
|
# Dependencies: None
|
|
|
|
#
|
|
|
|
# Modifies:
|
|
|
|
# none - see called tests
|
|
|
|
#
|
|
|
|
# configure threads
|
|
|
|
#
|
|
|
|
|
|
|
|
# create templates
|
2004-06-07 19:33:53 +04:00
|
|
|
AH_TEMPLATE([OMPI_HAVE_SOLARIS_THREADS],
|
2004-01-14 10:06:57 +03:00
|
|
|
[Do we have native Solaris threads])
|
2004-06-07 19:33:53 +04:00
|
|
|
AH_TEMPLATE([OMPI_HAVE_POSIX_THREADS],
|
2004-01-14 10:06:57 +03:00
|
|
|
[Do we have POSIX threads])
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check for thread types - add your type here...
|
|
|
|
#
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_CONFIG_POSIX_THREADS(HAVE_POSIX_THREADS=1, HAVE_POSIX_THREADS=0)
|
2004-01-14 10:06:57 +03:00
|
|
|
AC_MSG_CHECKING([for working POSIX threads package])
|
|
|
|
if test "$HAVE_POSIX_THREADS" = "1" ; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
export HAVE_POSIX_THREADS
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_CONFIG_SOLARIS_THREADS(HAVE_SOLARIS_THREADS=1, HAVE_SOLARIS_THREADS=0)
|
2004-01-14 10:06:57 +03:00
|
|
|
AC_MSG_CHECKING([for working Solaris threads package])
|
|
|
|
if test "$HAVE_SOLARIS_THREADS" = "1" ; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
export HAVE_SOLARIS_THREADS
|
|
|
|
|
|
|
|
#
|
|
|
|
# Ask what threading we want (allow solaris / pthread right now)
|
|
|
|
#
|
|
|
|
AC_MSG_CHECKING([for type of thread support])
|
|
|
|
AC_ARG_WITH(threads,
|
|
|
|
AC_HELP_STRING([--with-threads],
|
|
|
|
[Set thread type (solaris / pthread)]),
|
|
|
|
[THREAD_TYPE=$withval])
|
|
|
|
|
|
|
|
if test "$THREAD_TYPE" = "solaris"; then
|
|
|
|
|
|
|
|
if test "$HAVE_SOLARIS_THREADS" = "0"; then
|
|
|
|
AC_MSG_WARN(["*** You have chosen Solaris threads, which are not"])
|
|
|
|
AC_MSG_WARN(["*** available on your system "])
|
|
|
|
AC_MSG_ERROR(["*** Can not continue"])
|
|
|
|
fi
|
|
|
|
elif test "$THREAD_TYPE" = "posix"; then
|
|
|
|
|
|
|
|
if test "$HAVE_POSIX_THREADS" = "0"; then
|
|
|
|
AC_MSG_WARN(["*** You have chosen POSIX threads, which are not"])
|
|
|
|
AC_MSG_WARN(["*** available on your system "])
|
|
|
|
AC_MSG_ERROR(["*** Can not continue"])
|
|
|
|
fi
|
|
|
|
elif test "$THREAD_TYPE" = "no"; then
|
|
|
|
THREAD_TYPE="none"
|
|
|
|
elif test "$THREAD_TYPE" = ""; then
|
|
|
|
|
|
|
|
# Actual logic here - properly set THREAD_TYPE - we go for system
|
|
|
|
# optimized where ever possible
|
|
|
|
case "$host" in
|
|
|
|
*solaris*)
|
|
|
|
if test "$HAVE_SOLARIS_THREADS" = "1"; then
|
|
|
|
THREAD_TYPE="solaris"
|
|
|
|
elif test "$HAVE_POSIX_THREADS" = "1"; then
|
|
|
|
THREAD_TYPE="posix"
|
|
|
|
else
|
|
|
|
THEAD_TYPE="none found"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if test "$HAVE_POSIX_THREADS" = "1"; then
|
|
|
|
THREAD_TYPE="posix"
|
|
|
|
else
|
|
|
|
THREAD_TYPE="none found"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
|
|
|
|
AC_MSG_WARN(["*** You have specified a thread type that I do not"])
|
|
|
|
AC_MSG_WARN(["*** understand. Valid options are posix and solaris"])
|
|
|
|
AC_MSG_ERROR(["*** Can not continue."])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($THREAD_TYPE)
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Ok, now run the configuration for that thread package.
|
|
|
|
#
|
|
|
|
# Blah - this should be made better, but I don't know how...
|
|
|
|
#
|
|
|
|
if test "$THREAD_TYPE" = "solaris"; then
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 1)
|
|
|
|
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 0)
|
|
|
|
AC_DEFINE(OMPI_THREADS_HAVE_DIFFERENT_PIDS, 0)
|
2004-01-14 10:06:57 +03:00
|
|
|
|
|
|
|
THREAD_CFLAGS="$STHREAD_CFLAGS"
|
|
|
|
THREAD_FFLAGS="$STHREAD_FFLAGS"
|
|
|
|
THREAD_CXXFLAGS="$STHREAD_CXXFLAGS"
|
|
|
|
THREAD_CPPFLAGS="$STHREAD_CPPFLAGS"
|
|
|
|
THREAD_CXXCPPFLAGS="$STHREAD_CXXCPPFLAGS"
|
|
|
|
THREAD_LDFLAGS="$STHREAD_LDFLAGS"
|
|
|
|
THREAD_LIBS="$STHREAD_LIBS"
|
|
|
|
elif test "$THREAD_TYPE" = "posix"; then
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 0)
|
|
|
|
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 1)
|
2004-01-14 10:06:57 +03:00
|
|
|
|
|
|
|
THREAD_CFLAGS="$PTHREAD_CFLAGS"
|
|
|
|
THREAD_FFLAGS="$PTHREAD_FFLAGS"
|
|
|
|
THREAD_CXXFLAGS="$PTHREAD_CXXFLAGS"
|
|
|
|
THREAD_CPPFLAGS="$PTHREAD_CPPFLAGS"
|
|
|
|
THREAD_CXXCPPFLAGS="$PTHREAD_CXXCPPFLAGS"
|
|
|
|
THREAD_LDFLAGS="$PTHREAD_LDFLAGS"
|
|
|
|
THREAD_LIBS="$PTHREAD_LIBS"
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
OMPI_CHECK_PTHREAD_PIDS
|
2004-01-14 10:06:57 +03:00
|
|
|
elif test "$THREAD_TYPE" = "none"; then
|
2004-06-07 19:33:53 +04:00
|
|
|
AC_DEFINE(OMPI_HAVE_SOLARIS_THREADS, 0)
|
|
|
|
AC_DEFINE(OMPI_HAVE_POSIX_THREADS, 0)
|
2004-01-14 10:06:57 +03:00
|
|
|
|
|
|
|
TRHEAD_CFLAGS=
|
|
|
|
THREAD_FFLAGS=
|
|
|
|
THREAD_CXXFLAGS=
|
|
|
|
THREAD_CPPFLAGS=
|
|
|
|
THREAD_CXXCPPFLAGS=
|
|
|
|
THREAD_LDFLAGS=
|
|
|
|
THREAD_LIBS=
|
|
|
|
else
|
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
************************************************************************
|
|
|
|
|
2004-08-06 18:30:18 +04:00
|
|
|
Open MPI was unable to find threading support on your system. In the
|
2004-06-07 19:33:53 +04:00
|
|
|
near future, the OMPI development team is considering requiring
|
|
|
|
threading support for proper OMPI execution. This is in part because
|
2004-01-14 10:06:57 +03:00
|
|
|
we are not aware of any users that do not have thread support - so we
|
2004-06-07 19:33:53 +04:00
|
|
|
need you to e-mail us at ompi@ompi-mpi.org and let us know about this
|
2004-01-14 10:06:57 +03:00
|
|
|
problem.
|
|
|
|
|
2004-08-06 18:30:18 +04:00
|
|
|
To build this version of Open MPI without thread support, re-run
|
2004-01-14 10:06:57 +03:00
|
|
|
configure with the '--without-threads' option.
|
|
|
|
|
|
|
|
************************************************************************
|
|
|
|
|
|
|
|
EOF
|
|
|
|
AC_MSG_ERROR(["*** Can not continue."])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|