Merge pull request #5395 from jsquyres/pr/prefer-externals
Change defaults to prefer external libevent/hwloc
Этот коммит содержится в:
Коммит
92d89411ca
@ -1,6 +1,6 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
|
||||
dnl Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
@ -8,21 +8,52 @@ dnl
|
||||
dnl $HEADER$
|
||||
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_event_base_include to a header file name
|
||||
# (relative to opal/mca/event) that will be included in
|
||||
# opal/mca/event/event.h.
|
||||
dnl There will only be one component used in this framework, and it will
|
||||
dnl be selected at configure time by priority. Components must set
|
||||
dnl their priorities in their configure.m4 files. They must also set
|
||||
dnl the shell variable $opal_event_base_include to a header file name
|
||||
dnl (relative to opal/mca/event) that will be included in
|
||||
dnl opal/mca/event/event.h.
|
||||
|
||||
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_event_CONFIGURE_MODE, STOP_AT_FIRST)
|
||||
|
||||
dnl
|
||||
dnl Setup --with-libevent and --with-libevent-libdir
|
||||
dnl
|
||||
AC_DEFUN([MCA_opal_event_SETUP],[
|
||||
AC_ARG_WITH([libevent],
|
||||
[AC_HELP_STRING([--with-libevent=DIR],
|
||||
[Search for libevent headers and libraries in DIR. Should only be used if an external copy of libevent is being used.])])
|
||||
|
||||
# Bozo check
|
||||
AS_IF([test "$with_libevent" = "no"],
|
||||
[AC_MSG_WARN([It is not possible to configure Open MPI --without-libevent])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
AS_IF([test "$with_libevent" = "yes"],
|
||||
[with_libevent=])
|
||||
|
||||
AC_ARG_WITH([libevent-libdir],
|
||||
[AC_HELP_STRING([--with-libevent-libdir=DIR],
|
||||
[Search for libevent libraries in DIR. Should only be used if an external copy of libevent is being used.])])
|
||||
|
||||
# Make sure the user didn't specify --with-libevent=internal and
|
||||
# --with-libevent-libdir=whatever (because you can only specify
|
||||
# --with-libevent-libdir when external libevent is being used).
|
||||
AS_IF([test "$with_libevent" = "internal" && test -n "$with_libevent_libdir"],
|
||||
[AC_MSG_WARN([Both --with-libevent=internal and --with-libevent-libdir=DIR])
|
||||
AC_MSG_WARN([were specified, which does not make sense.])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
])
|
||||
|
||||
AC_DEFUN([MCA_opal_event_CONFIG],[
|
||||
opal_event_base_include=
|
||||
|
||||
MCA_opal_event_SETUP
|
||||
|
||||
# configure all the components
|
||||
MCA_CONFIGURE_FRAMEWORK($1, $2, 1)
|
||||
|
||||
|
93
opal/mca/event/external/configure.m4
поставляемый
93
opal/mca/event/external/configure.m4
поставляемый
@ -1,8 +1,8 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2009-2018 Cisco Systems, Inc. All rights reserved
|
||||
# Copyright (c) 2013 Los Alamos National Security, LLC. 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.
|
||||
#
|
||||
# Copyright (c) 2017 Intel, Inc. All rights reserved.
|
||||
@ -56,44 +56,30 @@ AC_DEFUN([MCA_opal_event_external_POST_CONFIG],[
|
||||
AC_DEFUN([MCA_opal_event_external_CONFIG],[
|
||||
AC_CONFIG_FILES([opal/mca/event/external/Makefile])
|
||||
|
||||
OPAL_VAR_SCOPE_PUSH([opal_event_external_CPPFLAGS_save opal_event_external_CFLAGS_save opal_event_external_LDFLAGS_save opal_event_external_LIBS_save])
|
||||
OPAL_VAR_SCOPE_PUSH([opal_event_external_CPPFLAGS_save opal_event_external_CFLAGS_save opal_event_external_LDFLAGS_save opal_event_external_LIBS_save opal_event_dir opal_event_external_support opal_event_summary_msg])
|
||||
|
||||
AC_ARG_WITH([libevent],
|
||||
[AC_HELP_STRING([--with-libevent=DIR],
|
||||
[Search for libevent headers and libraries in DIR. Should only be used if an external copy of libevent is being used.])])
|
||||
# Make some processing below easier ($with_libevent==yes and
|
||||
# $with_libevent==no has already been filtered out).
|
||||
AS_IF([test "$with_libevent" = "external"],
|
||||
[with_libevent=])
|
||||
|
||||
# Bozo check
|
||||
AS_IF([test "$with_libevent" = "no"],
|
||||
[AC_MSG_WARN([It is not possible to configure Open MPI --without-libevent])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
opal_event_summary_msg="internal"
|
||||
|
||||
AC_ARG_WITH([libevent-libdir],
|
||||
[AC_HELP_STRING([--with-libevent-libdir=DIR],
|
||||
[Search for libevent libraries in DIR. Should only be used if an external copy of libevent is being used.])])
|
||||
# Once we get to this point, $with_libevent is either: blank, a
|
||||
# directory location, or "internal".
|
||||
|
||||
# Make sure the user didn't specify --with-libevent=internal and
|
||||
# --with-libevent-libdir=whatever (because you can only specify
|
||||
# --with-libevent-libdir when external libevent is being used).
|
||||
AS_IF([test "$with_libevent" = "internal" && test -n "$with_libevent_libdir"],
|
||||
[AC_MSG_WARN([Both --with-libevent=internal and --with-libevent-libdir=DIR])
|
||||
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_event_external_want=no
|
||||
AS_IF([test "$with_libevent" = "external"], [opal_event_external_want=yes])
|
||||
AS_IF([test -n "$with_libevent_libdir"], [opal_event_external_want=yes])
|
||||
AS_IF([test -n "$with_libevent" && test "$with_libevent" != "no" && test "$with_libevent" != "internal"], [opal_event_external_want=yes])
|
||||
|
||||
# If we want external support, try it
|
||||
AS_IF([test "$opal_event_external_want" = "yes"],
|
||||
[ # Error out if the specified dir does not exist
|
||||
# Check the value of $with_libevent_libdir. This macro safely
|
||||
# handles "yes", "no", blank, and directory name values.
|
||||
OPAL_CHECK_WITHDIR([libevent-libdir], [$with_libevent_libdir],
|
||||
[libevent.*])
|
||||
|
||||
# Did the user want us to check for libevent in a specific location?
|
||||
AC_MSG_CHECKING([for external libevent in])
|
||||
AS_IF([test "$with_libevent" != "external" && test "$with_libevent" != "yes"],
|
||||
AS_IF([test -n "$with_libevent" && \
|
||||
test "$with_libevent" != "external" && \
|
||||
test "$with_libevent" != "internal" && \
|
||||
test "$with_libevent" != "yes" && \
|
||||
test "$with_libevent" != "no"],
|
||||
[opal_event_dir=$with_libevent
|
||||
AC_MSG_RESULT([$opal_event_dir])
|
||||
OPAL_CHECK_WITHDIR([libevent], [$opal_event_dir],
|
||||
@ -121,7 +107,8 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[
|
||||
AS_IF([test ! -z "$with_libevent_libdir" && test "$with_libevent_libdir" != "yes"],
|
||||
[opal_event_libdir="$with_libevent_libdir"])
|
||||
|
||||
opal_event_external_CPPFLAGS_save=$CPPFLAGS
|
||||
AS_IF([test "$with_libevent" != "internal"],
|
||||
[opal_event_external_CPPFLAGS_save=$CPPFLAGS
|
||||
opal_event_external_CFLAGS_save=$CFLAGS
|
||||
opal_event_external_LDFLAGS_save=$LDFLAGS
|
||||
opal_event_external_LIBS_save=$LIBS
|
||||
@ -136,7 +123,8 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[
|
||||
[opal_event_external_support=yes],
|
||||
[opal_event_external_support=no])
|
||||
|
||||
# Ensure that this libevent has the symbol
|
||||
AS_IF([test "$opal_event_external_support" = "yes"],
|
||||
[# Ensure that this libevent has the symbol
|
||||
# "evthread_set_lock_callbacks", which will only exist if
|
||||
# libevent was configured with thread support.
|
||||
LIBS="$opal_event_external_LDFLAGS $LIBS"
|
||||
@ -145,14 +133,32 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[
|
||||
[AC_MSG_WARN([External libevent does not have thread support])
|
||||
AC_MSG_WARN([Open MPI requires libevent to be compiled with])
|
||||
AC_MSG_WARN([thread support enabled])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
opal_event_external_support=no])])
|
||||
|
||||
AC_CHECK_LIB([event_pthreads], [evthread_use_pthreads],
|
||||
AS_IF([test "$opal_event_external_support" = "yes"],
|
||||
[AC_CHECK_LIB([event_pthreads], [evthread_use_pthreads],
|
||||
[],
|
||||
[AC_MSG_WARN([External libevent does not have thread support])
|
||||
AC_MSG_WARN([Open MPI requires libevent to be compiled with])
|
||||
AC_MSG_WARN([thread support enabled])
|
||||
AC_MSG_ERROR([Cannot continue])])
|
||||
opal_event_external_support=no])])
|
||||
|
||||
AS_IF([test "$opal_event_external_support" = "yes"],
|
||||
[AS_IF([test -z "$with_libevent" || test "$with_libevent" = "yes"],
|
||||
[AC_MSG_CHECKING([if external libevent version is 2.0.21 or greater])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <event.h>]],
|
||||
[[
|
||||
#if _EVENT_NUMERIC_VERSION < 0x02001500
|
||||
#error "libevent API version is less than 0x02001500"
|
||||
#endif
|
||||
]])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
opal_event_summary_msg="internal (external libevent version is less that internal version 2.0.21)"
|
||||
AC_MSG_WARN([external libevent version is less than internal version (2.0.21)])
|
||||
AC_MSG_WARN([using internal libevent])
|
||||
opal_event_external_support=no])])])
|
||||
|
||||
CPPFLAGS=$opal_event_external_CPPFLAGS_save
|
||||
CFLAGS=$opal_event_external_CFLAGS_save
|
||||
@ -171,20 +177,27 @@ AC_DEFUN([MCA_opal_event_external_CONFIG],[
|
||||
# building with developer headers so that our headers can
|
||||
# be found.
|
||||
event_external_WRAPPER_EXTRA_LDFLAGS=$opal_event_external_LDFLAGS
|
||||
event_external_WRAPPER_EXTRA_LIBS=$opal_event_external_LIBS
|
||||
])
|
||||
event_external_WRAPPER_EXTRA_LIBS=$opal_event_external_LIBS])
|
||||
|
||||
##################################################################
|
||||
|
||||
# Done!
|
||||
AS_IF([test "$opal_event_external_support" = "yes"],
|
||||
[ # If we configured successfully, set
|
||||
[# If we configured successfully, set
|
||||
# OPAL_HAVE_WORKING_EVENTOPS to 1 (it's a calculated value
|
||||
# in the embedded Open MPI libevent, so we can only assume
|
||||
# what it is in the installed libevent :-\ ).
|
||||
file=$opal_event_dir/include/libevent/config.h
|
||||
OPAL_HAVE_WORKING_EVENTOPS=1
|
||||
opal_event_summary_msg="external"
|
||||
$1],
|
||||
[OPAL_HAVE_WORKING_EVENTOPS=0
|
||||
AS_IF([test "$with_libevent" != internal && test -n "$with_libevent"],
|
||||
[AC_MSG_WARN([external libevent requested but cannot be built])
|
||||
AC_MSG_ERROR([Cannot continue.])])
|
||||
$2])
|
||||
|
||||
OPAL_SUMMARY_ADD([[Miscellaneous]],[[Libevent support]], [], [$opal_event_summary_msg])
|
||||
|
||||
OPAL_VAR_SCOPE_POP
|
||||
])dnl
|
||||
|
96
opal/mca/hwloc/external/configure.m4
поставляемый
96
opal/mca/hwloc/external/configure.m4
поставляемый
@ -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,15 +134,39 @@ 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
|
||||
])
|
||||
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])
|
||||
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])])])
|
||||
|
||||
# Done!
|
||||
AS_IF([test "$opal_hwloc_external_support" = "yes"],
|
||||
[AC_DEFINE_UNQUOTED([HWLOC_EXTERNAL_HWLOC_VERSION],
|
||||
[external],
|
||||
@ -172,24 +186,6 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
|
||||
|
||||
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)
|
||||
|
||||
@ -198,10 +194,26 @@ AC_DEFUN([MCA_opal_hwloc_external_CONFIG],[
|
||||
# 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
|
||||
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)
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# Copyright (c) 2009-2017 Cisco Systems, 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.
|
||||
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
@ -17,7 +17,7 @@
|
||||
#
|
||||
# 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
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user