1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
# -*- shell-script -*-
#
# 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
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
# reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
#
# Priority
#
AC_DEFUN([MCA_opal_hwloc_hwloc1117_PRIORITY], [90])
#
# Force this component to compile in static-only mode
#
AC_DEFUN([MCA_opal_hwloc_hwloc1117_COMPILE_MODE], [
AC_MSG_CHECKING([for MCA component $2:$3 compile mode])
$4="static"
AC_MSG_RESULT([$$4])
])
# Include hwloc m4 files
m4_include(opal/mca/hwloc/hwloc1117/hwloc/config/hwloc.m4)
m4_include(opal/mca/hwloc/hwloc1117/hwloc/config/hwloc_pkg.m4)
m4_include(opal/mca/hwloc/hwloc1117/hwloc/config/hwloc_check_attributes.m4)
m4_include(opal/mca/hwloc/hwloc1117/hwloc/config/hwloc_check_visibility.m4)
m4_include(opal/mca/hwloc/hwloc1117/hwloc/config/hwloc_check_vendor.m4)
m4_include(opal/mca/hwloc/hwloc1117/hwloc/config/hwloc_components.m4)
# MCA_hwloc_hwloc1117_POST_CONFIG()
# ---------------------------------
AC_DEFUN([MCA_opal_hwloc_hwloc1117_POST_CONFIG],[
OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc1117_basedir])
# If we won, then do all the rest of the setup
AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc1117_support" = "yes"],
[
# Set this variable so that the framework m4 knows what
# file to include in opal/mca/hwloc/hwloc-internal.h
opal_hwloc_hwloc1117_basedir=opal/mca/hwloc/hwloc1117
opal_hwloc_base_include="$opal_hwloc_hwloc1117_basedir/hwloc1117.h"
# Add some stuff to CPPFLAGS so that the rest of the source
# tree can be built
file=$opal_hwloc_hwloc1117_basedir/hwloc
CPPFLAGS="-I$OPAL_TOP_SRCDIR/$file/include $CPPFLAGS"
AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"],
[CPPFLAGS="-I$OPAL_TOP_BUILDDIR/$file/include $CPPFLAGS"])
unset file
])
OPAL_VAR_SCOPE_POP
# This must be run unconditionally
HWLOC_DO_AM_CONDITIONALS
])dnl
# MCA_hwloc_hwloc1117_CONFIG([action-if-found], [action-if-not-found])
# --------------------------------------------------------------------
AC_DEFUN([MCA_opal_hwloc_hwloc1117_CONFIG],[
# Hwloc needs to know if we have Verbs support
AC_REQUIRE([OPAL_CHECK_VERBS_DIR])
AC_CONFIG_FILES([opal/mca/hwloc/hwloc1117/Makefile])
OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc1117_save_CPPFLAGS opal_hwloc_hwloc1117_save_LDFLAGS opal_hwloc_hwloc1117_save_LIBS opal_hwloc_hwloc1117_save_cairo opal_hwloc_hwloc1117_save_xml opal_hwloc_hwloc1117_basedir opal_hwloc_hwloc1117_file opal_hwloc_hwloc1117_save_cflags CPPFLAGS_save LIBS_save opal_hwloc_external])
# default to this component not providing support
opal_hwloc_hwloc1117_basedir=opal/mca/hwloc/hwloc1117
opal_hwloc_hwloc1117_support=no
AS_IF([test "$with_hwloc" = "internal" || test -z "$with_hwloc" || test "$with_hwloc" = "yes"],
[opal_hwloc_external="no"],
[opal_hwloc_external="yes"])
opal_hwloc_hwloc1117_save_CPPFLAGS=$CPPFLAGS
opal_hwloc_hwloc1117_save_LDFLAGS=$LDFLAGS
opal_hwloc_hwloc1117_save_LIBS=$LIBS
# Run the hwloc configuration - if no external hwloc, then set the prefixi
# to minimize the chance that someone will use the internal symbols
AS_IF([test "$opal_hwloc_external" = "no"],
[HWLOC_SET_SYMBOL_PREFIX([opal_hwloc1117_])])
# save XML or graphical options
opal_hwloc_hwloc1117_save_cairo=$enable_cairo
opal_hwloc_hwloc1117_save_xml=$enable_xml
opal_hwloc_hwloc1117_save_static=$enable_static
opal_hwloc_hwloc1117_save_shared=$enable_shared
opal_hwloc_hwloc1117_save_plugins=$enable_plugins
# never enable hwloc's graphical option
enable_cairo=no
# never enable hwloc's plugin system
enable_plugins=no
enable_static=yes
enable_shared=no
# Override -- disable hwloc's libxml2 support, but enable the
# native hwloc XML support
enable_libxml2=no
enable_xml=yes
# GL and OpenCL OS devices aren't used in OMPI
enable_gl=no
enable_opencl=no
# Per https://github.com/open-mpi/ompi/pull/4257, ALWAYS
# disable cuda support
enable_cuda=no
# Open MPI currently does not use hwloc's NVML support
enable_nvml=no
# hwloc checks for compiler visibility, and its needs to do
# this without "picky" flags.
opal_hwloc_hwloc1117_save_cflags=$CFLAGS
CFLAGS=$OPAL_CFLAGS_BEFORE_PICKY
HWLOC_SETUP_CORE([opal/mca/hwloc/hwloc1117/hwloc],
[AC_MSG_CHECKING([whether hwloc configure succeeded])
AC_MSG_RESULT([yes])
HWLOC_VERSION="internal v`$srcdir/$opal_hwloc_hwloc1117_basedir/hwloc/config/hwloc_get_version.sh $srcdir/$opal_hwloc_hwloc1117_basedir/hwloc/VERSION`"
# Build flags for our Makefile.am
opal_hwloc_hwloc1117_LDFLAGS='$(HWLOC_EMBEDDED_LDFLAGS)'
opal_hwloc_hwloc1117_LIBS='$(OPAL_TOP_BUILDDIR)/'"$opal_hwloc_hwloc1117_basedir"'/hwloc/src/libhwloc_embedded.la $(HWLOC_EMBEDDED_LIBS)'
opal_hwloc_hwloc1117_support=yes
AC_DEFINE_UNQUOTED([HWLOC_HWLOC1117_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_hwloc1117_support=no])
CFLAGS=$opal_hwloc_hwloc1117_save_cflags
# Restore some env variables, if necessary
AS_IF([test -n "$opal_hwloc_hwloc1117_save_cairo"],
[enable_cairo=$opal_hwloc_hwloc1117_save_cairo])
AS_IF([test -n "$opal_hwloc_hwloc1117_save_xml"],
[enable_xml=$opal_hwloc_hwloc1117_save_xml])
AS_IF([test -n "$opal_hwloc_hwloc1117_save_static"],
[enable_static=$opal_hwloc_hwloc1117_save_static])
AS_IF([test -n "$opal_hwloc_hwloc1117_save_shared"],
[enable_shared=$opal_hwloc_hwloc1117_save_shared])
AS_IF([test -n "$opal_hwloc_hwloc1117_save_plugins"],
[enable_plugins=$opal_hwloc_hwloc1117_save_shared])
CPPFLAGS=$opal_hwloc_hwloc1117_save_CPPFLAGS
LDFLAGS=$opal_hwloc_hwloc1117_save_LDFLAGS
LIBS=$opal_hwloc_hwloc1117_save_LIBS
AC_SUBST([opal_hwloc_hwloc1117_CFLAGS])
AC_SUBST([opal_hwloc_hwloc1117_CPPFLAGS])
AC_SUBST([opal_hwloc_hwloc1117_LDFLAGS])
AC_SUBST([opal_hwloc_hwloc1117_LIBS])
# Finally, add some flags to the wrapper compiler so that our
# headers can be found.
hwloc_hwloc1117_WRAPPER_EXTRA_LDFLAGS="$HWLOC_EMBEDDED_LDFLAGS"
hwloc_hwloc1117_WRAPPER_EXTRA_LIBS="$HWLOC_EMBEDDED_LIBS"
hwloc_hwloc1117_WRAPPER_EXTRA_CPPFLAGS='-I${pkgincludedir}/'"$opal_hwloc_hwloc1117_basedir/hwloc/include"
# If we are not building the internal hwloc, then indicate that
# this component should not be built. NOTE: we still did all the
# above configury so that all the proper GNU Autotools
# infrastructure is setup properly (e.g., w.r.t. SUBDIRS=hwloc in
# this directory's Makefile.am, we still need the Autotools "make
# distclean" infrastructure to work properly).
AS_IF([test "$opal_hwloc_external" = "yes"],
[AC_MSG_WARN([using an external hwloc; disqualifying this component])
opal_hwloc_hwloc1117_support=no],
[AC_DEFINE([HAVE_DECL_HWLOC_OBJ_OSDEV_COPROC], [1])
AC_DEFINE([HAVE_HWLOC_TOPOLOGY_DUP], [1])])
# Done!
AS_IF([test "$opal_hwloc_hwloc1117_support" = "yes"],
[$1],
[$2])
OPAL_VAR_SCOPE_POP
])dnl
|