Skip to content

Commit d5266ab

Browse files
authored
Merge pull request #2955 from jsquyres/pr/hwloc-external-fixes
Fix --with-hwloc=external
2 parents 0006f0d + fec519a commit d5266ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+118
-86
lines changed

autogen.pl

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env perl
22
#
3-
# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
3+
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
44
# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
55
# Copyright (c) 2013 Mellanox Technologies, Inc.
66
# All rights reserved.
@@ -432,11 +432,28 @@ sub mca_process_project {
432432
next
433433
if (! -d "$dir/$d" || $d eq "base" || substr($d, 0, 1) eq ".");
434434

435-
# If this directory has a $dir.h file and a base/
435+
my $framework_header = "$dir/$d/$d.h";
436+
437+
# If there's a $dir/$d/autogen.options file, read it
438+
my $ao_file = "$dir/$d/autogen.options";
439+
if (-r $ao_file) {
440+
verbose "\n>>> Found $dir/$d/autogen.options file\n";
441+
open(IN, $ao_file) ||
442+
die "$ao_file present, but cannot open it";
443+
while (<IN>) {
444+
if (m/\s*framework_header\s*=\s*(.+?)\s*$/) {
445+
verbose " Framework header entry: $1\n";
446+
$framework_header = "$dir/$d/$1";
447+
}
448+
}
449+
close(IN);
450+
}
451+
452+
# If this directory has a framework header and a base/
436453
# subdirectory, or its name is "common", then it's a
437454
# framework.
438455
if ("common" eq $d || !$project->{need_base} ||
439-
(-f "$dir/$d/$d.h" && -d "$dir/$d/base")) {
456+
(-f $framework_header && -d "$dir/$d/base")) {
440457
verbose "\n=== Found $pname / $d framework\n";
441458
mca_process_framework($topdir, $project, $d);
442459
}

ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* and Technology (RIST). All rights reserved.
1111
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
1212
* reserved.
13+
* Copyright (c) 2017 Cisco Systems, Inc. All rights reserved
1314
* $COPYRIGHT$
1415
*
1516
* Additional copyrights may follow
@@ -20,7 +21,7 @@
2021
#include "ompi_config.h"
2122

2223
#include "opal/constants.h"
23-
#include "opal/mca/hwloc/hwloc.h"
24+
#include "opal/mca/hwloc/hwloc-internal.h"
2425

2526
#include "ompi/mca/topo/treematch/topo_treematch.h"
2627
#include "ompi/mca/topo/treematch/treematch/tm_mapping.h"

ompi/mca/topo/treematch/treematch/tm_hwloc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#include <hwloc.h>
2-
#include <hwloc/helper.h>
1+
#include "opal/mca/hwloc/hwloc-internal.h"
32
#include "tm_tree.h"
43
#include "tm_mapping.h"
54
#include <ctype.h>

ompi/mca/topo/treematch/treematch/tm_hwloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <hwloc.h>
1+
#include "opal/mca/hwloc/hwloc-internal.h"
22
#include "tm_tree.h"
33

44
void hwloc_topology_tag(hwloc_topology_t topology);

ompi/mca/topo/treematch/treematch/tm_thread_pool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <pthread.h>
22
#include "tm_thread_pool.h"
33
#include "tm_verbose.h"
4-
#include <hwloc.h>
4+
#include "opal/mca/hwloc/hwloc-internal.h"
55
#include "tm_verbose.h"
66
#include "tm_tree.h"
77
#include <errno.h>

ompi/mca/topo/treematch/treematch/tm_thread_pool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define THREAD_POOL_H
33

44
#include <pthread.h>
5-
#include <hwloc.h>
5+
#include "opal/mca/hwloc/hwloc-internal.h"
66

77

88
typedef struct _work_t{

opal/mca/btl/openib/btl_openib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2007-2013 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2007-2017 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2006-2015 Mellanox Technologies. All rights reserved.
1515
* Copyright (c) 2006-2016 Los Alamos National Security, LLC. All rights
1616
* reserved.
@@ -84,7 +84,7 @@
8484
#ifdef HAVE_UNISTD_H
8585
#include <unistd.h>
8686
#endif
87-
#include "opal/mca/hwloc/hwloc.h"
87+
#include "opal/mca/hwloc/hwloc-internal.h"
8888

8989
#ifndef MIN
9090
#define MIN(a,b) ((a)<(b)?(a):(b))

opal/mca/btl/openib/btl_openib_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2006-2015 Mellanox Technologies. All rights reserved.
1515
* Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights
1616
* reserved.
@@ -59,7 +59,7 @@
5959
know its exact path. We have to rely on the framework header files
6060
to find the right hwloc verbs helper file for us. */
6161
#define OPAL_HWLOC_WANT_VERBS_HELPER 1
62-
#include "opal/mca/hwloc/hwloc.h"
62+
#include "opal/mca/hwloc/hwloc-internal.h"
6363
#include "opal/mca/hwloc/base/base.h"
6464
#include "opal/mca/installdirs/installdirs.h"
6565
#include "opal_stdint.h"

opal/mca/hwloc/Makefile.am

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011-2016 Cisco Systems, Inc. All rights reserved.
2+
# Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
33
# Copyright (c) 2016 Research Organization for Information Science
44
# and Technology (RIST). All rights reserved.
55
# $COPYRIGHT$
@@ -9,17 +9,12 @@
99
# $HEADER$
1010
#
1111

12-
# We do not want -I$(srcdir) in AM_CPPFLAGS, or there can be a
13-
# conflict between system hwloc.h and opal/mca/hwloc/hwloc.h. So just
14-
# set only what we need to AM_CPPFLAGS.
15-
AM_CPPFLAGS = -I$(top_builddir)/opal/include
16-
1712
# main library setup
1813
noinst_LTLIBRARIES = libmca_hwloc.la
1914
libmca_hwloc_la_SOURCES =
2015

2116
# local files
22-
headers = hwloc.h
17+
headers = hwloc-internal.h
2318
libmca_hwloc_la_SOURCES += $(headers)
2419

2520
# Conditionally install the header files

opal/mca/hwloc/autogen.options

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2017 Cisco Systems, Inc. All rights reserved
2+
# $COPYRIGHT$
3+
#
4+
5+
# Per https://github.com/open-mpi/ompi/issues/2616, we cannot have an
6+
# "hwloc.h" in the framework directory (due to conflicts of finding
7+
# the system hwloc.h file when using "--with-hwloc=external"). Hence,
8+
# we need to deviate from the framework norm of having
9+
# framework/framework.h (i.e., hwloc/hwloc.h). Instead, we'll have
10+
# hwloc/hwloc-internal.h to make sure that this header file can never
11+
# be mistaken for a system-level hwloc.h.
12+
13+
framework_header = hwloc-internal.h

opal/mca/hwloc/base/base.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
33
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
44
* $COPYRIGHT$
55
*
@@ -15,7 +15,7 @@
1515

1616
#include "opal/dss/dss_types.h"
1717

18-
#include "opal/mca/hwloc/hwloc.h"
18+
#include "opal/mca/hwloc/hwloc-internal.h"
1919

2020
/*
2121
* Global functions for MCA overall hwloc open and close
@@ -88,7 +88,7 @@ OPAL_DECLSPEC int opal_hwloc_base_set_binding_policy(opal_binding_policy_t *poli
8888

8989
/**
9090
* Loads opal_hwloc_my_cpuset (global variable in
91-
* opal/mca/hwloc/hwloc.h) for this process. opal_hwloc_my_cpuset
91+
* opal/mca/hwloc/hwloc-internal.h) for this process. opal_hwloc_my_cpuset
9292
* will be loaded with this process' binding, or, if the process is
9393
* not bound, use the hwloc root object's (available and online)
9494
* cpuset.

opal/mca/hwloc/base/hwloc_base_frame.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
33
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
44
* Copyright (c) 2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
@@ -22,7 +22,7 @@
2222
#include "opal/mca/base/base.h"
2323
#include "opal/threads/tsd.h"
2424

25-
#include "opal/mca/hwloc/hwloc.h"
25+
#include "opal/mca/hwloc/hwloc-internal.h"
2626
#include "opal/mca/hwloc/base/base.h"
2727

2828

opal/mca/hwloc/base/hwloc_base_maffinity.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
33
* Copyright (c) 2016 Intel, Inc. All rights reserved.
44
* $COPYRIGHT$
55
*
@@ -13,7 +13,7 @@
1313

1414
#include "opal/constants.h"
1515

16-
#include "opal/mca/hwloc/hwloc.h"
16+
#include "opal/mca/hwloc/hwloc-internal.h"
1717
#include "opal/mca/hwloc/base/base.h"
1818

1919

opal/mca/hwloc/base/hwloc_base_proc_mempolicy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
33
* $COPYRIGHT$
44
*
55
* Additional copyrights may follow
@@ -12,7 +12,7 @@
1212

1313
#include "opal/constants.h"
1414

15-
#include "opal/mca/hwloc/hwloc.h"
15+
#include "opal/mca/hwloc/hwloc-internal.h"
1616
#include "opal/mca/hwloc/base/base.h"
1717

1818

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2012-2015 Los Alamos National Security, LLC.
1515
* All rights reserved.
1616
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
@@ -42,7 +42,7 @@
4242
#include "opal/threads/tsd.h"
4343
#include "opal/mca/pmix/pmix.h"
4444

45-
#include "opal/mca/hwloc/hwloc.h"
45+
#include "opal/mca/hwloc/hwloc-internal.h"
4646
#include "opal/mca/hwloc/base/base.h"
4747

4848
/*

opal/mca/hwloc/configure.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl -*- shell-script -*-
22
dnl
3-
dnl Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
3+
dnl Copyright (c) 2010-2017 Cisco Systems, Inc. All rights reserved
44
dnl $COPYRIGHT$
55
dnl
66
dnl Additional copyrights may follow
@@ -13,7 +13,7 @@ dnl
1313
# their priorities in their configure.m4 files. They must also set
1414
# the shell variable $opal_hwloc_base_include to a header file
1515
# name (relative to the top OMPI source directory) that will be
16-
# included in opal/mca/hwloc/hwloc.h.
16+
# included in opal/mca/hwloc/hwloc-internal.h.
1717

1818
dnl We only want one winning component (vs. STOP_AT_FIRST_PRIORITY,
1919
dnl which will allow all components of the same priority who succeed to

opal/mca/hwloc/external/configure.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- shell-script -*-
22
#
3-
# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
3+
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
44
# Copyright (c) 2014-2016 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
66
#
@@ -38,7 +38,7 @@ AC_DEFUN([MCA_opal_hwloc_external_POST_CONFIG],[
3838
[Version of hwloc])
3939

4040
# Set this variable so that the framework m4 knows what
41-
# file to include in opal/mca/hwloc/hwloc.h
41+
# file to include in opal/mca/hwloc/hwloc-internal.h
4242
opal_hwloc_external_basedir=opal/mca/hwloc/external
4343
opal_hwloc_base_include="$opal_hwloc_external_basedir/external.h"
4444

opal/mca/hwloc/external/external.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
2+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
33
* Copyright (c) 2016 Research Organization for Information Science
44
* and Technology (RIST). All rights reserved.
55
*
@@ -11,7 +11,7 @@
1111
* $HEADER$
1212
*
1313
* When this component is used, this file is included in the rest of
14-
* the OPAL/ORTE/OMPI code base via opal/mca/hwloc/hwloc.h. As such,
14+
* the OPAL/ORTE/OMPI code base via opal/mca/hwloc/hwloc-internal.h. As such,
1515
* this header represents the public interface to this static component.
1616
*/
1717

opal/mca/hwloc/external/hwloc_external_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
44
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
55
* reserved.
66
*
@@ -14,7 +14,7 @@
1414
#include "opal_config.h"
1515
#include "opal/constants.h"
1616

17-
#include "opal/mca/hwloc/hwloc.h"
17+
#include "opal/mca/hwloc/hwloc-internal.h"
1818

1919
/*
2020
* Public string showing the sysinfo ompi_linux component version number
File renamed without changes.

opal/mca/hwloc/hwloc1113/configure.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- shell-script -*-
22
#
3-
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
3+
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
44
# Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
55
# Copyright (c) 2015-2016 Research Organization for Information Science
66
# and Technology (RIST). All rights reserved.
@@ -45,7 +45,7 @@ AC_DEFUN([MCA_opal_hwloc_hwloc1113_POST_CONFIG],[
4545
AS_IF([test "$1" = "1" && test "$opal_hwloc_hwloc1113_support" = "yes"],
4646
[
4747
# Set this variable so that the framework m4 knows what
48-
# file to include in opal/mca/hwloc/hwloc.h
48+
# file to include in opal/mca/hwloc/hwloc-internal.h
4949
opal_hwloc_hwloc1113_basedir=opal/mca/hwloc/hwloc1113
5050
opal_hwloc_base_include="$opal_hwloc_hwloc1113_basedir/hwloc1113.h"
5151

opal/mca/hwloc/hwloc1113/hwloc1113.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
44
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
55
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
66
* reserved.
@@ -12,7 +12,7 @@
1212
* $HEADER$
1313
*
1414
* When this component is used, this file is included in the rest of
15-
* the OPAL/ORTE/OMPI code base via opal/mca/hwloc/hwloc.h. As such,
15+
* the OPAL/ORTE/OMPI code base via opal/mca/hwloc/hwloc-internal.h. As such,
1616
* this header represents the public interface to this static component.
1717
*/
1818

opal/mca/hwloc/hwloc1113/hwloc1113_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2011-2013 Cisco Systems, Inc. All rights reserved.
3+
* Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
44
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
55
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
66
* reserved.
@@ -21,7 +21,7 @@
2121
#include "opal_config.h"
2222
#include "opal/constants.h"
2323

24-
#include "opal/mca/hwloc/hwloc.h"
24+
#include "opal/mca/hwloc/hwloc-internal.h"
2525
#include "hwloc1113.h"
2626

2727
/*

opal/util/proc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
77
* Copyright (c) 2014-2016 Research Organization for Information Science
88
* and Technology (RIST). All rights reserved.
9+
* Copyright (c) 2017 Cisco Systems, Inc. All rights reserved
910
* $COPYRIGHT$
1011
*
1112
* Additional copyrights may follow
@@ -18,7 +19,7 @@
1819

1920
#include "opal_config.h"
2021
#include "opal/class/opal_list.h"
21-
#include "opal/mca/hwloc/hwloc.h"
22+
#include "opal/mca/hwloc/hwloc-internal.h"
2223
#include "opal/types.h"
2324
#include "opal/dss/dss.h"
2425

0 commit comments

Comments
 (0)