2008-10-28 20:22:29 +03:00
|
|
|
dnl
|
2010-07-30 22:59:34 +04:00
|
|
|
dnl Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl University Research and Technology
|
|
|
|
dnl Corporation. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
dnl of Tennessee Research Foundation. All rights
|
|
|
|
dnl reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
dnl University of Stuttgart. All rights reserved.
|
|
|
|
dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
dnl All rights reserved.
|
2010-03-17 02:10:50 +03:00
|
|
|
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
2011-06-09 23:45:29 +04:00
|
|
|
dnl Copyright (c) 2009-2011 Oak Ridge National Labs. All rights reserved.
|
2014-05-07 01:16:29 +04:00
|
|
|
dnl Copyright (c) 2014 Intel, Inc. All rights reserved
|
2008-10-28 20:22:29 +03:00
|
|
|
dnl $COPYRIGHT$
|
|
|
|
dnl
|
|
|
|
dnl Additional copyrights may follow
|
|
|
|
dnl
|
|
|
|
dnl $HEADER$
|
|
|
|
dnl
|
|
|
|
|
2010-03-17 02:10:50 +03:00
|
|
|
AC_DEFUN([OPAL_CONFIG_THREADS],[
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# Arguments: none
|
|
|
|
#
|
|
|
|
# Dependencies: None
|
|
|
|
#
|
|
|
|
# Modifies:
|
|
|
|
# none - see called tests
|
|
|
|
#
|
|
|
|
# configure threads
|
|
|
|
#
|
|
|
|
|
|
|
|
# create templates
|
2009-05-07 00:11:28 +04:00
|
|
|
AH_TEMPLATE([OPAL_HAVE_POSIX_THREADS],
|
2008-10-28 20:22:29 +03:00
|
|
|
[Do we have POSIX threads])
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check for thread types - add your type here...
|
|
|
|
#
|
2014-05-07 01:16:29 +04:00
|
|
|
OPAL_CONFIG_POSIX_THREADS(HAVE_POSIX_THREADS=1, HAVE_POSIX_THREADS=0)
|
2008-10-28 20:22:29 +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
|
|
|
|
|
|
|
|
#
|
2013-12-14 00:07:11 +04:00
|
|
|
# Ask what threading we want (allow posix right now)
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
AC_MSG_CHECKING([for type of thread support])
|
|
|
|
AC_ARG_WITH(threads,
|
|
|
|
AC_HELP_STRING([--with-threads],
|
2013-12-14 00:07:11 +04:00
|
|
|
[Set thread type (posix)]),
|
2008-10-28 20:22:29 +03:00
|
|
|
[THREAD_TYPE=$withval])
|
|
|
|
|
2013-12-14 00:07:11 +04:00
|
|
|
if test "$THREAD_TYPE" = "posix"; then
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
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 -z "$THREAD_TYPE" -o "$THREAD_TYPE" = "yes"; then
|
|
|
|
|
2013-12-14 00:07:11 +04:00
|
|
|
if test "$HAVE_POSIX_THREADS" = "1"; then
|
|
|
|
THREAD_TYPE="posix"
|
|
|
|
else
|
|
|
|
THREAD_TYPE="none found"
|
|
|
|
fi
|
2008-10-28 20:22:29 +03:00
|
|
|
else
|
|
|
|
|
|
|
|
AC_MSG_WARN(["*** You have specified a thread type that I do not"])
|
2013-12-14 00:07:11 +04:00
|
|
|
AC_MSG_WARN(["*** understand. Valid options are posix"])
|
2008-10-28 20:22:29 +03:00
|
|
|
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...
|
|
|
|
#
|
2013-12-14 00:07:11 +04:00
|
|
|
if test "$THREAD_TYPE" = "posix"; then
|
2009-05-07 00:11:28 +04:00
|
|
|
AC_DEFINE(OPAL_HAVE_POSIX_THREADS, 1)
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
THREAD_CFLAGS="$PTHREAD_CFLAGS"
|
2012-07-31 22:12:24 +04:00
|
|
|
THREAD_FCFLAGS="$PTHREAD_FCFLAGS"
|
2008-10-28 20:22:29 +03:00
|
|
|
THREAD_CXXFLAGS="$PTHREAD_CXXFLAGS"
|
|
|
|
THREAD_CPPFLAGS="$PTHREAD_CPPFLAGS"
|
|
|
|
THREAD_CXXCPPFLAGS="$PTHREAD_CXXCPPFLAGS"
|
|
|
|
THREAD_LDFLAGS="$PTHREAD_LDFLAGS"
|
|
|
|
THREAD_LIBS="$PTHREAD_LIBS"
|
|
|
|
|
2011-03-17 14:59:54 +03:00
|
|
|
OPAL_CHECK_PTHREAD_PIDS
|
2008-10-28 20:22:29 +03:00
|
|
|
else
|
2009-05-07 00:11:28 +04:00
|
|
|
AC_DEFINE(OPAL_HAVE_POSIX_THREADS, 0)
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
TRHEAD_CFLAGS=
|
2012-07-31 22:12:24 +04:00
|
|
|
THREAD_FCFLAGS=
|
2008-10-28 20:22:29 +03:00
|
|
|
THREAD_CXXFLAGS=
|
|
|
|
THREAD_CPPFLAGS=
|
|
|
|
THREAD_CXXCPPFLAGS=
|
|
|
|
THREAD_LDFLAGS=
|
|
|
|
THREAD_LIBS=
|
|
|
|
if test "$THREAD_TYPE" != "none" ; then
|
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
************************************************************************
|
|
|
|
|
|
|
|
Open MPI was unable to find threading support on your system. The
|
|
|
|
OMPI development team is considering requiring threading support for
|
|
|
|
proper OMPI execution. This is in part because we are not aware of
|
|
|
|
any OpenFabrics users that do not have thread support -- so we need
|
|
|
|
you to e-mail the Open MPI Users mailing list to tell us if this is a
|
|
|
|
problem for you.
|
|
|
|
|
|
|
|
************************************************************************
|
|
|
|
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2009-05-07 00:11:28 +04:00
|
|
|
AM_CONDITIONAL(OPAL_HAVE_POSIX_THREADS, test "$THREAD_TYPE" = "posix")
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2013-12-13 23:40:12 +04:00
|
|
|
# Make sure we have threads
|
|
|
|
if test "$THREAD_TYPE" = "none" ; then
|
|
|
|
AC_MSG_ERROR([User requested MPI threads, but no threading model supported])
|
2008-10-28 20:22:29 +03:00
|
|
|
fi
|
2013-12-13 23:40:12 +04:00
|
|
|
AC_DEFINE_UNQUOTED([OPAL_ENABLE_MULTI_THREADS], [1],
|
2010-03-17 02:10:50 +03:00
|
|
|
[Whether we should enable thread support within the OPAL code base])
|
2009-11-25 02:20:37 +03:00
|
|
|
|
2008-10-28 20:22:29 +03:00
|
|
|
])dnl
|
|
|
|
|