From bd08a6ead997f65bd4cad7df624c9471e37decb7 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 26 Jan 2018 15:44:15 +0100 Subject: [PATCH] hwloc: fix hwloc/shmem.h in the external case Signed-off-by: Brice Goglin --- opal/mca/hwloc/base/hwloc_base_util.c | 6 +----- opal/mca/hwloc/external/configure.m4 | 5 +++++ opal/mca/hwloc/external/external.h | 8 ++++++++ orte/mca/rtc/hwloc/rtc_hwloc.c | 7 ++----- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/opal/mca/hwloc/base/hwloc_base_util.c b/opal/mca/hwloc/base/hwloc_base_util.c index 35b3223594..568299d556 100644 --- a/opal/mca/hwloc/base/hwloc_base_util.c +++ b/opal/mca/hwloc/base/hwloc_base_util.c @@ -23,6 +23,7 @@ * $HEADER$ */ +#define OPAL_HWLOC_WANT_SHMEM 1 #include "opal_config.h" @@ -54,11 +55,6 @@ #include "opal/mca/hwloc/hwloc-internal.h" #include "opal/mca/hwloc/base/base.h" -#if HWLOC_API_VERSION >= 0x20000 -// JMS Is this right? -#include "hwloc/shmem.h" -#endif - static bool topo_in_shmem = false; /* diff --git a/opal/mca/hwloc/external/configure.m4 b/opal/mca/hwloc/external/configure.m4 index 411d8ad1c1..b8214099ef 100644 --- a/opal/mca/hwloc/external/configure.m4 +++ b/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 a/opal/mca/hwloc/external/external.h b/opal/mca/hwloc/external/external.h index 6558a0bcbd..0e1a91fcf4 100644 --- a/opal/mca/hwloc/external/external.h +++ b/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 a/orte/mca/rtc/hwloc/rtc_hwloc.c b/orte/mca/rtc/hwloc/rtc_hwloc.c index 312b1f9e77..0751c4f38f 100644 --- a/orte/mca/rtc/hwloc/rtc_hwloc.c +++ b/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" @@ -48,11 +50,6 @@ #include "orte/mca/rtc/base/base.h" #include "rtc_hwloc.h" -#if HWLOC_API_VERSION >= 0x20000 -// JMS Is this right? -#include "hwloc/shmem.h" -#endif - static int init(void); static void finalize(void); static void assign(orte_job_t *jdata);