Skip to content

Commit 9649c44

Browse files
committed
hwloc: correctly handle --with-hwloc=external
- simply #include "hwloc.h" to use the external hwloc header - do use the external hwloc header instead of opal/mca/hwloc/hwloc.h Thanks Orion Poplawski for the report Fixes #2616 Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 5ecd271 commit 9649c44

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

opal/mca/hwloc/Makefile.am

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
#
22
# Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
3+
# Copyright (c) 2016 Research Organization for Information Science
4+
# and Technology (RIST). All rights reserved.
35
# $COPYRIGHT$
46
#
57
# Additional copyrights may follow
68
#
79
# $HEADER$
810
#
911

12+
# we do not want -I$(srcdir) in DEFAULT_INCLUDES
13+
# otherwise there can be a conflict between system hwloc.h and opal/mca/hwloc/hwloc.h
14+
# so just hack DEFAULT_INCLUDES with only what we need
15+
DEFAULT_INCLUDES = -I$(top_builddir)/opal/include
16+
1017
# main library setup
1118
noinst_LTLIBRARIES = libmca_hwloc.la
1219
libmca_hwloc_la_SOURCES =

opal/mca/hwloc/external/configure.m4

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- shell-script -*-
22
#
33
# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
4-
# Copyright (c) 2014 Research Organization for Information Science
4+
# Copyright (c) 2014-2016 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
#
77
# $COPYRIGHT$
@@ -61,12 +61,17 @@ AC_DEFUN([MCA_opal_hwloc_external_POST_CONFIG],[
6161
# OPAL_HWLOC_WANT_VERBS_HELPER is set, that file will
6262
# include the external hwloc/openfabrics-verbs.h file (via
6363
# the MCA_hwloc_external_openfabrics_helper define).
64+
AS_IF([test "$opal_hwloc_dir" != ""],
65+
[opal_hwloc_include="$opal_hwloc_dir/include/hwloc.h"
66+
opal_hwloc_openfabrics_include="$opal_hwloc_dir/include/hwloc/hwloc/openfabrics-verbs.h"],
67+
[opal_hwloc_include="hwloc.h"
68+
opal_hwloc_openfabrics_include="hwloc/openfabrics-verbs.h"])
6469
AC_DEFINE_UNQUOTED(MCA_hwloc_external_header,
65-
["$opal_hwloc_dir/include/hwloc.h"],
70+
["$opal_hwloc_include"],
6671
[Location of external hwloc header])
6772
AC_DEFINE_UNQUOTED(MCA_hwloc_external_openfabrics_header,
68-
["$opal_hwloc_dir/include/hwloc/openfabrics-verbs.h"],
69-
[Location of external hwloc header])
73+
["$opal_hwloc_openfabrics_include"],
74+
[Location of external hwloc openfabrics header])
7075
])
7176
OPAL_VAR_SCOPE_POP
7277
])dnl

0 commit comments

Comments
 (0)