Skip to content

Commit 725a11c

Browse files
committed
configury: fix hcoll detection
* do not add -I/.../include/hcoll -I /.../include/hcoll/api to CPPFLAGS * allow configure --with-hcoll * search hcoll libs in both DIR/lib and DIR/lib64 * fix the description of the --with-hcoll option Thanks to David Shrader and Ake Sandgren for bringing this issue to our atte (cherry picked from commit open-mpi/ompi@df98a73)
1 parent 37fc38f commit 725a11c

File tree

7 files changed

+47
-50
lines changed

7 files changed

+47
-50
lines changed

config/ompi_check_libhcoll.m4

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,52 +17,40 @@ dnl
1717
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
1818
# support, otherwise executes action-if-not-found
1919
AC_DEFUN([OMPI_CHECK_HCOLL],[
20-
OPAL_VAR_SCOPE_PUSH([ompi_check_hcoll_dir ompi_hcoll_libdir ompi_check_hcoll_incdir ompi_check_hcoll_libs ompi_check_hcoll_happy CPPFLAGS_save LDFLAGS_save LIBS_save])
20+
OPAL_VAR_SCOPE_PUSH([ompi_check_hcoll_dir ompi_check_hcoll_libs ompi_check_hcoll_happy CPPFLAGS_save LDFLAGS_save LIBS_save])
2121

2222
AC_ARG_WITH([hcoll],
2323
[AC_HELP_STRING([--with-hcoll(=DIR)],
24-
[Build hcoll (Mellanox Hierarchical Collectives) support, searching for libraries in DIR])])
25-
OPAL_CHECK_WITHDIR([hcoll], [$with_hcoll], [lib/libhcoll.so])
24+
[Build hcoll (Mellanox Hierarchical Collectives) support, optionally adding
25+
DIR/include and DIR/lib or DIR/lib64 to the search path for headers and libraries])])
2626

2727
AS_IF([test "$with_hcoll" != "no"],
28-
[AS_IF([test ! -z "$with_hcoll" && test "$with_hcoll" != "yes"],
29-
[ompi_check_hcoll_dir=$with_hcoll
30-
ompi_check_hcoll_libdir="$ompi_check_hcoll_dir/lib"
31-
ompi_check_hcoll_incdir="$ompi_check_hcoll_dir/include"
32-
ompi_check_hcoll_libs=hcoll
28+
[ompi_check_hcoll_libs=hcoll
29+
AS_IF([test ! -z "$with_hcoll" && test "$with_hcoll" != "yes"],
30+
[ompi_check_hcoll_dir=$with_hcoll])
3331

34-
coll_hcoll_extra_CPPFLAGS="-I$ompi_check_hcoll_incdir/hcoll -I$ompi_check_hcoll_incdir/hcoll/api"
32+
CPPFLAGS_save=$CPPFLAGS
33+
LDFLAGS_save=$LDFLAGS
34+
LIBS_save=$LIBS
3535

36-
AC_SUBST([coll_hcoll_extra_CPPFLAGS])
37-
AC_SUBST([coll_hcoll_HOME], "$ompi_check_hcoll_dir")
38-
39-
40-
CPPFLAGS_save=$CPPFLAGS
41-
LDFLAGS_save=$LDFLAGS
42-
LIBS_save=$LIBS
43-
CPPFLAGS="$CPPFLAGS $coll_hcoll_extra_CPPFLAGS"
44-
45-
OPAL_LOG_MSG([$1_CPPFLAGS : $$1_CPPFLAGS], 1)
46-
OPAL_LOG_MSG([$1_LDFLAGS : $$1_LDFLAGS], 1)
47-
OPAL_LOG_MSG([$1_LIBS : $$1_LIBS], 1)
48-
49-
OPAL_CHECK_PACKAGE([$1],
50-
[hcoll_api.h],
51-
[$ompi_check_hcoll_libs],
52-
[hcoll_get_version],
53-
[],
54-
[$ompi_check_hcoll_dir],
55-
[$ompi_check_hcoll_libdir],
56-
[ompi_check_hcoll_happy="yes"],
57-
[ompi_check_hcoll_happy="no"])
58-
59-
CPPFLAGS=$CPPFLAGS_save
60-
LDFLAGS=$LDFLAGS_save
61-
LIBS=$LIBS_save],
62-
[ompi_check_hcoll_happy="no"])
63-
])
36+
OPAL_LOG_MSG([$1_CPPFLAGS : $$1_CPPFLAGS], 1)
37+
OPAL_LOG_MSG([$1_LDFLAGS : $$1_LDFLAGS], 1)
38+
OPAL_LOG_MSG([$1_LIBS : $$1_LIBS], 1)
6439

40+
OPAL_CHECK_PACKAGE([$1],
41+
[hcoll/api/hcoll_api.h],
42+
[$ompi_check_hcoll_libs],
43+
[hcoll_get_version],
44+
[],
45+
[$ompi_check_hcoll_dir],
46+
[],
47+
[ompi_check_hcoll_happy="yes"],
48+
[ompi_check_hcoll_happy="no"])
6549

50+
CPPFLAGS=$CPPFLAGS_save
51+
LDFLAGS=$LDFLAGS_save
52+
LIBS=$LIBS_save],
53+
[ompi_check_hcoll_happy=no])
6654

