-
Notifications
You must be signed in to change notification settings - Fork 937
Change defaults to prefer external libevent/hwloc #5395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Gilles Gouaillardet <[email protected]> Signed-off-by: Jeff Squyres <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| # -*- shell-script -*- | ||
| # | ||
| # 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. | ||
| # | ||
| # 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_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_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_ERROR([Cannot continue])]) | ||
|
|
||
| # Do we want this external component? (slightly redundant logic, | ||
| # but hopefully slightly more clear...) | ||
| opal_hwloc_external_want=no | ||
| 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_hwloc_summary_msg="internal" | ||
| # Try external support if needed | ||
| AS_IF([test "$with_hwloc" != "internal"], | ||
| [OPAL_CHECK_WITHDIR([hwloc-libdir], [$with_hwloc_libdir], | ||
| [libhwloc.*]) | ||
|
|
||
|
|
@@ -144,64 +134,86 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[ | |
| LDFLAGS="$LDFLAGS $opal_hwloc_external_LDFLAGS" | ||
| LIBS="$LIBS $opal_hwloc_external_LIBS" | ||
| 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 | ||
| CFLAGS=$opal_hwloc_external_CFLAGS_save | ||
| LDFLAGS=$opal_hwloc_external_LDFLAGS_save | ||
| LIBS=$opal_hwloc_external_LIBS_save | ||
| ]) | ||
|
|
||
| # Done! | ||
| 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]) | ||
|
|
||
| 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>]], | ||
| [[ | ||
| AC_MSG_CHECKING([if external hwloc version is 1.5 or greater]) | ||
| 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]) | ||
| ]])], | ||
| [AC_MSG_RESULT([yes])], | ||
| [AC_MSG_RESULT([no]) | ||
| opal_hwloc_external_support=no])]) | ||
|
|
||
| # These flags need to get passed to the wrapper compilers | ||
| # (this is unnecessary for the internal/embedded hwloc) | ||
| # 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" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to have this version by reference instead of by value? I.e., I imagine that this will be one more place to forget to update if/when we update the embedded version of hwloc.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not know ... strictly speaking, this is not even the library version (e.g. 2.0.1) but the API version (e.g. 2.0.0). @bgoglin is there any way to test the __library__version instead of the API version at compile time ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ggouaillardet Don't you also need to test that
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rhc54 you are right, and I just pushed a commit that fixes that. |
||
| #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])])]) | ||
|
|
||
| # 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 | ||
| 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! | ||
| AS_IF([test "$opal_hwloc_external_support" = "yes"], | ||
| [opal_hwloc_summary_msg="external" | ||
| $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_LIBS) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #5031, if external support is not available, we need to emit a message at the bottom of this configure.m4:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed in the latest commit