Since ompi_info is no longer written in C++, we no longer require a
C++ compiler in configure. If we have a C++ compiler, then the MPI C++ bindings are built by default. If we don't have a C++ compiler, then the MPI C++ bindings are not built by default. --enable-mpi-cxx will now force an error if there is no C++ compiler available. --disable-mpi-cxx (or the lack of a C++ compiler) will now disable many of the C++ compiler checks in configure. Note that there are a few items to clean up regarding the difference between C's _Bool type and C++'s bool type. Right now, we assume that they are the same. But they aren't, and they shouldn't be treated as such. This cleanup will be forced in MPI-2.2 with the introduction of the MPI_C_BOOL MPI datatype. This commit was SVN r21755.
Этот коммит содержится в:
родитель
5155eaf945
Коммит
90d6491737
@ -13,7 +13,7 @@ dnl All rights reserved.
|
||||
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
|
||||
dnl reserved.
|
||||
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2008-20009 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -27,9 +27,99 @@ dnl
|
||||
# this macro.
|
||||
AC_DEFUN([OMPI_SETUP_CXX],[
|
||||
|
||||
AC_REQUIRE([_OMPI_START_SETUP_CXX])
|
||||
AC_REQUIRE([_OMPI_PROG_CXX])
|
||||
ompi_show_subtitle "C++ compiler and preprocessor"
|
||||
_OMPI_SETUP_CXX_COMPILER
|
||||
|
||||
_OMPI_CXX_CHECK_EXCEPTIONS
|
||||
|
||||
AS_IF([test "$WANT_MPI_CXX_SUPPORT" = "1"],
|
||||
[OMPI_CXX_FIND_TEMPLATE_REPOSITORY
|
||||
OMPI_CXX_FIND_TEMPLATE_PARAMETERS
|
||||
OMPI_CHECK_IDENT([CXX], [CXXFLAGS], [cc], [C++])])
|
||||
|
||||
_OMPI_CXX_CHECK_BUILTIN
|
||||
|
||||
_OMPI_CXX_CHECK_2D_CONST_CAST
|
||||
])
|
||||
|
||||
# _OMPI_SETUP_CXX_COMPILER()
|
||||
# --------------------------
|
||||
# Setup the CXX compiler
|
||||
AC_DEFUN([_OMPI_SETUP_CXX_COMPILER],[
|
||||
|
||||
# There's a few cases here:
|
||||
#
|
||||
# 1. --enable-mpi-cxx was supplied: error if we don't find a C++
|
||||
# compiler
|
||||
# 2. --disable-mpi-cxx was supplied: check for a C++ compiler anyway
|
||||
# (so we can have a functional mpic++ wrapper compiler), but
|
||||
# don't error if we don't find one.
|
||||
# 3. neither was specified: same was #2
|
||||
#
|
||||
# Then only proceed to do all the rest of the C++ checks if we
|
||||
# both found a c++ compiler and want the C++ bindings (i.e., either
|
||||
# case #1 or #3)
|
||||
|
||||
ompi_cxxflags_save="$CXXFLAGS"
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
BASECXX="`basename $CXX`"
|
||||
CXXFLAGS="$ompi_cxxflags_save"
|
||||
|
||||
AS_IF([test "x$CXX" = "x"], [CXX=none])
|
||||
set dummy $CXX
|
||||
ompi_cxx_argv0=[$]2
|
||||
OMPI_WHICH([$ompi_cxx_argv0], [OMPI_CXX_ABSOLUTE])
|
||||
AS_IF([test "x$OMPI_CXX_ABSOLUTE" = "x"], [OMPI_CXX_ABSOLUTE=none])
|
||||
|
||||
AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler])
|
||||
AC_SUBST(OMPI_CXX_ABSOLUTE)
|
||||
|
||||
AS_IF([test "$CXX" = "none"],
|
||||
[AS_IF([test "$enable_mpi_cxx" = "yes"],
|
||||
[AC_MSG_WARN([Could not find functional C++ compiler, but])
|
||||
AC_MSG_WARN([support for the C++ MPI bindings was requested])
|
||||
AC_MSG_ERROR([Cannot continue])],
|
||||
[WANT_MPI_CXX_SUPPORT=0])],
|
||||
[
|
||||
# Make sure that the C++ compiler both works and is
|
||||
# actually a C++ compiler (if not cross-compiling). Don't
|
||||
# just use the AC macro so that we can have a pretty
|
||||
# message. Do something here that should force the linking
|
||||
# of C++-specific things (e.g., STL strings) so that we can
|
||||
# force a hard check of compiling, linking, and running a
|
||||
# C++ application. Note that some C compilers, such as at
|
||||
# least some versions of the GNU and Intel compilers, will
|
||||
# detect that the file extension is ".cc" and therefore
|
||||
# switch into a pseudo-C++ personality which works for
|
||||
# *compiling*, but does not work for *linking*. So in this
|
||||
# test, we want to cover the entire spectrum (compiling,
|
||||
# linking, running). Note that it is not a fatal error if
|
||||
# the C++ compiler does not work unless the user
|
||||
# specifically requested the C++ bindings.
|
||||
|
||||
AS_IF([test "$ompi_cv_cxx_compiler_vendor" != "microsoft" ],
|
||||
[OMPI_CHECK_COMPILER_WORKS([C++], [#include <string>
|
||||
],
|
||||
[std::string foo = "Hello, world"], [],
|
||||
[WANT_MPI_CXX_SUPPORT=0])])])
|
||||
|
||||
AC_MSG_CHECKING([if able to build the MPI C++ bindings])
|
||||
AS_IF([test "$WANT_MPI_CXX_SUPPORT" = "1"],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AS_IF([test "$enable_mpi_cxx" = "yes"],
|
||||
[AC_MSG_WARN([MPI C++ binding support requested but not delivered])
|
||||
AC_MSG_ERROR([Cannot continue])])])
|
||||
|
||||
AS_IF([test "$WANT_MPI_CXX_SUPPORT" = "1"],
|
||||
[OMPI_CXX_COMPILER_VENDOR([ompi_cxx_vendor])])
|
||||
])
|
||||
|
||||
# _OMPI_SETUP_CXX_COMPILER_BACKEND()
|
||||
# ----------------------------------
|
||||
# Back end of _OMPI_SETUP_CXX_COMPILER_BACKEND()
|
||||
AC_DEFUN([_OMPI_SETUP_CXX_COMPILER_BACKEND],[
|
||||
# Do we want code coverage
|
||||
if test "$WANT_COVERAGE" = "1"; then
|
||||
if test "$ompi_cxx_vendor" = "gnu" ; then
|
||||
@ -100,6 +190,65 @@ AC_DEFUN([OMPI_SETUP_CXX],[
|
||||
unset add
|
||||
fi
|
||||
|
||||
# Make sure we can link with the C compiler
|
||||
if[ test "$ompi_cv_cxx_compiler_vendor" != "microsoft" ]; then
|
||||
OMPI_LANG_LINK_WITH_C([C++], [],
|
||||
[cat <<EOF >&2
|
||||
**********************************************************************
|
||||
* It appears that your C++ compiler is unable to link against object
|
||||
* files created by your C compiler. This generally indicates either
|
||||
* a conflict between the options specified in CFLAGS and CXXFLAGS
|
||||
* or a problem with the local compiler installation. More
|
||||
* information (including exactly what command was given to the
|
||||
* compilers and what error resulted when the commands were executed) is
|
||||
* available in the config.log file in this directory.
|
||||
**********************************************************************
|
||||
EOF
|
||||
AC_MSG_ERROR([C and C++ compilers are not link compatible. Can not continue.])])
|
||||
fi
|
||||
|
||||
# If we are on HP-UX, ensure that we're using aCC
|
||||
case "$host" in
|
||||
*hpux*)
|
||||
if test "$BASECXX" = "CC"; then
|
||||
AC_MSG_WARN([*** You will probably have problems compiling the MPI 2])
|
||||
AC_MSG_WARN([*** C++ bindings with the HP-UX CC compiler. You should])
|
||||
AC_MSG_WARN([*** probably be using the aCC compiler. Re-run configure])
|
||||
AC_MSG_WARN([*** with the environment variable "CXX=aCC".])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Note: gcc-imperonating compilers accept -O3
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
OPTFLAGS=
|
||||
else
|
||||
if test "$GXX" = yes; then
|
||||
OPTFLAGS="-O3"
|
||||
else
|
||||
OPTFLAGS="-O"
|
||||
fi
|
||||
fi
|
||||
|
||||
# config/ompi_check_optflags.m4
|
||||
OMPI_CHECK_OPTFLAGS(["$CXXFLAGS"])
|
||||
AC_MSG_CHECKING([for C++ optimization flags])
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CXXFLAGS="$co_result"
|
||||
|
||||
# bool type size and alignment
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CHECK_SIZEOF(bool)
|
||||
OMPI_C_GET_ALIGNMENT(bool, OPAL_ALIGNMENT_CXX_BOOL)
|
||||
AC_LANG_POP(C++)
|
||||
])
|
||||
|
||||
|
||||
# _OMPI_CXX_CHECK_EXCEPTIONS()
|
||||
# ----------------------------
|
||||
# Check for exceptions, skipping the test if we don't want the C++
|
||||
# bindings
|
||||
AC_DEFUN([_OMPI_CXX_CHECK_EXCEPTIONS],[
|
||||
# Check for special things due to C++ exceptions
|
||||
ENABLE_CXX_EXCEPTIONS=no
|
||||
HAVE_CXX_EXCEPTIONS=0
|
||||
@ -109,6 +258,23 @@ AC_DEFUN([OMPI_SETUP_CXX],[
|
||||
[ENABLE_CXX_EXCEPTIONS="$enableval"])
|
||||
|
||||
AC_MSG_CHECKING([if want C++ exception handling])
|
||||
|
||||
AS_IF([test "$WANT_MPI_CXX_SUPPORT" = "0"],
|
||||
[AS_IF([test "$$enable_cxx_exceptions" = "yes"],
|
||||
[AC_MSG_RESULT([error])
|
||||
AC_MSG_WARN([--enable-cxx-exceptions was specified, but the MPI C++ bindings were disabled])
|
||||
AC_MSG_ERROR([Cannot continue])],
|
||||
[AC_MSG_RESULT([skipped])])],
|
||||
[_OMPI_CXX_CHECK_EXCEPTIONS_BACKEND])
|
||||
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_CXX_EXCEPTION_SUPPORT, $HAVE_CXX_EXCEPTIONS,
|
||||
[Whether or not we have compiled with C++ exceptions support])
|
||||
])
|
||||
|
||||
# _OMPI_CXX_CHECK_EXCEPTIONS_BACKEND()
|
||||
# ------------------------------------
|
||||
# Back end of _OMPI_CXX_CHECK_EXCEPTIONS
|
||||
AC_DEFUN([_OMPI_CXX_CHECK_EXCEPTIONS_BACKEND],[
|
||||
AC_MSG_RESULT([$ENABLE_CXX_EXCEPTIONS])
|
||||
if test "$ENABLE_CXX_EXCEPTIONS" = "yes"; then
|
||||
# config/cxx_have_exceptions.m4
|
||||
@ -144,32 +310,33 @@ AC_DEFUN([OMPI_SETUP_CXX],[
|
||||
WRAPPER_EXTRA_CXXFLAGS="$OMPI_CXX_EXCEPTIONS_CXXFLAGS ${WRAPPER_EXTRA_CXXFLAGS}"
|
||||
fi
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(OMPI_HAVE_CXX_EXCEPTION_SUPPORT, $HAVE_CXX_EXCEPTIONS,
|
||||
[Whether or not we have compiled with C++ exceptions support])
|
||||
])
|
||||
|
||||
# Make sure we can link with the C compiler
|
||||
if[ test "$ompi_cv_cxx_compiler_vendor" != "microsoft" ]; then
|
||||
OMPI_LANG_LINK_WITH_C([C++], [],
|
||||
[cat <<EOF >&2
|
||||
**********************************************************************
|
||||
* It appears that your C++ compiler is unable to link against object
|
||||
* files created by your C compiler. This generally indicates either
|
||||
* a conflict between the options specified in CFLAGS and CXXFLAGS
|
||||
* or a problem with the local compiler installation. More
|
||||
* information (including exactly what command was given to the
|
||||
* compilers and what error resulted when the commands were executed) is
|
||||
* available in the config.log file in this directory.
|
||||
**********************************************************************
|
||||
EOF
|
||||
AC_MSG_ERROR([C and C++ compilers are not link compatible. Can not continue.])])
|
||||
fi
|
||||
# _OMPI_CXX_CHECK_BUILTIN
|
||||
# -----------------------
|
||||
# Check for __builtin_* stuff
|
||||
AC_DEFUN([_OMPI_CXX_CHECK_BUILTIN],[
|
||||
OMPI_VAR_SCOPE_PUSH([have_cxx_builtin_expect have_cxx_builtin_prefetch])
|
||||
have_cxx_builtin_expect=0
|
||||
have_cxx_builtin_prefectch=0
|
||||
|
||||
# Find some more characteristics of the C++ compiler
|
||||
AS_IF([test "$WANT_MPI_CXX_SUPPORT" = "1"],
|
||||
[_OMPI_CXX_CHECK_BUILTIN_BACKEND])
|
||||
|
||||
# config/cxx_find_template_repository.m4
|
||||
OMPI_CXX_FIND_TEMPLATE_REPOSITORY
|
||||
# config/cxx_find_template_parameters.m4
|
||||
OMPI_CXX_FIND_TEMPLATE_PARAMETERS
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_HAVE_BUILTIN_EXPECT],
|
||||
[$have_cxx_builtin_expect],
|
||||
[Whether C++ compiler supports __builtin_expect])
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_HAVE_BUILTIN_PREFETCH],
|
||||
[$have_cxx_builtin_prefetch],
|
||||
[Whether C++ compiler supports __builtin_prefetch])
|
||||
|
||||
OMPI_VAR_SCOPE_POP
|
||||
])
|
||||
|
||||
# _OMPI_CXX_CHECK_BUILTIN_BACKEND
|
||||
# -------------------------------
|
||||
# Back end of _OMPI_CXX_CHECK_BUILTIN
|
||||
AC_DEFUN([_OMPI_CXX_CHECK_BUILTIN_BACKEND],[
|
||||
|
||||
# see if the C++ compiler supports __builtin_expect
|
||||
AC_LANG_PUSH(C++)
|
||||
@ -182,11 +349,7 @@ EOF
|
||||
[ompi_cv_cxx_supports___builtin_expect="no"])])
|
||||
if test "$ompi_cv_cxx_supports___builtin_expect" = "yes" ; then
|
||||
have_builtin_expect=1
|
||||
else
|
||||
have_builtin_expect=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_HAVE_BUILTIN_EXPECT], [$have_builtin_expect],
|
||||
[Whether C++ compiler supports __builtin_expect])
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
# see if the C compiler supports __builtin_prefetch
|
||||
@ -200,25 +363,32 @@ EOF
|
||||
[ompi_cv_cxx_supports___builtin_prefetch="no"])])
|
||||
if test "$ompi_cv_cxx_supports___builtin_prefetch" = "yes" ; then
|
||||
have_builtin_prefetch=1
|
||||
else
|
||||
have_builtin_prefetch=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_HAVE_BUILTIN_PREFETCH], [$have_builtin_prefetch],
|
||||
[Whether C++ compiler supports __builtin_prefetch])
|
||||
AC_LANG_POP(C++)
|
||||
])
|
||||
|
||||
# If we are on HP-UX, ensure that we're using aCC
|
||||
case "$host" in
|
||||
*hpux*)
|
||||
if test "$BASECXX" = "CC"; then
|
||||
AC_MSG_WARN([*** You will probably have problems compiling the MPI 2])
|
||||
AC_MSG_WARN([*** C++ bindings with the HP-UX CC compiler. You should])
|
||||
AC_MSG_WARN([*** probably be using the aCC compiler. Re-run configure])
|
||||
AC_MSG_WARN([*** with the environment variable "CXX=aCC".])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# _OMPI_CXX_CHECK_2D_CONST_CAST
|
||||
# -----------------------------
|
||||
# Check for compiler support of 2D const casts
|
||||
AC_DEFUN([_OMPI_CXX_CHECK_2D_CONST_CAST],[
|
||||
OMPI_VAR_SCOPE_PUSH([use_2d_const_cast])
|
||||
use_2d_const_cast=0
|
||||
|
||||
AS_IF([test "$WANT_MPI_CXX_SUPPORT" = "1"],
|
||||
[_OMPI_CXX_CHECK_2D_CONST_CAST_BACKEND])
|
||||
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_SUPPORTS_2D_CONST_CAST],
|
||||
[$use_2d_const_cast],
|
||||
[Whether a const_cast on a 2-d array will work with the C++ compiler])
|
||||
|
||||
OMPI_VAR_SCOPE_POP
|
||||
])
|
||||
|
||||
# _OMPI_CXX_CHECK_2D_CONST_CAST_BACKEND
|
||||
# ---------------------------------
|
||||
# Back end of _OMPI_CHECK_2D_CONST_CAST
|
||||
AC_DEFUN([_OMPI_CXX_CHECK_2D_CONST_CAST_BACKEND],[
|
||||
# see if the compiler supports const_cast of 2-dimensional arrays
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CACHE_CHECK([if $CXX supports const_cast<> properly],
|
||||
@ -232,69 +402,6 @@ int cast_test(const int ranges[][3]) {
|
||||
[ompi_cv_cxx_supports_2d_const_cast="no"])])
|
||||
if test "$ompi_cv_cxx_supports_2d_const_cast" = "yes" ; then
|
||||
use_2d_const_cast=1
|
||||
else
|
||||
use_2d_const_cast=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OMPI_CXX_SUPPORTS_2D_CONST_CAST],
|
||||
[$use_2d_const_cast],
|
||||
[Whether a const_cast on a 2-d array will work with the C++ compiler])
|
||||
unset use_2d_const_cast
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
# Note: gcc-imperonating compilers accept -O3
|
||||
if test "$WANT_DEBUG" = "1"; then
|
||||
OPTFLAGS=
|
||||
else
|
||||
if test "$GXX" = yes; then
|
||||
OPTFLAGS="-O3"
|
||||
else
|
||||
OPTFLAGS="-O"
|
||||
fi
|
||||
fi
|
||||
|
||||
# config/ompi_check_optflags.m4
|
||||
OMPI_CHECK_OPTFLAGS(["$CXXFLAGS"])
|
||||
AC_MSG_CHECKING([for C++ optimization flags])
|
||||
AC_MSG_RESULT([$co_result])
|
||||
CXXFLAGS="$co_result"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_START_SETUP_CXX],[
|
||||
ompi_show_subtitle "C++ compiler and preprocessor"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([_OMPI_PROG_CXX],[
|
||||
ompi_cxxflags_save="$CXXFLAGS"
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
BASECXX="`basename $CXX`"
|
||||
CXXFLAGS="$ompi_cxxflags_save"
|
||||
AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler])
|
||||
set dummy $CXX
|
||||
ompi_cxx_argv0=[$]2
|
||||
OMPI_WHICH([$ompi_cxx_argv0], [OMPI_CXX_ABSOLUTE])
|
||||
AC_SUBST(OMPI_CXX_ABSOLUTE)
|
||||
|
||||
OMPI_CXX_COMPILER_VENDOR([ompi_cxx_vendor])
|
||||
|
||||
# Make sure that the C++ compiler both works and is actually a C++
|
||||
# compiler (if not cross-compiling). Don't just use the AC macro
|
||||
# so that we can have a pretty message. Do something here that
|
||||
# should force the linking of C++-specific things (e.g., STL
|
||||
# strings) so that we can force a hard check of compiling,
|
||||
# linking, and running a C++ application Note that some C
|
||||
# compilers, such as at least some versions of the GNU and Intel
|
||||
# compilers, will detect that the file extension is ".cc" and
|
||||
# therefore switch into a pseudo-C++ personality which works for
|
||||
# *compiling*, but does not work for *linking*. So in this test,
|
||||
# we want to cover the entire spectrum (compiling, linking,
|
||||
# running).
|
||||
|
||||
if[ test "$ompi_cv_cxx_compiler_vendor" != "microsoft" ]; then
|
||||
OMPI_CHECK_COMPILER_WORKS([C++], [#include <string>],
|
||||
[std::string foo = "Hello, world"], [],
|
||||
[AC_MSG_ERROR([Could not run a simple C++ program. Aborting.])])
|
||||
fi
|
||||
])
|
||||
|
@ -12,6 +12,7 @@ dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
dnl All rights reserved.
|
||||
dnl Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
dnl Use is subject to license terms.
|
||||
dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -231,10 +232,15 @@ AC_DEFUN([OMPI_SETUP_WRAPPER_FINAL],[
|
||||
AC_MSG_RESULT([$OMPI_WRAPPER_EXTRA_INCLUDES])
|
||||
|
||||
# language binding support. C++ is a bit different, as the
|
||||
# compiler should work even if there is no language support.
|
||||
# compiler should work even if there is no MPI C++ bindings
|
||||
# support. However, we do want it to fail if there is no C++
|
||||
# compiler.
|
||||
if test "$WANT_MPI_CXX_SUPPORT" = "1" ; then
|
||||
OMPI_WRAPPER_CXX_LIB="-lmpi_cxx"
|
||||
OMPI_WRAPPER_CXX_REQUIRED_FILE=""
|
||||
elif test "$CXX" = "none"; then
|
||||
OMPI_WRAPPER_CXX_LIB=""
|
||||
OMPI_WRAPPER_CXX_REQUIRED_FILE="not supported"
|
||||
else
|
||||
OMPI_WRAPPER_CXX_LIB=""
|
||||
OMPI_WRAPPER_CXX_REQUIRED_FILE=""
|
||||
|
@ -9,7 +9,7 @@ dnl Copyright (c) 2004-2006 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.
|
||||
dnl Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -970,9 +970,10 @@ AC_MSG_ERROR([Can not continue.])
|
||||
OMPI_CHECK_INLINE_C_GCC([$OMPI_GCC_INLINE_ASSIGN])
|
||||
OMPI_CHECK_INLINE_C_DEC
|
||||
OMPI_CHECK_INLINE_C_XLC
|
||||
OMPI_CHECK_INLINE_CXX_GCC([$OMPI_GCC_INLINE_ASSIGN])
|
||||
OMPI_CHECK_INLINE_CXX_DEC
|
||||
OMPI_CHECK_INLINE_CXX_XLC
|
||||
AS_IF([test "$WANT_MPI_CXX_SUPPORT" = "1"],
|
||||
[OMPI_CHECK_INLINE_CXX_GCC([$OMPI_GCC_INLINE_ASSIGN])
|
||||
OMPI_CHECK_INLINE_CXX_DEC
|
||||
OMPI_CHECK_INLINE_CXX_XLC])
|
||||
|
||||
# format:
|
||||
# config_file-text-global-label_suffix-gsym-lsym-type-size-align_log-ppc_r_reg-64_bit-gnu_stack
|
||||
|
@ -224,11 +224,11 @@ AC_DEFUN([OMPI_SETUP_CC],[
|
||||
[ompi_cv_cc_supports___builtin_expect="yes"],
|
||||
[ompi_cv_cc_supports___builtin_expect="no"])])
|
||||
if test "$ompi_cv_cc_supports___builtin_expect" = "yes" ; then
|
||||
have_builtin_expect=1
|
||||
have_cc_builtin_expect=1
|
||||
else
|
||||
have_builtin_expect=0
|
||||
have_cc_builtin_expect=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OPAL_C_HAVE_BUILTIN_EXPECT], [$have_builtin_expect],
|
||||
AC_DEFINE_UNQUOTED([OPAL_C_HAVE_BUILTIN_EXPECT], [$have_cc_builtin_expect],
|
||||
[Whether C compiler supports __builtin_expect])
|
||||
|
||||
# see if the C compiler supports __builtin_prefetch
|
||||
@ -240,11 +240,11 @@ AC_DEFUN([OMPI_SETUP_CC],[
|
||||
[ompi_cv_cc_supports___builtin_prefetch="yes"],
|
||||
[ompi_cv_cc_supports___builtin_prefetch="no"])])
|
||||
if test "$ompi_cv_cc_supports___builtin_prefetch" = "yes" ; then
|
||||
have_builtin_prefetch=1
|
||||
have_cc_builtin_prefetch=1
|
||||
else
|
||||
have_builtin_prefetch=0
|
||||
have_cc_builtin_prefetch=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([OPAL_C_HAVE_BUILTIN_PREFETCH], [$have_builtin_prefetch],
|
||||
AC_DEFINE_UNQUOTED([OPAL_C_HAVE_BUILTIN_PREFETCH], [$have_cc_builtin_prefetch],
|
||||
[Whether C compiler supports __builtin_prefetch])
|
||||
|
||||
# Preload the optflags for the case where the user didn't specify
|
||||
|
18
configure.ac
18
configure.ac
@ -348,6 +348,7 @@ AC_INCLUDES_DEFAULT]],
|
||||
AC_DEFINE_UNQUOTED(OPAL_NEED_C_BOOL, $OPAL_NEED_C_BOOL,
|
||||
[Whether the C compiler supports "bool" without any other help (such as <stdbool.h>)])
|
||||
AC_MSG_RESULT([$MSG])
|
||||
AC_CHECK_SIZEOF(_Bool)
|
||||
|
||||
#
|
||||
# Check for other compiler characteristics
|
||||
@ -447,20 +448,6 @@ AC_DEFINE_UNQUOTED(OPAL_HAVE_WEAK_SYMBOLS, $OPAL_C_HAVE_WEAK_SYMBOLS,
|
||||
|
||||
OMPI_SETUP_CXX
|
||||
|
||||
# Does the compiler support "ident"-like constructs?
|
||||
|
||||
OMPI_CHECK_IDENT([CXX], [CXXFLAGS], [cc], [C++])
|
||||
|
||||
# check for type sizes
|
||||
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_CHECK_SIZEOF(bool)
|
||||
|
||||
# check for type alignments
|
||||
|
||||
OMPI_C_GET_ALIGNMENT(bool, OPAL_ALIGNMENT_CXX_BOOL)
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
# check if we want C++ support
|
||||
|
||||
AM_CONDITIONAL(WANT_MPI_CXX_BINDINGS,
|
||||
@ -473,6 +460,9 @@ AC_DEFINE_UNQUOTED(OMPI_WANT_CXX_BINDINGS, $WANT_MPI_CXX_SUPPORT,
|
||||
# Only after setting up both
|
||||
# C and C++ check compiler attributes.
|
||||
##################################
|
||||
|
||||
ompi_show_subtitle "Compiler characteristics"
|
||||
|
||||
OMPI_CHECK_ATTRIBUTES
|
||||
|
||||
OPAL_CHECK_COMPILER_VERSION_ID
|
||||
|
@ -547,8 +547,8 @@ void ompi_info_do_config(bool want_all)
|
||||
debug = OPAL_ENABLE_DEBUG ? "yes" : "no";
|
||||
mpi_interface_warning = OMPI_WANT_MPI_INTERFACE_WARNING ? "yes" : "no";
|
||||
cprofiling = OMPI_ENABLE_MPI_PROFILING ? "yes" : "no";
|
||||
cxxprofiling = OMPI_ENABLE_MPI_PROFILING ? "yes" : "no";
|
||||
cxxexceptions = OMPI_HAVE_CXX_EXCEPTION_SUPPORT ? "yes" : "no";
|
||||
cxxprofiling = (OMPI_WANT_CXX_BINDINGS && OMPI_ENABLE_MPI_PROFILING) ? "yes" : "no";
|
||||
cxxexceptions = (OMPI_WANT_CXX_BINDINGS && OMPI_HAVE_CXX_EXCEPTION_SUPPORT) ? "yes" : "no";
|
||||
f77profiling = (OMPI_ENABLE_MPI_PROFILING && OMPI_WANT_F77_BINDINGS) ? "yes" : "no";
|
||||
f90profiling = (OMPI_ENABLE_MPI_PROFILING && OMPI_WANT_F90_BINDINGS) ? "yes" : "no";
|
||||
want_libltdl = OPAL_WANT_LIBLTDL ? "yes" : "no";
|
||||
@ -605,6 +605,13 @@ void ompi_info_do_config(bool want_all)
|
||||
|
||||
if (want_all) {
|
||||
ompi_info_out_int("C char size", "compiler:c:sizeof:char", sizeof(char));
|
||||
/* JMS: should be fixed in MPI-2.2 to differentiate between C
|
||||
_Bool and C++ bool. For the moment, the code base assumes
|
||||
that they are the same. Because of opal_config_bottom.h,
|
||||
we can sizeof(bool) here, so we might as well -- even
|
||||
though this technically isn't right. This should be fixed
|
||||
when we update to MPI-2.2. See below for note about C++
|
||||
bool alignment. */
|
||||
ompi_info_out_int("C bool size", "compiler:c:sizeof:bool", sizeof(bool));
|
||||
ompi_info_out_int("C short size", "compiler:c:sizeof:short", sizeof(short));
|
||||
ompi_info_out_int("C int size", "compiler:c:sizeof:int", sizeof(int));
|
||||
@ -613,15 +620,21 @@ void ompi_info_do_config(bool want_all)
|
||||
ompi_info_out_int("C double size", "compiler:c:sizeof:double", sizeof(double));
|
||||
ompi_info_out_int("C pointer size", "compiler:c:sizeof:pointer", sizeof(void *));
|
||||
ompi_info_out_int("C char align", "compiler:c:align:char", OPAL_ALIGNMENT_CHAR);
|
||||
#if OMPI_WANT_CXX_BINDINGS
|
||||
/* JMS: See above for note about C++ bool size. We don't have
|
||||
the bool alignment the way configure currently runs -- need
|
||||
to clean this up when we update for MPI-2.2. */
|
||||
ompi_info_out_int("C bool align", "compiler:c:align:bool", OPAL_ALIGNMENT_CXX_BOOL);
|
||||
#else
|
||||
ompi_info_out("C bool align", "compiler:c:align:bool", "skipped");
|
||||
#endif
|
||||
ompi_info_out_int("C int align", "compiler:c:align:int", OPAL_ALIGNMENT_INT);
|
||||
ompi_info_out_int("C float align", "compiler:c:align:float", OPAL_ALIGNMENT_FLOAT);
|
||||
ompi_info_out_int("C double align", "compiler:c:align:double", OPAL_ALIGNMENT_DOUBLE);
|
||||
}
|
||||
|
||||
|
||||
ompi_info_out("C++ compiler", "compiler:cxx:command", OMPI_CXX);
|
||||
ompi_info_out("C++ compiler absolute", "compiler:cxx:absolute", OMPI_CXX_ABSOLUTE);
|
||||
|
||||
ompi_info_out("Fortran77 compiler", "compiler:f77:command", OMPI_F77);
|
||||
ompi_info_out("Fortran77 compiler abs", "compiler:f77:absolute",
|
||||
OMPI_F77_ABSOLUTE);
|
||||
|
@ -10,6 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -290,8 +291,20 @@ typedef OPAL_PTRDIFF_TYPE ptrdiff_t;
|
||||
# if OPAL_USE_STDBOOL_H
|
||||
/* If we're using <stdbool.h>, there is an implicit
|
||||
assumption that the C++ bool is the same size and has
|
||||
the same alignment. */
|
||||
the same alignment. However, configure may have
|
||||
disabled the MPI C++ bindings, so if "_Bool" exists,
|
||||
then use that sizeof. */
|
||||
# include <stdbool.h>
|
||||
/* This section exists because AC_SIZEOF(bool) may not be
|
||||
run in configure if we're not building the MPI C++
|
||||
bindings. */
|
||||
# undef SIZEOF_BOOL
|
||||
# if SIZEOF__BOOL > 0
|
||||
# define SIZEOF_BOOL SIZEOF__BOOL
|
||||
# else
|
||||
/* If all else fails, assume it's 1 */
|
||||
# define SIZEOF_BOOL 1
|
||||
# endif
|
||||
# else
|
||||
/* We need to create a bool type and ensure that it's the
|
||||
same size / alignment as the C++ bool size /
|
||||
@ -308,8 +321,16 @@ typedef int bool;
|
||||
typedef long bool;
|
||||
# elif defined(SIZEOF_LONG_LONG) && defined(OPAL_ALIGNMENT_LONG) && SIZEOF_BOOL == SIZEOF_LONG && OPAL_ALIGNMENT_CXX_BOOL == OPAL_ALIGNMENT_LONG
|
||||
typedef long long bool;
|
||||
/* If we have _Bool, use that */
|
||||
# elif SIZEOF__BOOL > 0
|
||||
# undef SIZEOF_BOOL
|
||||
# define bool _Bool
|
||||
# define SIZEOF_BOOL SIZEOF__BOOL
|
||||
# else
|
||||
# error Cannot find a C type that corresponds to the size and alignment of C++ bool!
|
||||
/* If all else fails, just make bool be an unsigned char
|
||||
and size of 1 */
|
||||
typedef unsigned char bool;
|
||||
# define SIZEOF_BOOL 1
|
||||
# endif
|
||||
# endif /* OPAL_USE_STDBOOL_H */
|
||||
# endif /* OPAL_NEED_C_BOOL */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user