From 788c92b1ce11ed93c9a79542456be7b2330fcf5d Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Tue, 29 Jan 2019 07:36:01 -0800 Subject: [PATCH] hwloc/external.h: fix a clash with external HWLOC_VERSION[*] Some macros defined by the embedded hwloc ends up in opal_config.h because hwloc configury m4 files are slurped into Open MPI. These macros are not required here, and they might conflict with an external hwloc install, so simply #undef them in hwloc/external/external.h after including but before including the external . Signed-off-by: Gilles Gouaillardet Signed-off-by: Jeff Squyres (cherry picked from commit f22b7d4f46b03554add3ff2254d1c893359aff84) --- opal/mca/hwloc/external/external.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/opal/mca/hwloc/external/external.h b/opal/mca/hwloc/external/external.h index 1428459755..8a1a32068b 100644 --- a/opal/mca/hwloc/external/external.h +++ b/opal/mca/hwloc/external/external.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved - * Copyright (c) 2016 Research Organization for Information Science + * Copyright (c) 2011-2019 Cisco Systems, Inc. All rights reserved + * Copyright (c) 2016-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * * Copyright (c) 2016-2017 Intel, Inc. All rights reserved. @@ -21,6 +21,23 @@ BEGIN_C_DECLS #include + +/* Top-level configure will always configure the embedded hwloc + * component, even if we already know that we'll be using an external + * hwloc (because of complicated reasons). A side-effect of this is + * that the embedded hwloc will AC_DEFINE HWLOC_VERSION (and friends) + * in opal_config.h. If the external hwloc defines a different value + * of HWLOC_VERSION (etc.), we'll get zillions of warnings about the + * two HWLOC_VERSION values not matching. Hence, we undefined all of + * them here (so that the external can define them to + * whatever it wants). */ + +#undef HWLOC_VERSION +#undef HWLOC_VERSION_MAJOR +#undef HWLOC_VERSION_MINOR +#undef HWLOC_VERSION_RELEASE +#undef HWLOC_VERSION_GREEK + #include MCA_hwloc_external_header /* If the including file requested it, also include the hwloc verbs