1
1

Similar to r27794, simplify the hwloc framework by changing it to

STOP_AT_FIRST.  And move the side-effect-inducing code in
hwloc142/configure.m4 up to POST_CONFIG.

Also change the priority of the external hwloc component to 90 so that
it is evaluated before the internal component (as a direct result of
changing to STOP_AT_FIRST).

This commit was SVN r27796.

The following SVN revision numbers were found above:
  r27794 --> open-mpi/ompi@569a60c2de
Этот коммит содержится в:
Jeff Squyres 2013-01-12 01:48:53 +00:00
родитель a0874b61e6
Коммит 427c154800
3 изменённых файлов: 55 добавлений и 88 удалений

Просмотреть файл

@ -1,6 +1,6 @@
dnl -*- shell-script -*-
dnl
dnl Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -11,25 +11,14 @@ dnl
# There will only be one component used in this framework, and it will
# be selected at configure time by priority. Components must set
# their priorities in their configure.m4 files. They must also set
# the shell variable $opal_hwloc_<component>_include to a header file
# the shell variable $opal_hwloc_base_include to a header file
# name (relative to the top OMPI source directory) that will be
# included in opal/mca/hwloc/hwloc.h.
# Optionally, components may also set the following shell variables:
#
# opal_hwloc_<component>_ADD_CPPFLAGS
# opal_hwloc_<component>_ADD_LDFLAGS
# opal_hwloc_<component>_ADD_LIBS
# opal_hwloc_<component>_ADD_WRAPPER_EXTRA_CPPFLAGS
# opal_hwloc_<component>_ADD_WRAPPER_EXTRA_LDFLAGS
# opal_hwloc_<component>_ADD_WRAPPER_EXTRA_LIBS
#
# The first 3 will be added to the over all CPPFLAGS/LDFLAGS/LIBS if
# that component is chosen as the winning component. Similarly, the
# latter 3 will be added to WRAPPER_EXTRA_* if that component wins.
dnl We only want one winning component.
m4_define(MCA_opal_hwloc_CONFIGURE_MODE, STOP_AT_FIRST_PRIORITY)
dnl We only want one winning component (vs. STOP_AT_FIRST_PRIORITY,
dnl which will allow all components of the same priority who succeed to
dnl win)
m4_define(MCA_opal_hwloc_CONFIGURE_MODE, STOP_AT_FIRST)
# Other components may depend on at least 1 hwloc component being
# available. As such, we may need to artificially force this
@ -49,6 +38,7 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG],[
# See comments above for why this is a separate macro.
AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
opal_hwloc_base_include=
# If this shell variable is not 1, then this m4 is being invoked
# "early" via AC REQUIRE. Therefore, since we like having fairly
@ -113,9 +103,6 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
# Restore the --enable-pci flag
enable_pci=$opal_hwloc_hwloc132_save_enable_pci
# Strip any leading/trailing spaces
opal_hwloc_winner=`echo $MCA_opal_hwloc_STATIC_COMPONENTS | sed -e 's/^[ ]+//' | sed -e 's/[ ]+$//'`
# Give a blank line to separate these messages from the last
# component's configure.m4 output.
echo " "
@ -128,14 +115,6 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
AS_IF([test "$MCA_opal_hwloc_STATIC_COMPONENTS" = ""],
[AC_MSG_WARN([Did not find a suitable static opal hwloc component])
AC_MSG_ERROR([Cannot continue])])
# If there's any spaces in the middle of the string, then we
# found more than 1 eligible static component. That's no good
# (and should never happen, but let's be sure)!
AS_IF([test "`echo $opal_hwloc_winner | sed 's/ //'`" != "$opal_hwloc_winner"],
[AC_MSG_WARN([Found more than 1 eligible static opal hwloc component])
AC_MSG_WARN([This should never happen!])
AC_MSG_ERROR([Cannot continue])])
])
# If we have a winning component, do some more logic
@ -146,25 +125,15 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
# The winning component will have told us where their header file
# is located
AC_MSG_CHECKING([for winning hwloc component header file])
eval "opal_hwloc_base_include=\`echo \$opal_hwloc_${opal_hwloc_winner}_include\`"
AS_IF([test "$opal_hwloc_base_include" = ""],
[AC_MSG_RESULT([missing])
AC_MSG_WARN([Missing implementation header])
AC_MSG_ERROR([Cannot continue])])
AC_MSG_RESULT([$opal_hwloc_base_include])
AC_DEFINE_UNQUOTED([MCA_hwloc_IMPLEMENTATION_HEADER],
["$opal_hwloc_base_include"],
[Header to include for hwloc implementation])
# See if they set any flags for us
_MCA_opal_hwloc_base_flags([CPPFLAGS], [CPPFLAGS])
_MCA_opal_hwloc_base_flags([LDFLAGS], [LDFLAGS])
_MCA_opal_hwloc_base_flags([LIBS], [LIBS])
_MCA_opal_hwloc_base_flags([wrapper CPPFLAGS], [WRAPPER_EXTRA_CPPFLAGS])
_MCA_opal_hwloc_base_flags([wrapper LDFLAGS], [WRAPPER_EXTRA_LDFLAGS])
_MCA_opal_hwloc_base_flags([wrapper LIBS], [WRAPPER_EXTRA_LIBS])
# If we added any -L flags to ADD_LDFLAGS, then we (might)
# need to add those directories to LD_LIBRARY_PATH.
# Otherwise, if we try to AC RUN_IFELSE anything here in
@ -203,16 +172,3 @@ AC_DEFUN([MCA_opal_hwloc_CONFIG_REQUIRE],[
echo "<== We now return you to your regularly scheduled programming."
echo " "]);
])
dnl Helper function
dnl $1 = message to display
dnl $2 = output variable to set / input variable suffix
AC_DEFUN([_MCA_opal_hwloc_base_flags],[
AC_MSG_CHECKING([for winning hwloc component additional $1])
eval "opal_hwloc_base_tmp=\`echo \$opal_hwloc_${opal_hwloc_winner}_ADD_$2\`"
AS_IF([test "$opal_hwloc_base_tmp" != ""],
[AC_MSG_RESULT([$opal_hwloc_base_tmp])
$2="[$]$2 $opal_hwloc_base_tmp"],
[AC_MSG_RESULT([none])])
])dnl

