File hwloc-fix-hwloc-shmem.h-in-the-external-case.patch of Package openmpi3

commit 6a2d129fd28ca90c5c3f857eeb5ff933abc33470
Author: Brice Goglin <Brice.Goglin@inria.fr>
Date:   Fri Jan 26 15:44:15 2018 +0100

    hwloc: fix hwloc/shmem.h in the external case
    
    Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>

diff --git opal/mca/hwloc/base/hwloc_base_util.c opal/mca/hwloc/base/hwloc_base_util.c
index f8ca72c182d1..dd483a7dc1be 100644
--- opal/mca/hwloc/base/hwloc_base_util.c
+++ opal/mca/hwloc/base/hwloc_base_util.c
@@ -27,6 +27,7 @@
  * $HEADER$
  */
 
+#define OPAL_HWLOC_WANT_SHMEM 1
 
 #include "opal_config.h"
 
diff --git opal/mca/hwloc/external/configure.m4 opal/mca/hwloc/external/configure.m4
index 411d8ad1c1f2..b8214099ef84 100644
--- opal/mca/hwloc/external/configure.m4
+++ opal/mca/hwloc/external/configure.m4
@@ -63,12 +63,17 @@ AC_DEFUN([MCA_opal_hwloc_external_POST_CONFIG],[
            # the MCA_hwloc_external_openfabrics_helper define).
            AS_IF([test "$opal_hwloc_dir" != ""],
                  [opal_hwloc_include="$opal_hwloc_dir/include/hwloc.h"
+                  opal_hwloc_shmem_include="$opal_hwloc_dir/include/hwloc/shmem.h",
                   opal_hwloc_openfabrics_include="$opal_hwloc_dir/include/hwloc/openfabrics-verbs.h"],
                  [opal_hwloc_include="hwloc.h"
+                  opal_hwloc_shmem_include="hwloc/shmem.h"
                   opal_hwloc_openfabrics_include="hwloc/openfabrics-verbs.h"])
            AC_DEFINE_UNQUOTED(MCA_hwloc_external_header,
                   ["$opal_hwloc_include"],
                   [Location of external hwloc header])
+           AC_DEFINE_UNQUOTED(MCA_hwloc_external_shmem_header,
+                  ["$opal_hwloc_shmem_include"],
+                  [Location of external hwloc shmem header])
            AC_DEFINE_UNQUOTED(MCA_hwloc_external_openfabrics_header,
                   ["$opal_hwloc_openfabrics_include"],
                   [Location of external hwloc OpenFabrics header])
diff --git opal/mca/hwloc/external/external.h opal/mca/hwloc/external/external.h
index 6558a0bcbd14..0e1a91fcf470 100644
--- opal/mca/hwloc/external/external.h
+++ opal/mca/hwloc/external/external.h
@@ -43,6 +43,14 @@ BEGIN_C_DECLS
 #    endif
 #endif
 
+#if defined(OPAL_HWLOC_WANT_SHMEM) && OPAL_HWLOC_WANT_SHMEM
+#    if HWLOC_API_VERSION >= 0x20000
+#        include MCA_hwloc_external_shmem_header
+#    else
+#        error Tried to include hwloc shmem header, but hwloc < 2.0 found
+#    endif
+#endif
+
 #if HWLOC_API_VERSION < 0x00010b00
 #define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
 #define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
diff --git orte/mca/rtc/hwloc/rtc_hwloc.c orte/mca/rtc/hwloc/rtc_hwloc.c
index b832d4cf6bc9..8acdf572b577 100644
--- orte/mca/rtc/hwloc/rtc_hwloc.c
+++ orte/mca/rtc/hwloc/rtc_hwloc.c
@@ -9,6 +9,8 @@
  * $HEADER$
  */
 
+#define OPAL_HWLOC_WANT_SHMEM 1
+
 #include "orte_config.h"
 #include "orte/constants.h"
 #include "orte/types.h"
openSUSE Build Service is sponsored by