|  | 
|  | 1 | +# -*- shell-script -*- | 
|  | 2 | +# | 
|  | 3 | +# Copyright (c) 2009-2017 Cisco Systems, Inc.  All rights reserved | 
|  | 4 | +# Copyright (c) 2014-2015 Intel, Inc. All rights reserved. | 
|  | 5 | +# Copyright (c) 2015-2017 Research Organization for Information Science | 
|  | 6 | +#                         and Technology (RIST). All rights reserved. | 
|  | 7 | +# Copyright (c) 2016      Los Alamos National Security, LLC. All rights | 
|  | 8 | +#                         reserved. | 
|  | 9 | +# | 
|  | 10 | +# $COPYRIGHT$ | 
|  | 11 | +# | 
|  | 12 | +# Additional copyrights may follow | 
|  | 13 | +# | 
|  | 14 | +# $HEADER$ | 
|  | 15 | +# | 
|  | 16 | + | 
|  | 17 | +# | 
|  | 18 | +# Priority | 
|  | 19 | +# | 
|  | 20 | +AC_DEFUN([MCA_opal_hwloc_hwloc2x_PRIORITY], [90]) | 
|  | 21 | + | 
|  | 22 | +# | 
|  | 23 | +# Force this component to compile in static-only mode | 
|  | 24 | +# | 
|  | 25 | +AC_DEFUN([MCA_opal_hwloc_hwloc2x_COMPILE_MODE], [ | 
|  | 26 | +    AC_MSG_CHECKING([for MCA component $2:$3 compile mode]) | 
|  | 27 | +    $4="static" | 
|  | 28 | +    AC_MSG_RESULT([$$4]) | 
|  | 29 | +]) | 
|  | 30 | + | 
|  | 31 | +# MCA_hwloc_hwloc2x_POST_CONFIG() | 
|  | 32 | +# --------------------------------- | 
|  | 33 | +AC_DEFUN([MCA_opal_hwloc_hwloc2x_POST_CONFIG],[ | 
|  | 34 | +    OPAL_VAR_SCOPE_PUSH([opal_hwloc_hwloc2x_basedir]) | 
|  | 35 | + | 
|  | 36 | +    # If we won, then do all the rest of the setup | 
|  | 37 | +    AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc2x_support" = "yes"], | 
|  | 38 | +          [ | 
|  | 39 | +           # Set this variable so that the framework m4 knows what | 
|  | 40 | +           # file to include in opal/mca/hwloc/hwloc-internal.h | 
|  | 41 | +           opal_hwloc_hwloc2x_basedir=opal/mca/hwloc/hwloc2x | 
|  | 42 | +           opal_hwloc_base_include="$opal_hwloc_hwloc2x_basedir/hwloc2x.h" | 
|  | 43 | + | 
|  | 44 | +           # Add some stuff to CPPFLAGS so that the rest of the source | 
|  | 45 | +           # tree can be built | 
|  | 46 | +           file=$opal_hwloc_hwloc2x_basedir/hwloc | 
|  | 47 | +           CPPFLAGS="-I$OPAL_TOP_SRCDIR/$file/include $CPPFLAGS" | 
|  | 48 | +           AS_IF([test "$OPAL_TOP_BUILDDIR" != "$OPAL_TOP_SRCDIR"], | 
|  | 49 | +                 [CPPFLAGS="-I$OPAL_TOP_BUILDDIR/$file/include $CPPFLAGS"]) | 
|  | 50 | +           unset file | 
|  | 51 | +          ]) | 
|  | 52 | +    OPAL_VAR_SCOPE_POP | 
|  | 53 | +])dnl | 
|  | 54 | + | 
|  | 55 | + | 
|  | 56 | +# MCA_hwloc_hwloc2x_CONFIG([action-if-found], [action-if-not-found]) | 
|  | 57 | +# -------------------------------------------------------------------- | 
|  | 58 | +AC_DEFUN([MCA_opal_hwloc_hwloc2x_CONFIG],[ | 
|  | 59 | +    # Hwloc needs to know if we have Verbs support | 
|  | 60 | +    AC_REQUIRE([OPAL_CHECK_VERBS_DIR]) | 
|  | 61 | + | 
|  | 62 | +    AC_CONFIG_FILES([opal/mca/hwloc/hwloc2x/Makefile]) | 
|  | 63 | + | 
|  | 64 | +    OPAL_VAR_SCOPE_PUSH([HWLOC_VERSION opal_hwloc_hwloc2x_flags opal_hwloc_hwloc2x_save_CPPFLAGS opal_hwloc_hwloc2x_basedir opal_hwloc_hwloc2x_file opal_hwloc_future]) | 
|  | 65 | + | 
|  | 66 | +    # default to this component not providing support | 
|  | 67 | +    opal_hwloc_hwloc2x_basedir=opal/mca/hwloc/hwloc2x | 
|  | 68 | +    opal_hwloc_hwloc2x_support=no | 
|  | 69 | + | 
|  | 70 | +    AS_IF([test "$with_hwloc" = "future"], | 
|  | 71 | +          [opal_hwloc_future="yes"], | 
|  | 72 | +          [opal_hwloc_future="no"]) | 
|  | 73 | + | 
|  | 74 | +    opal_hwloc_hwloc2x_save_CPPFLAGS=$CPPFLAGS | 
|  | 75 | + | 
|  | 76 | +    # Run the hwloc configuration - if no external hwloc, then set the prefix | 
|  | 77 | +    # to minimize the chance that someone will use the internal symbols | 
|  | 78 | +     | 
|  | 79 | +    opal_hwloc_hwloc2x_flags="--enable-embedded-mode --with-hwloc-symbol-prefix=opal_hwloc2x_ --disable-cairo --disable-pugins --enable-static --enable-xml" | 
|  | 80 | +    AS_IF([test "$opal_check_cuda_happy" = "yes"], | 
|  | 81 | +          [CPPFLAGS="$CPPFLAGS $opal_datatype_cuda_CPPFLAGS", | 
|  | 82 | +           opal_hwloc_hwloc2x_flags="$opal_hwloc_hwloc2x_flags --enable-nvml CPPFLAGS=\"$CPPFLAGS\""] | 
|  | 83 | +          [opal_hwloc_hwloc2x_flags="$opal_hwloc_hwloc2x_flags --disable-nvml"]) | 
|  | 84 | + | 
|  | 85 | +    OPAL_CONFIG_SUBDIR([opal/mca/hwloc/hwloc2x/hwloc], | 
|  | 86 | +                       [$opal_hwloc_hwloc2x_flags], | 
|  | 87 | +                       [opal_hwloc_hwloc2x_support="yes"], | 
|  | 88 | +                       [opal_hwloc_hwloc2x_support="no"]) | 
|  | 89 | + | 
|  | 90 | +    CPPFLAGS=$opal_hwloc_hwloc2x_save_CPPFLAGS | 
|  | 91 | + | 
|  | 92 | +    # If we are not building the internal hwloc, then indicate that | 
|  | 93 | +    # this component should not be built.  NOTE: we still did all the | 
|  | 94 | +    # above configury so that all the proper GNU Autotools | 
|  | 95 | +    # infrastructure is setup properly (e.g., w.r.t. SUBDIRS=hwloc in | 
|  | 96 | +    # this directory's Makefile.am, we still need the Autotools "make | 
|  | 97 | +    # distclean" infrastructure to work properly). | 
|  | 98 | +    AS_IF([test "$opal_hwloc_future" != "yes"], | 
|  | 99 | +          [AC_MSG_WARN([not using future hwloc; disqualifying this component]) | 
|  | 100 | +           opal_hwloc_hwloc2x_support=no]) | 
|  | 101 | + | 
|  | 102 | +    # Done! | 
|  | 103 | +    AS_IF([test "$opal_hwloc_hwloc2x_support" = "yes"], | 
|  | 104 | +          [AC_DEFINE_UNQUOTED([HWLOC_SYM_PREFIX],[opal_hwloc2x_]) | 
|  | 105 | +           AC_DEFINE_UNQUOTED([HWLOC_SYM_PREFIX_CAPS], [OPAL_HWLOC2X_]) | 
|  | 106 | +           AC_DEFINE_UNQUOTED([HWLOC_SYM_TRANSFORM], [1]) | 
|  | 107 | +           AC_DEFINE([HAVE_DECL_HWLOC_OBJ_OSDEV_COPROC], [1]) | 
|  | 108 | +           $1], | 
|  | 109 | +          [$2]) | 
|  | 110 | + | 
|  | 111 | +    OPAL_VAR_SCOPE_POP | 
|  | 112 | +])dnl | 
0 commit comments