7
opal/mca/hwloc/external/configure.m4 поставляемый
Просмотреть файл

@ -1,6 +1,6 @@
# -*- shell-script -*-
#
# Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
#
# $COPYRIGHT$
#
@ -12,7 +12,7 @@
#
# Priority
#
AC_DEFUN([MCA_opal_hwloc_external_PRIORITY], [10])
AC_DEFUN([MCA_opal_hwloc_external_PRIORITY], [90])
#
# Force this component to compile in static-only mode
@ -27,7 +27,8 @@ AC_DEFUN([MCA_opal_hwloc_external_COMPILE_MODE], [
# MCA_hwloc_external_POST_CONFIG()
# ---------------------------------
AC_DEFUN([MCA_opal_hwloc_external_POST_CONFIG],[
HWLOC_DO_AM_CONDITIONALS
AS_IF([test "$1" = "1"],
[HWLOC_DO_AM_CONDITIONALS])
])dnl

Просмотреть файл

@ -1,6 +1,6 @@
# -*- shell-script -*-
#
# Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
#
# $COPYRIGHT$
#
@ -12,7 +12,7 @@
#
# Priority
#
AC_DEFUN([MCA_opal_hwloc_hwloc142_PRIORITY], [65])
AC_DEFUN([MCA_opal_hwloc_hwloc142_PRIORITY], [50])
#
# Force this component to compile in static-only mode
@ -33,7 +33,34 @@ m4_include(opal/mca/hwloc/hwloc142/hwloc/config/hwloc_check_vendor.m4)
# MCA_hwloc_hwloc142_POST_CONFIG()
# ---------------------------------
AC_DEFUN([MCA_opal_hwloc_hwloc142_POST_CONFIG],[
OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc142_basedir])
# If we won, then do all the rest of the setup
AS_IF([test "$1" = "1"],
[
# Set this variable so that the framework m4 knows what
# file to include in opal/mca/hwloc/hwloc.h
opal_hwloc_hwloc142_basedir=opal/mca/hwloc/hwloc142
opal_hwloc_base_include="$opal_hwloc_hwloc142_basedir/hwloc142.h"
# Add some stuff to CPPFLAGS so that the rest of the source
# tree can be built
file=$opal_hwloc_hwloc142_basedir/hwloc
CPPFLAGS="$CPPFLAGS -I$OMPI_TOP_SRCDIR/$file/include"
AS_IF([test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"],
[$CPPFLAGS="$CPPFLAGS -I$OMPI_TOP_BUILDDIR/$file/include"])
unset file
# Finally, add some flags to the wrapper compiler if we're
# building with developer headers so that our headers can
# be found.
AS_IF([test "$with_devel_headers" = "yes"],
[OPAL_WRAPPER_EXTRA_CPPFLAGS="$OPAL_WRAPPER_EXTRA_CPPFLAGS "'-I${includedir}/openmpi/'"$opal_hwloc_hwloc142_basedir/hwloc/include"])
OPAL_WRAPPER_EXTRA_LIBS="$OPAL_WRAPPER_EXTRA_LIBS $HWLOC_EMBEDDED_LIBS"
HWLOC_DO_AM_CONDITIONALS
])
OPAL_VAR_SCOPE_POP
])dnl
@ -84,7 +111,19 @@ AC_DEFUN([MCA_opal_hwloc_hwloc142_CONFIG],[
# Build flags for our Makefile.am
opal_hwloc_hwloc142_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)'
opal_hwloc_hwloc142_LIBS='$(top_ompi_builddir)/'"$opal_hwloc_hwloc142_basedir"'/hwloc/src/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)'
opal_hwloc_hwloc142_support=yes],
opal_hwloc_hwloc142_support=yes
AC_DEFINE_UNQUOTED([HWLOC_HWLOC142_HWLOC_VERSION],
["$HWLOC_VERSION"],
[Version of hwloc])
# Do we have verbs support?
CPPFLAGS_save=$CPPFLAGS
AS_IF([test "$opal_want_verbs" = "yes"],
[CPPFLAGS="-I$opal_verbs_dir/include $CPPFLAGS"])
AC_CHECK_HEADERS([infiniband/verbs.h])
CPPFLAGS=$CPPFLAGS_save
],
[AC_MSG_CHECKING([whether hwloc configure succeeded])
AC_MSG_RESULT([no])
opal_hwloc_hwloc142_support=no])
@ -108,36 +147,7 @@ AC_DEFUN([MCA_opal_hwloc_hwloc142_CONFIG],[
# Done!
AS_IF([test "$opal_hwloc_hwloc142_support" = "yes"],
[AC_DEFINE_UNQUOTED([HWLOC_HWLOC142_HWLOC_VERSION],
["$HWLOC_VERSION"],
[Version of hwloc])
# Do we have verbs support?
CPPFLAGS_save=$CPPFLAGS
AS_IF([test "$opal_want_verbs" = "yes"],
[CPPFLAGS="-I$opal_verbs_dir/include $CPPFLAGS"])
AC_CHECK_HEADERS([infiniband/verbs.h])
CPPFLAGS=$CPPFLAGS_save
# Set these variables so that the framework m4 knows
# what file to include in opal/mca/hwloc/hwloc.h
opal_hwloc_hwloc142_include="$opal_hwloc_hwloc142_basedir/hwloc142.h"
# Also pass some *_ADD_* flags upwards to the framework m4
# for various compile/link flags that are needed a) to
# build the rest of the source tree, and b) for the wrapper
# compilers (in the --with-devel-headers case).
opal_hwloc_hwloc142_file=$opal_hwloc_hwloc142_basedir/hwloc
opal_hwloc_hwloc142_ADD_CPPFLAGS="-I$OMPI_TOP_SRCDIR/$opal_hwloc_hwloc142_file/include"
AS_IF([test "$OMPI_TOP_BUILDDIR" != "$OMPI_TOP_SRCDIR"],
[opal_hwloc_hwloc142_ADD_CPPFLAGS="$opal_hwloc_hwloc142_ADD_CPPFLAGS -I$OMPI_TOP_BUILDDIR/$opal_hwloc_hwloc142_file/include"])
if test "$with_devel_headers" = "yes" ; then
opal_hwloc_hwloc142_ADD_WRAPPER_EXTRA_CPPFLAGS='-I${includedir}/openmpi/'"$opal_hwloc_hwloc142_basedir/hwloc/include"
fi
opal_hwloc_hwloc142_ADD_WRAPPER_EXTRA_LIBS=$HWLOC_EMBEDDED_LIBS
$1],
[$1],
[$2])
OPAL_VAR_SCOPE_POP