oshmem configury: tighten up the pshmem checks
Make the checks for macro weak symbols be equivalent to the checks for weak symbols. Also fix up several OSHMEM configure checks: * fix an errant AC_MSG_REQUEST * don't check for profiling ability during configure options checks. Instead, defer it to later, when we have weak symbol check results. * don't directly call _FOO macros from the top level * make setting up OSHMEM profiling similar to MPI profiling: create OSHMEM_SETUP_PROFILING macro * cache the results of checking for macro weak symbols (for parity with the weak symbol check -- although we should really revisit/audit the whole cache-checking scheme throughout all m4 code; it may well be inconsistently used) * add some more [] m4 quoting, even in the original C weak symbols test * style: fix some whitespace errors Refs trac:4868 This commit was SVN r32590. The following Trac tickets were found above: Ticket 4868 --> https://svn.open-mpi.org/trac/ompi/ticket/4868
Этот коммит содержится в:
родитель
1b3c9a5517
Коммит
36b315db2d
@ -12,6 +12,7 @@ dnl Copyright (c) 2004-2005 The Regents of the University of California.
|
|||||||
dnl All rights reserved.
|
dnl All rights reserved.
|
||||||
dnl Copyright (c) 2014 Research Organization for Information Science
|
dnl Copyright (c) 2014 Research Organization for Information Science
|
||||||
dnl and Technology (RIST). All rights reserved.
|
dnl and Technology (RIST). All rights reserved.
|
||||||
|
dnl Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
||||||
dnl $COPYRIGHT$
|
dnl $COPYRIGHT$
|
||||||
dnl
|
dnl
|
||||||
dnl Additional copyrights may follow
|
dnl Additional copyrights may follow
|
||||||
@ -45,10 +46,10 @@ EOF
|
|||||||
# Try the compile
|
# Try the compile
|
||||||
OPAL_LOG_COMMAND(
|
OPAL_LOG_COMMAND(
|
||||||
[$CC $CFLAGS -c conftest_weak.c],
|
[$CC $CFLAGS -c conftest_weak.c],
|
||||||
OPAL_LOG_COMMAND(
|
[OPAL_LOG_COMMAND(
|
||||||
[$CC $CFLAGS conftest.c conftest_weak.o -o conftest $LDFLAGS $LIBS],
|
[$CC $CFLAGS conftest.c conftest_weak.o -o conftest $LDFLAGS $LIBS],
|
||||||
[opal_c_weak_symbols_happy=1],
|
[opal_c_weak_symbols_happy=1],
|
||||||
[opal_c_weak_symbols_happy=0]),
|
[opal_c_weak_symbols_happy=0])],
|
||||||
[opal_c_weak_symbols_happy=0])
|
[opal_c_weak_symbols_happy=0])
|
||||||
|
|
||||||
AS_IF([test "$opal_c_weak_symbols_happy" = "1"], [$1], [$2])
|
AS_IF([test "$opal_c_weak_symbols_happy" = "1"], [$1], [$2])
|
||||||
@ -58,6 +59,21 @@ OPAL_LOG_COMMAND(
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
# OPAL_C_WEAK_SYMBOLS()
|
||||||
|
# ---------------------
|
||||||
|
# sets OPAL_C_HAVE_WEAK_SYMBOLS=1 if C compiler has support for weak symbols
|
||||||
|
AC_DEFUN([OPAL_C_WEAK_SYMBOLS],[
|
||||||
|
AC_CACHE_CHECK([for weak symbol support],
|
||||||
|
[opal_cv_c_weak_symbols],
|
||||||
|
[_OPAL_C_WEAK_SYMBOLS([opal_cv_c_weak_symbols="yes"],
|
||||||
|
[opal_cv_c_weak_symbols="no"])])
|
||||||
|
|
||||||
|
AS_IF([test "$opal_cv_c_weak_symbols" = "yes"],
|
||||||
|
[OPAL_C_HAVE_WEAK_SYMBOLS=1], [OPAL_C_HAVE_WEAK_SYMBOLS=0])
|
||||||
|
]) dnl
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
|
||||||
# _OPAL_C_MACRO_WEAK_SYMBOLS(action_if_found, [action_if_not_found])
|
# _OPAL_C_MACRO_WEAK_SYMBOLS(action_if_found, [action_if_not_found])
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
AC_DEFUN([_OPAL_C_MACRO_WEAK_SYMBOLS],[
|
AC_DEFUN([_OPAL_C_MACRO_WEAK_SYMBOLS],[
|
||||||
@ -90,10 +106,10 @@ EOF
|
|||||||
# Try the compile
|
# Try the compile
|
||||||
OPAL_LOG_COMMAND(
|
OPAL_LOG_COMMAND(
|
||||||
[$CC $CFLAGS -c conftest_weak.c],
|
[$CC $CFLAGS -c conftest_weak.c],
|
||||||
OPAL_LOG_COMMAND(
|
[OPAL_LOG_COMMAND(
|
||||||
[$CC $CFLAGS conftest.c conftest_weak.o -o conftest $LDFLAGS $LIBS],
|
[$CC $CFLAGS conftest.c conftest_weak.o -o conftest $LDFLAGS $LIBS],
|
||||||
[opal_c_macro_weak_symbols_happy=1],
|
[opal_c_macro_weak_symbols_happy=1],
|
||||||
[opal_c_macro_weak_symbols_happy=0]),
|
[opal_c_macro_weak_symbols_happy=0])],
|
||||||
[opal_c_macro_weak_symbols_happy=0])
|
[opal_c_macro_weak_symbols_happy=0])
|
||||||
|
|
||||||
AS_IF([test "$opal_c_macro_weak_symbols_happy" = "1"], [$1], [$2])
|
AS_IF([test "$opal_c_macro_weak_symbols_happy" = "1"], [$1], [$2])
|
||||||
@ -102,15 +118,17 @@ OPAL_LOG_COMMAND(
|
|||||||
rm -f conftest_weak.h conftest_weak.c conftest.c conftest
|
rm -f conftest_weak.h conftest_weak.c conftest.c conftest
|
||||||
])
|
])
|
||||||
|
|
||||||
# OPAL_C_WEAK_SYMBOLS()
|
# OPAL_C_MACRO_WEAK_SYMBOLS
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# sets OPAL_C_WEAK_SYMBOLS=1 if C compiler has support for weak symbols
|
# Sets OPAL_C_HAVE_MACRO_WEAK_SYMBOLS=1 if C compiler has support for weak
|
||||||
AC_DEFUN([OPAL_C_WEAK_SYMBOLS],[
|
# symbols
|
||||||
AC_CACHE_CHECK([for weak symbol support],
|
AC_DEFUN([OPAL_C_MACRO_WEAK_SYMBOLS],[
|
||||||
[opal_cv_c_weak_symbols],
|
AC_CACHE_CHECK([for macro weak symbol support],
|
||||||
[_OPAL_C_WEAK_SYMBOLS([opal_cv_c_weak_symbols="yes"],
|
[opal_cv_c_macro_weak_symbols],
|
||||||
[opal_cv_c_weak_symbols="no"])])
|
[_OPAL_C_WEAK_SYMBOLS([opal_cv_c_macro_weak_symbols="yes"],
|
||||||
|
[opal_cv_c_macro_weak_symbols="no"])])
|
||||||
|
|
||||||
AS_IF([test "$opal_cv_c_weak_symbols" = "yes"],
|
AS_IF([test "$opal_cv_c_macro_weak_symbols" = "yes"],
|
||||||
[OPAL_C_HAVE_WEAK_SYMBOLS=1], [OPAL_C_HAVE_WEAK_SYMBOLS=0])
|
[OPAL_C_HAVE_MACRO_WEAK_SYMBOLS=1],
|
||||||
|
[OPAL_C_HAVE_MACRO_WEAK_SYMBOLS=0])
|
||||||
]) dnl
|
]) dnl
|
||||||
|
@ -36,8 +36,9 @@ if test "$oshmem_arg_given" = "yes"; then
|
|||||||
AC_MSG_WARN([only supports Linux.])
|
AC_MSG_WARN([only supports Linux.])
|
||||||
AC_MSG_ERROR([Cannot continue])
|
AC_MSG_ERROR([Cannot continue])
|
||||||
fi
|
fi
|
||||||
fi
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
if test "$opal_found_linux" = "yes"; then
|
if test "$opal_found_linux" = "yes"; then
|
||||||
enable_oshmem=yes
|
enable_oshmem=yes
|
||||||
@ -101,29 +102,23 @@ AC_DEFINE_UNQUOTED(OSHMEM_PARAM_CHECK, $shmem_param_check,
|
|||||||
#
|
#
|
||||||
# OSHMEM profiling support
|
# OSHMEM profiling support
|
||||||
#
|
#
|
||||||
AC_MSG_CHECKING([if want pshmem_])
|
|
||||||
AC_ARG_ENABLE(oshmem-profile,
|
AC_ARG_ENABLE(oshmem-profile,
|
||||||
AC_HELP_STRING([--enable-oshmem-profile],
|
AC_HELP_STRING([--enable-oshmem-profile],
|
||||||
[enable OSHMEM profiling (default: enabled)]))
|
[enable OSHMEM profiling (default: enabled)]))
|
||||||
if test "$enable_oshmem" != "no" -a "$enable_oshmem_profile" != "no"; then
|
AC_MSG_CHECKING([if want pshmem])
|
||||||
_OPAL_C_WEAK_SYMBOLS([
|
AS_IF([test "$enable_oshmem_profile" != "no"],
|
||||||
_OPAL_C_MACRO_WEAK_SYMBOLS([
|
[AC_MSG_RESULT([yes])],
|
||||||
AC_MSG_RESULT([yes])
|
[AC_MSG_RESULT([no])])
|
||||||
oshmem_profiling_support=1],[
|
|
||||||
AC_MSG_RESULT([no])
|
# Bozo check
|
||||||
AC_MSG_WARN([Macro defined weak symbols not supported by compiler.
|
AS_IF([test "$enable_oshmem" = "no" && \
|
||||||
Profiling will be disabled.])
|
test "$enable_oshmem_profile" = "yes"],
|
||||||
oshmem_profiling_support=0])], [
|
[AC_MSG_WARN([OpenSHMEM profiling was requested, but OpenSHMEM has been explicitly disabled])
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_ERROR([Cannot continue])])
|
||||||
AC_MSG_WARN([Weak symbols not supported by compiler.
|
|
||||||
Profiling will be disabled.])
|
# Cannot check if we can enable profiling because it is not yet
|
||||||
oshmem_profiling_support=0]
|
# known whether the compiler supports weak symbols.
|
||||||
)
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
oshmem_profiling_support=0
|
|
||||||
fi
|
|
||||||
AM_CONDITIONAL(OSHMEM_PROFILING, test $oshmem_profiling_support -eq 1)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Fortran bindings
|
# Fortran bindings
|
||||||
@ -151,7 +146,8 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# We can't set am_conditional here since it's yet unknown if there is valid Fortran compiler avaliable
|
# We can't set am_conditional here since it's yet unknown if there is
|
||||||
|
# valid Fortran compiler avaliable
|
||||||
#
|
#
|
||||||
|
|
||||||
]) dnl
|
]) dnl
|
||||||
|
45
config/oshmem_setup_profiling.m4
Обычный файл
45
config/oshmem_setup_profiling.m4
Обычный файл
@ -0,0 +1,45 @@
|
|||||||
|
# -*- shell-script -*-
|
||||||
|
#
|
||||||
|
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
||||||
|
# $COPYRIGHT$
|
||||||
|
#
|
||||||
|
# Additional copyrights may follow
|
||||||
|
#
|
||||||
|
# $HEADER$
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_DEFUN([OSHMEM_SETUP_PROFILING],[
|
||||||
|
opal_show_subtitle "OpenSHMEM profiling"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([if pshmem will be enabled])
|
||||||
|
AS_IF([test "$enable_oshmem" != "no" && \
|
||||||
|
test "$enable_oshmem_profile" != "no"],
|
||||||
|
[AS_IF([test "$OPAL_C_HAVE_WEAK_SYMBOLS" -eq 1 && \
|
||||||
|
test "$OPAL_C_HAVE_MACRO_WEAK_SYMBOLS" -eq 1],
|
||||||
|
[ # We want OSHMEM and we have all the required weak
|
||||||
|
# symbol support
|
||||||
|
oshmem_profiling_support=1
|
||||||
|
AC_MSG_RESULT([yes (weak symbols supported)])],
|
||||||
|
[ # We want OSHMEM, but we do NOT have all the
|
||||||
|
# required weak symbol support
|
||||||
|
oshmem_profiling_support=0
|
||||||
|
AC_MSG_RESULT([no (weak symbols not supported)])
|
||||||
|
AS_IF([test "$OPAL_C_HAVE_WEAK_SYMBOLS" -eq 0],
|
||||||
|
[AC_MSG_WARN([Weak symbols not supported by compiler])])
|
||||||
|
AS_IF([test "$OPAL_C_HAVE_MACRO_WEAK_SYMBOLS" -eq 0],
|
||||||
|
[AC_MSG_WARN([Macro weak symbols not supported by compiler])])
|
||||||
|
AC_MSG_WARN([OpenSHMEM profiling is disabled.])
|
||||||
|
|
||||||
|
AS_IF(["$enable_oshmem_profile" = "yes" -a
|
||||||
|
$oshmem_profiling_support -eq 0],
|
||||||
|
[AC_MSG_WARN([OpenSHMEM profiling requested but cannot be enabled])
|
||||||
|
AC_MSG_ERROR([Cannot continue])])
|
||||||
|
])
|
||||||
|
],[
|
||||||
|
# We do not want OSHMEM, so disable profiling
|
||||||
|
oshmem_profiling_support=0
|
||||||
|
AC_MSG_RESULT([no (OpenSHMEM disabled)])
|
||||||
|
])
|
||||||
|
|
||||||
|
AM_CONDITIONAL([OSHMEM_PROFILING], [test $oshmem_profiling_support -eq 1])
|
||||||
|
]) dnl
|
12
configure.ac
12
configure.ac
@ -535,6 +535,7 @@ if test "x$opal_cv_c_compiler_vendor" != "xmicrosoft"; then
|
|||||||
AC_C_RESTRICT
|
AC_C_RESTRICT
|
||||||
fi
|
fi
|
||||||
OPAL_C_WEAK_SYMBOLS
|
OPAL_C_WEAK_SYMBOLS
|
||||||
|
OPAL_C_MACRO_WEAK_SYMBOLS
|
||||||
if test "$GCC" = "yes"; then
|
if test "$GCC" = "yes"; then
|
||||||
CFLAGS=$CFLAGS_save
|
CFLAGS=$CFLAGS_save
|
||||||
fi
|
fi
|
||||||
@ -601,17 +602,18 @@ m4_ifdef([project_oshmem], [OSHMEM_SETUP_JAVA_BINDINGS])
|
|||||||
|
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
# MPI API profiling layer
|
# MPI / OpenSHMEM API profiling layer
|
||||||
##################################
|
##################################
|
||||||
|
|
||||||
# Setup OMPI bindings (if we're building the OMPI project). Note that
|
# Setup profiling bindings (if we're building the relevant projects).
|
||||||
# opal_wrapper.c has a hard-coded use of the OMPI_ENABLE_MPI_PROFILING
|
# Note that opal_wrapper.c has a hard-coded use of the
|
||||||
# macro, so we need to define it (to 0) even if we're not building the
|
# OMPI_ENABLE_MPI_PROFILING macro, so we need to define it (to 0) even
|
||||||
# OMPI project.
|
# if we're not building the OMPI project.
|
||||||
|
|
||||||
m4_ifdef([project_ompi], [OMPI_SETUP_MPI_PROFILING],
|
m4_ifdef([project_ompi], [OMPI_SETUP_MPI_PROFILING],
|
||||||
[AC_DEFINE([OMPI_ENABLE_MPI_PROFILING], [0],
|
[AC_DEFINE([OMPI_ENABLE_MPI_PROFILING], [0],
|
||||||
[We are not building OMPI, so no profiling])])
|
[We are not building OMPI, so no profiling])])
|
||||||
|
m4_ifdef([project_oshmem], [OSHMEM_SETUP_PROFILING])
|
||||||
|
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user