hwloc: prefer external hwloc component
Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp> Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
146
opal/mca/hwloc/external/configure.m4
поставляемый
146
opal/mca/hwloc/external/configure.m4
поставляемый
@ -1,7 +1,7 @@
|
|||||||
# -*- shell-script -*-
|
# -*- shell-script -*-
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
|
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
|
||||||
# Copyright (c) 2014-2017 Research Organization for Information Science
|
# Copyright (c) 2014-2018 Research Organization for Information Science
|
||||||
# and Technology (RIST). All rights reserved.
|
# and Technology (RIST). All rights reserved.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018 Intel, Inc. All rights reserved.
|
# Copyright (c) 2018 Intel, Inc. All rights reserved.
|
||||||
@ -84,7 +84,7 @@ AC_DEFUN([MCA_opal_hwloc_external_POST_CONFIG],[
|
|||||||
AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
|
AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
|
||||||
AC_CONFIG_FILES([opal/mca/hwloc/external/Makefile])
|
AC_CONFIG_FILES([opal/mca/hwloc/external/Makefile])
|
||||||
|
|
||||||
OPAL_VAR_SCOPE_PUSH([opal_hwloc_external_CPPFLAGS_save opal_hwloc_external_CFLAGS_save opal_hwloc_external_LDFLAGS_save opal_hwloc_external_LIBS_save opal_hwloc_external_want opal_hwloc_external_tmp opal_hwloc_external_lstopo])
|
OPAL_VAR_SCOPE_PUSH([opal_hwloc_external_CPPFLAGS_save opal_hwloc_external_CFLAGS_save opal_hwloc_external_LDFLAGS_save opal_hwloc_external_LIBS_save opal_hwloc_external_tmp opal_hwloc_external_lstopo opal_hwloc_summary_msg])
|
||||||
|
|
||||||
AC_ARG_WITH([hwloc-libdir],
|
AC_ARG_WITH([hwloc-libdir],
|
||||||
[AC_HELP_STRING([--with-hwloc-libdir=DIR],
|
[AC_HELP_STRING([--with-hwloc-libdir=DIR],
|
||||||
@ -98,19 +98,9 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
|
|||||||
AC_MSG_WARN([were specified, which does not make sense.])
|
AC_MSG_WARN([were specified, which does not make sense.])
|
||||||
AC_MSG_ERROR([Cannot continue])])
|
AC_MSG_ERROR([Cannot continue])])
|
||||||
|
|
||||||
# Do we want this external component? (slightly redundant logic,
|
opal_hwloc_summary_msg="internal"
|
||||||
# but hopefully slightly more clear...)
|
# Try external support if needed
|
||||||
opal_hwloc_external_want=no
|
AS_IF([test "$with_hwloc" != "internal"],
|
||||||
AS_IF([test "$with_hwloc_libdir" != ""], [opal_hwloc_external_want=yes])
|
|
||||||
AS_IF([test "$with_hwloc" = "external"], [opal_hwloc_external_want=yes])
|
|
||||||
AS_IF([test "$with_hwloc" != "" && \
|
|
||||||
test "$with_hwloc" != "no" && \
|
|
||||||
test "$with_hwloc" != "internal" && \
|
|
||||||
test "$with_hwloc" != "future"], [opal_hwloc_external_want=yes])
|
|
||||||
AS_IF([test "$with_hwloc" = "no"], [opal_hwloc_external_want=no])
|
|
||||||
|
|
||||||
# If we still want external support, try it
|
|
||||||
AS_IF([test "$opal_hwloc_external_want" = "yes"],
|
|
||||||
[OPAL_CHECK_WITHDIR([hwloc-libdir], [$with_hwloc_libdir],
|
[OPAL_CHECK_WITHDIR([hwloc-libdir], [$with_hwloc_libdir],
|
||||||
[libhwloc.*])
|
[libhwloc.*])
|
||||||
|
|
||||||
@ -144,64 +134,86 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
|
|||||||
LDFLAGS="$LDFLAGS $opal_hwloc_external_LDFLAGS"
|
LDFLAGS="$LDFLAGS $opal_hwloc_external_LDFLAGS"
|
||||||
LIBS="$LIBS $opal_hwloc_external_LIBS"
|
LIBS="$LIBS $opal_hwloc_external_LIBS"
|
||||||
AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include <hwloc.h>])
|
AC_CHECK_DECLS([HWLOC_OBJ_OSDEV_COPROC], [], [], [#include <hwloc.h>])
|
||||||
AC_CHECK_FUNCS([hwloc_topology_dup])])
|
AC_CHECK_FUNCS([hwloc_topology_dup])
|
||||||
|
|
||||||
CPPFLAGS=$opal_hwloc_external_CPPFLAGS_save
|
AC_MSG_CHECKING([if external hwloc version is 1.5 or greater])
|
||||||
CFLAGS=$opal_hwloc_external_CFLAGS_save
|
AC_COMPILE_IFELSE(
|
||||||
LDFLAGS=$opal_hwloc_external_LDFLAGS_save
|
[AC_LANG_PROGRAM([[#include <hwloc.h>]],
|
||||||
LIBS=$opal_hwloc_external_LIBS_save
|
[[
|
||||||
|
#if HWLOC_API_VERSION < 0x00010500
|
||||||
|
#error "hwloc API version is less than 0x00010500"
|
||||||
|
#endif
|
||||||
|
]])],
|
||||||
|
[AC_MSG_RESULT([yes])],
|
||||||
|
[AC_MSG_RESULT([no])
|
||||||
|
opal_hwloc_external_support=no])])
|
||||||
|
|
||||||
|
# If external hwloc is not explicitly requested, check external version
|
||||||
|
# is not lower than the internal one
|
||||||
|
AS_IF([test "$opal_hwloc_external_support" = "yes"],
|
||||||
|
[AS_IF([test -z "$with_hwloc" || test "$with_hwloc" = "yes"],
|
||||||
|
[AC_MSG_CHECKING([if external hwloc version is 2.0 or greater])
|
||||||
|
AC_COMPILE_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM([[#include <hwloc.h>]],
|
||||||
|
[[
|
||||||
|
#if HWLOC_API_VERSION < 0x00020000
|
||||||
|
#error "hwloc API version is less than 0x00020000"
|
||||||
|
#endif
|
||||||
|
]])],
|
||||||
|
[AC_MSG_RESULT([yes])],
|
||||||
|
[AC_MSG_RESULT([no])
|
||||||
|
opal_hwloc_summary_msg="internal (external hlwoc version is less than internal version 2.0)"
|
||||||
|
AC_MSG_WARN([external hwloc version is less than internal version 2.0])
|
||||||
|
AC_MSG_WARN([using internal hwloc])
|
||||||
|
opal_hwloc_external_support=no])])])
|
||||||
|
|
||||||
|
AS_IF([test "$opal_hwloc_external_support" = "yes"],
|
||||||
|
[AC_DEFINE_UNQUOTED([HWLOC_EXTERNAL_HWLOC_VERSION],
|
||||||
|
[external],
|
||||||
|
[Version of hwloc])
|
||||||
|
|
||||||
|
# See if the external hwloc supports XML
|
||||||
|
AC_MSG_CHECKING([if external hwloc supports XML])
|
||||||
|
AS_IF([test "$opal_hwloc_dir" != ""],
|
||||||
|
[opal_hwloc_external_lstopo="$opal_hwloc_dir/bin/lstopo"],
|
||||||
|
[OPAL_WHICH(lstopo, opal_hwloc_external_lstopo)])
|
||||||
|
opal_hwloc_external_tmp=`$opal_hwloc_external_lstopo --help | $GREP "Supported output file formats" | grep xml`
|
||||||
|
AS_IF([test "$opal_hwloc_external_tmp" = ""],
|
||||||
|
[opal_hwloc_external_enable_xml=0
|
||||||
|
AC_MSG_RESULT([no])],
|
||||||
|
[opal_hwloc_external_enable_xml=1
|
||||||
|
AC_MSG_RESULT([yes])])
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([infiniband/verbs.h])
|
||||||
|
|
||||||
|
# These flags need to get passed to the wrapper compilers
|
||||||
|
# (this is unnecessary for the internal/embedded hwloc)
|
||||||
|
|
||||||
|
# Finally, add some flags to the wrapper compiler if we're
|
||||||
|
# building with developer headers so that our headers can
|
||||||
|
# be found.
|
||||||
|
hwloc_external_WRAPPER_EXTRA_CPPFLAGS=$opal_hwloc_external_CPPFLAGS
|
||||||
|
hwloc_external_WRAPPER_EXTRA_LDFLAGS=$opal_hwloc_external_LDFLAGS
|
||||||
|
hwloc_external_WRAPPER_EXTRA_LIBS=$opal_hwloc_external_LIBS])
|
||||||
|
|
||||||
|
CPPFLAGS=$opal_hwloc_external_CPPFLAGS_save
|
||||||
|
CFLAGS=$opal_hwloc_external_CFLAGS_save
|
||||||
|
LDFLAGS=$opal_hwloc_external_LDFLAGS_save
|
||||||
|
LIBS=$opal_hwloc_external_LIBS_save
|
||||||
])
|
])
|
||||||
|
|
||||||
# Done!
|
# Done!
|
||||||
AS_IF([test "$opal_hwloc_external_support" = "yes"],
|
AS_IF([test "$opal_hwloc_external_support" = "yes"],
|
||||||
[AC_DEFINE_UNQUOTED([HWLOC_EXTERNAL_HWLOC_VERSION],
|
[opal_hwloc_summary_msg="external"
|
||||||
[external],
|
|
||||||
[Version of hwloc])
|
|
||||||
|
|
||||||
# See if the external hwloc supports XML
|
|
||||||
AC_MSG_CHECKING([if external hwloc supports XML])
|
|
||||||
AS_IF([test "$opal_hwloc_dir" != ""],
|
|
||||||
[opal_hwloc_external_lstopo="$opal_hwloc_dir/bin/lstopo"],
|
|
||||||
[OPAL_WHICH(lstopo, opal_hwloc_external_lstopo)])
|
|
||||||
opal_hwloc_external_tmp=`$opal_hwloc_external_lstopo --help | $GREP "Supported output file formats" | grep xml`
|
|
||||||
AS_IF([test "$opal_hwloc_external_tmp" = ""],
|
|
||||||
[opal_hwloc_external_enable_xml=0
|
|
||||||
AC_MSG_RESULT([no])],
|
|
||||||
[opal_hwloc_external_enable_xml=1
|
|
||||||
AC_MSG_RESULT([yes])])
|
|
||||||
|
|
||||||
AC_CHECK_HEADERS([infiniband/verbs.h])
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([if external hwloc version is 1.5 or greater])
|
|
||||||
AS_IF([test "$opal_hwloc_dir" != ""],
|
|
||||||
[opal_hwloc_external_CFLAGS_save=$CFLAGS
|
|
||||||
CFLAGS="-I$opal_hwloc_dir/include $opal_hwloc_external_CFLAGS_save"])
|
|
||||||
AC_COMPILE_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([[#include <hwloc.h>]],
|
|
||||||
[[
|
|
||||||
#if HWLOC_API_VERSION < 0x00010500
|
|
||||||
#error "hwloc API version is less than 0x00010500"
|
|
||||||
#endif
|
|
||||||
]])],
|
|
||||||
[AC_MSG_RESULT([yes])],
|
|
||||||
[AC_MSG_RESULT([no])
|
|
||||||
AC_MSG_ERROR([Cannot continue])])
|
|
||||||
|
|
||||||
AS_IF([test "$opal_hwloc_dir" != ""],
|
|
||||||
[CFLAGS=$opal_hwloc_external_CFLAGS_save])
|
|
||||||
|
|
||||||
# These flags need to get passed to the wrapper compilers
|
|
||||||
# (this is unnecessary for the internal/embedded hwloc)
|
|
||||||
|
|
||||||
# Finally, add some flags to the wrapper compiler if we're
|
|
||||||
# building with developer headers so that our headers can
|
|
||||||
# be found.
|
|
||||||
hwloc_external_WRAPPER_EXTRA_CPPFLAGS=$opal_hwloc_external_CPPFLAGS
|
|
||||||
hwloc_external_WRAPPER_EXTRA_LDFLAGS=$opal_hwloc_external_LDFLAGS
|
|
||||||
hwloc_external_WRAPPER_EXTRA_LIBS=$opal_hwloc_external_LIBS
|
|
||||||
|
|
||||||
$1],
|
$1],
|
||||||
[$2])
|
[# Abort is external hwloc was explicitly requested but cannot be built
|
||||||
|
AS_IF([test "$with_hwloc" != internal &&
|
||||||
|
test -n "$with_hwloc"],
|
||||||
|
[AC_MSG_WARN([external hwloc cannot be built])
|
||||||
|
AC_MSG_ERROR([Cannot continue.])])
|
||||||
|
$2])
|
||||||
|
|
||||||
|
OPAL_SUMMARY_ADD([[Miscellaneous]],[[HWLOC support]], [], [$opal_hwloc_summary_msg])
|
||||||
|
|
||||||
AC_SUBST(opal_hwloc_external_LDFLAGS)
|
AC_SUBST(opal_hwloc_external_LDFLAGS)
|
||||||
AC_SUBST(opal_hwloc_external_LIBS)
|
AC_SUBST(opal_hwloc_external_LIBS)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
|
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
|
||||||
# Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
# Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
||||||
# Copyright (c) 2015-2017 Research Organization for Information Science
|
# Copyright (c) 2015-2018 Research Organization for Information Science
|
||||||
# and Technology (RIST). All rights reserved.
|
# and Technology (RIST). All rights reserved.
|
||||||
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||||
# reserved.
|
# reserved.
|
||||||
@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
# Priority
|
# Priority
|
||||||
#
|
#
|
||||||
AC_DEFUN([MCA_opal_hwloc_hwloc201_PRIORITY], [90])
|
AC_DEFUN([MCA_opal_hwloc_hwloc201_PRIORITY], [80])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Force this component to compile in static-only mode
|
# Force this component to compile in static-only mode
|
||||||
|
Ссылка в новой задаче
Block a user