6755
AS_IF([test "$ompi_check_hcoll_happy" = "yes" && test "$enable_progress_threads" = "yes"],
6856
[AC_MSG_WARN([hcoll driver does not currently support progress threads. Disabling HCOLL.])

ompi/mca/coll/hcoll/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
#
44
# Copyright (c) 2011 Mellanox Technologies. All rights reserved.
5+
# Copyright (c) 2015 Research Organization for Information Science
6+
# and Technology (RIST). All rights reserved.
57
# $COPYRIGHT$
68
#
79
# Additional copyrights may follow
@@ -10,7 +12,7 @@
1012
#
1113
#
1214

13-
AM_CPPFLAGS = $(coll_hcoll_CPPFLAGS) -DCOLL_HCOLL_HOME=\"$(coll_hcoll_HOME)\" $(coll_hcoll_extra_CPPFLAGS)
15+
AM_CPPFLAGS = $(coll_hcoll_CPPFLAGS)
1416

1517
coll_hcoll_sources = \
1618
coll_hcoll.h \

ompi/mca/coll/hcoll/coll_hcoll.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
2-
Copyright (c) 2011 Mellanox Technologies. All rights reserved.
2+
Copyright (c) 2011 Mellanox Technologies. All rights reserved.
3+
Copyright (c) 2015 Research Organization for Information Science
4+
and Technology (RIST). All rights reserved.
35
$COPYRIGHT$
46
57
Additional copyrights may follow
@@ -25,8 +27,8 @@
2527

2628
#include "orte/runtime/orte_globals.h"
2729

28-
#include "hcoll_api.h"
29-
#include "hcoll_constants.h"
30+
#include "hcoll/api/hcoll_api.h"
31+
#include "hcoll/api/hcoll_constants.h"
3032

3133

3234
#include "coll_hcoll_debug.h"

ompi/mca/coll/hcoll/coll_hcoll_dtypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include "ompi/datatype/ompi_datatype.h"
99
#include "ompi/mca/op/op.h"
10-
#include "hcoll_dte.h"
10+
#include "hcoll/api/hcoll_dte.h"
1111

1212
/*to keep this at hand: Ids of the basic opal_datatypes:
1313
#define OPAL_DATATYPE_INT1 4

ompi/mca/coll/hcoll/coll_hcoll_ops.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
2-
Copyright (c) 2011 Mellanox Technologies. All rights reserved.
2+
Copyright (c) 2011 Mellanox Technologies. All rights reserved.
3+
Copyright (c) 2015 Research Organization for Information Science
4+
and Technology (RIST). All rights reserved.
35
$COPYRIGHT$
46
57
Additional copyrights may follow
@@ -10,9 +12,9 @@
1012
#include "ompi_config.h"
1113
#include "ompi/constants.h"
1214
#include "coll_hcoll.h"
13-
#include "hcoll_constants.h"
15+
#include "hcoll/api/hcoll_constants.h"
1416
#include "coll_hcoll_dtypes.h"
15-
#include "hcoll_dte.h"
17+
#include "hcoll/api/hcoll_dte.h"
1618
int mca_coll_hcoll_barrier(struct ompi_communicator_t *comm,
1719
mca_coll_base_module_t *module){
1820
int rc;

ompi/mca/coll/hcoll/coll_hcoll_rte.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* reserved.
88
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
99
* reserved.
10+
* Copyright (c) 2015 Research Organization for Information Science
11+
* and Technology (RIST). All rights reserved.
1012
* $COPYRIGHT$
1113
*
1214
* Additional copyrights may follow
@@ -39,9 +41,9 @@
3941
#include "ompi/mca/pml/pml.h"
4042

4143

42-
#include "hcoll_dte.h"
43-
#include "hcoll_api.h"
44-
#include "hcoll_constants.h"
44+
#include "hcoll/api/hcoll_dte.h"
45+
#include "hcoll/api/hcoll_api.h"
46+
#include "hcoll/api/hcoll_constants.h"
4547
/*
4648
* Local functions
4749
*/

ompi/mca/coll/hcoll/configure.m4

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# -*- shell-script -*-
22
#
33
#
4-
# Copyright (c) 2011 Mellanox Technologies. All rights reserved.
4+
# Copyright (c) 2011 Mellanox Technologies. All rights reserved.
5+
# Copyright (c) 2015 Research Organization for Information Science
6+
# and Technology (RIST). All rights reserved.
57
# $COPYRIGHT$
68
#
79
# Additional copyrights may follow
@@ -23,7 +25,6 @@ AC_DEFUN([MCA_ompi_coll_hcoll_CONFIG],[
2325
AS_IF([test "$coll_hcoll_happy" = "yes"],
2426
[coll_hcoll_WRAPPER_EXTRA_LDFLAGS="$coll_hcoll_LDFLAGS"
2527
coll_hcoll_CPPFLAGS="$coll_hcoll_CPPFLAGS"
26-
coll_hcoll_WRAPPER_EXTRA_CPPFLAGS="$coll_hcoll_CPPFLAGS"
2728
coll_hcoll_WRAPPER_EXTRA_LIBS="$coll_hcoll_LIBS"
2829
$1],
2930
[$2])

0 commit comments

Comments
 (0)