Skip to content

Commit 6061a45

Browse files
authored
Merge pull request #6369 from jsquyres/pr/v3.1.x/fix-ofi-configury
v3.1.x: fix OFI configury
2 parents c5b9ada + 5eaa8dc commit 6061a45

File tree

12 files changed

+135
-306
lines changed

12 files changed

+135
-306
lines changed

VERSION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
2-
# Copyright (c) 2008-2011 Cisco Systems, Inc. All rights reserved.
2+
# Copyright (c) 2008-2019 Cisco Systems, Inc. All rights reserved.
33
# Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
44
# Copyright (c) 2013 Mellanox Technologies, Inc.
55
# All rights reserved.
@@ -110,7 +110,6 @@ libmca_orte_common_alps_so_version=50:0:10
110110

111111
# OPAL layer
112112
libmca_opal_common_cuda_so_version=50:0:10
113-
libmca_opal_common_ofi_so_version=50:0:10
114113
libmca_opal_common_sm_so_version=50:0:10
115114
libmca_opal_common_ugni_so_version=50:0:10
116115
libmca_opal_common_verbs_so_version=50:0:10

config/opal_check_ofi.m4

Lines changed: 106 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl -*- shell-script -*-
22
dnl
3-
dnl Copyright (c) 2015-2016 Cisco Systems, Inc. All rights reserved.
3+
dnl Copyright (c) 2015-2019 Cisco Systems, Inc. All rights reserved.
44
dnl Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
55
dnl reserved.
66
dnl $COPYRIGHT$
@@ -10,102 +10,116 @@ dnl
1010
dnl $HEADER$
1111
dnl
1212

13-
14-
# OPAL_CHECK_OFI(prefix, [action-if-found], [action-if-not-found]
15-
# --------------------------------------------------------
16-
# Check if libfabric support can be found.
17-
#
18-
# Sets prefix_{CPPFLAGS, LDFLAGs, LIBS} as needed and runs
19-
# action-if-found if there is support; otherwise executes
20-
# action-if-not-found.
21-
#
22-
AC_DEFUN([OPAL_CHECK_OFI],[
23-
if test -z "$opal_check_libfabric_happy" ; then
24-
OPAL_VAR_SCOPE_PUSH([opal_check_libfabric_$1_save_CPPFLAGS opal_check_libfabric_$1_save_LDFLAGS opal_check_libfabric_$1_save_LIBS])
25-
26-
# Add --with options
27-
AC_ARG_WITH([libfabric],
28-
[AC_HELP_STRING([--with-libfabric=DIR],
29-
[Deprecated synonym for --with-ofi])])
30-
AC_ARG_WITH([libfabric-libdir],
31-
[AC_HELP_STRING([--with-libfabric-libdir=DIR],
32-
[Deprecated synonym for --with-ofi-libdir])])
33-
34-
AC_ARG_WITH([ofi],
35-
[AC_HELP_STRING([--with-ofi=DIR],
36-
[Specify location of OFI libfabric installation, adding DIR/include to the default search location for libfabric headers, and DIR/lib or DIR/lib64 to the default search location for libfabric libraries. Error if libfabric support cannot be found.])])
37-
38-
AC_ARG_WITH([ofi-libdir],
39-
[AC_HELP_STRING([--with-ofi-libdir=DIR],
40-
[Search for OFI libfabric libraries in DIR])])
41-
42-
if test "$with_ofi" = ""; then
43-
with_ofi=$with_libfabric
44-
fi
45-
46-
if test "$with_ofi_libdir" = ""; then
47-
with_ofi_libdir=$with_libfabric_libdir
48-
fi
49-
50-
# Sanity check the --with values
51-
OPAL_CHECK_WITHDIR([ofi], [$with_ofi],
52-
[include/rdma/fabric.h])
53-
OPAL_CHECK_WITHDIR([ofi-libdir], [$with_ofi_libdir],
54-
[libfabric.*])
55-
56-
opal_check_ofi_$1_save_CPPFLAGS=$CPPFLAGS
57-
opal_check_ofi_$1_save_LDFLAGS=$LDFLAGS
58-
opal_check_ofi_$1_save_LIBS=$LIBS
59-
60-
opal_check_ofi_happy=yes
61-
AS_IF([test "$with_ofi" = "no"],
62-
[opal_check_ofi_happy=no])
63-
64-
AS_IF([test $opal_check_ofi_happy = yes],
65-
[AC_MSG_CHECKING([looking for OFI libfabric in])
66-
AS_IF([test "$with_ofi" != "yes"],
67-
[opal_ofi_dir=$with_ofi
68-
AC_MSG_RESULT([($opal_ofi_dir)])],
69-
[AC_MSG_RESULT([(default search paths)])])
70-
AS_IF([test ! -z "$with_ofi_libdir" && \
71-
test "$with_ofi_libdir" != "yes"],
72-
[opal_ofi_libdir=$with_ofi_libdir])
73-
])
74-
75-
AS_IF([test $opal_check_ofi_happy = yes],
76-
[OPAL_CHECK_PACKAGE([opal_check_ofi],
77-
[rdma/fabric.h],
78-
[fabric],
79-
[fi_getinfo],
80-
[],
81-
[$opal_ofi_dir],
82-
[$opal_ofi_libdir],
83-
[],
84-
[opal_check_ofi_happy=no])])
85-
86-
CPPFLAGS=$opal_check_ofi_$1_save_CPPFLAGS
87-
LDFLAGS=$opal_check_ofi_$1_save_LDFLAGS
88-
LIBS=$opal_check_ofi_$1_save_LIBS
89-
90-
OPAL_SUMMARY_ADD([[Transports]],[[OpenFabrics Libfabric]],[$1],[$opal_check_ofi_happy])
91-
92-
OPAL_VAR_SCOPE_POP
13+
dnl
14+
dnl _OPAL_CHECK_OFI
15+
dnl --------------------------------------------------------
16+
dnl Do the real work of checking for OFI libfabric.
17+
dnl Upon return:
18+
dnl
19+
dnl - opal_ofi_happy: will be "yes" or "no"
20+
dnl - opal_ofi_{CPPFLAGS|LDFLAGS|LIBS} will be loaded (if relevant)
21+
dnl
22+
AC_DEFUN([_OPAL_CHECK_OFI],[
23+
# Add --with options
24+
AC_ARG_WITH([libfabric],
25+
[AC_HELP_STRING([--with-libfabric=DIR],
26+
[Deprecated synonym for --with-ofi])])
27+
AC_ARG_WITH([libfabric-libdir],
28+
[AC_HELP_STRING([--with-libfabric-libdir=DIR],
29+
[Deprecated synonym for --with-ofi-libdir])])
30+
31+
AC_ARG_WITH([ofi],
32+
[AC_HELP_STRING([--with-ofi=DIR],
33+
[Specify location of OFI libfabric installation, adding DIR/include to the default search location for libfabric headers, and DIR/lib or DIR/lib64 to the default search location for libfabric libraries. Error if libfabric support cannot be found.])])
34+
35+
AC_ARG_WITH([ofi-libdir],
36+
[AC_HELP_STRING([--with-ofi-libdir=DIR],
37+
[Search for OFI libfabric libraries in DIR])])
38+
39+
if test "$with_ofi" = ""; then
40+
with_ofi=$with_libfabric
9341
fi
9442

95-
if test $opal_check_ofi_happy = yes ; then
96-
$1_CPPFLAGS="[$]$1_CPPFLAGS $opal_check_ofi_CPPFLAGS"
97-
$1_LIBS="[$]$1_LIBS $opal_check_ofi_LIBS"
98-
$1_LDFLAGS="[$]$1_LDFLAGS $opal_check_ofi_LDFLAGS"
99-
100-
AC_SUBST($1_CPPFLAGS)
101-
AC_SUBST($1_LDFLAGS)
102-
AC_SUBST($1_LIBS)
43+
if test "$with_ofi_libdir" = ""; then
44+
with_ofi_libdir=$with_libfabric_libdir
10345
fi
10446

105-
AS_IF([test $opal_check_ofi_happy = yes],
106-
[$2],
47+
# Sanity check the --with values
48+
OPAL_CHECK_WITHDIR([ofi], [$with_ofi],
49+
[include/rdma/fabric.h])
50+
OPAL_CHECK_WITHDIR([ofi-libdir], [$with_ofi_libdir],
51+
[libfabric.*])
52+
53+
OPAL_VAR_SCOPE_PUSH([opal_check_ofi_save_CPPFLAGS opal_check_ofi_save_LDFLAGS opal_check_ofi_save_LIBS])
54+
opal_check_ofi_save_CPPFLAGS=$CPPFLAGS
55+
opal_check_ofi_save_LDFLAGS=$LDFLAGS
56+
opal_check_ofi_save_LIBS=$LIBS
57+
58+
opal_ofi_happy=yes
59+
AS_IF([test "$with_ofi" = "no"],
60+
[opal_ofi_happy=no])
61+
62+
AS_IF([test $opal_ofi_happy = yes],
63+
[AC_MSG_CHECKING([looking for OFI libfabric in])
64+
AS_IF([test "$with_ofi" != "yes"],
65+
[opal_ofi_dir=$with_ofi
66+
AC_MSG_RESULT([($opal_ofi_dir)])],
67+
[AC_MSG_RESULT([(default search paths)])])
68+
AS_IF([test ! -z "$with_ofi_libdir" && \
69+
test "$with_ofi_libdir" != "yes"],
70+
[opal_ofi_libdir=$with_ofi_libdir])
71+
])
72+
73+
AS_IF([test $opal_ofi_happy = yes],
74+
[OPAL_CHECK_PACKAGE([opal_ofi],
75+
[rdma/fabric.h],
76+
[fabric],
77+
[fi_getinfo],
78+
[],
79+
[$opal_ofi_dir],
80+
[$opal_ofi_libdir],
81+
[],
82+
[opal_ofi_happy=no])])
83+
84+
CPPFLAGS=$opal_check_ofi_save_CPPFLAGS
85+
LDFLAGS=$opal_check_ofi_save_LDFLAGS
86+
LIBS=$opal_check_ofi_save_LIBS
87+
88+
AC_SUBST([opal_ofi_CPPFLAGS])
89+
AC_SUBST([opal_ofi_LDFLAGS])
90+
AC_SUBST([opal_ofi_LIBS])
91+
92+
OPAL_SUMMARY_ADD([[Transports]],[[OpenFabrics OFI Libfabric]],[],[$opal_ofi_happy])
93+
94+
OPAL_VAR_SCOPE_POP
95+
96+
AS_IF([test $opal_ofi_happy = no],
10797
[AS_IF([test -n "$with_ofi" && test "$with_ofi" != "no"],
10898
[AC_MSG_WARN([OFI libfabric support requested (via --with-ofi or --with-libfabric), but not found.])
10999
AC_MSG_ERROR([Cannot continue.])])
110-
$3])
100+
])
111101
])dnl
102+
103+
104+
dnl
105+
dnl OPAL_CHECK_OFI
106+
dnl --------------------------------------------------------
107+
dnl Check to see if OFI libfabric is available.
108+
dnl
109+
dnl This is a simple wrapper around _OPAL_CHECK_OFI that just
110+
dnl ensures to only run the checks once. We do not use AC_REQUIRE
111+
dnl because that re-orders the texts and makes ordering in stdout
112+
dnl quite confusing / difficult to grok.
113+
dnl
114+
AC_DEFUN([OPAL_CHECK_OFI],[
115+
# Check for OFI libfabric. Note that $opal_ofi_happy is used in
116+
# other configure.m4's to know if OFI/libfabric configured
117+
# successfully. We only need to run the back-end checks once, but
118+
# at least emit a "checking..." statement each subsequent time
119+
# this macro is invoked so that configure's stdout has
120+
# sensible/logical output.
121+
AS_IF([test -z "$opal_ofi_happy"],
122+
[_OPAL_CHECK_OFI],
123+
[AC_MSG_CHECKING([if OFI libfabric is available])
124+
AC_MSG_RESULT([$opal_ofi_happy])])
125+
])

configure.ac

Lines changed: 1 addition & 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-2018 Cisco Systems, Inc. All rights reserved
13+
# Copyright (c) 2006-2019 Cisco Systems, Inc. All rights reserved
1414
# Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
1515
# Copyright (c) 2006-2017 Los Alamos National Security, LLC. All rights
1616
# reserved.
@@ -152,7 +152,6 @@ AC_SUBST(libopen_pal_so_version)
152152
# transparently by adding some intelligence in autogen.pl
153153
# and/or opal_mca.m4, but I don't have the cycles to do this
154154
# right now.
155-
AC_SUBST(libmca_opal_common_ofi_so_version)
156155
AC_SUBST(libmca_opal_common_cuda_so_version)
157156
AC_SUBST(libmca_opal_common_sm_so_version)
158157
AC_SUBST(libmca_opal_common_ugni_so_version)

ompi/mca/mtl/ofi/Makefile.am

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#
22
# Copyright (c) 2013-2015 Intel, Inc. All rights reserved
33
#
4-
# Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
4+
# Copyright (c) 2014-2019 Cisco Systems, Inc. All rights reserved
55
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
66
# reserved.
77
# Copyright (c) 2017 IBM Corporation. All rights reserved.
8+
# Copyright (c) 2019 Research Organization for Information Science
9+
# and Technology (RIST). All rights reserved.
810
# $COPYRIGHT$
911
#
1012
# Additional copyrights may follow
@@ -14,7 +16,7 @@
1416

1517
EXTRA_DIST = post_configure.sh
1618

17-
AM_CPPFLAGS = $(ompi_mtl_ofi_CPPFLAGS) $(opal_common_ofi_CPPFLAGS)
19+
AM_CPPFLAGS = $(opal_ofi_CPPFLAGS)
1820

1921
dist_ompidata_DATA = help-mtl-ofi.txt
2022

@@ -44,15 +46,14 @@ mcacomponentdir = $(ompilibdir)
4446
mcacomponent_LTLIBRARIES = $(component_install)
4547
mca_mtl_ofi_la_SOURCES = $(mtl_ofi_sources)
4648
mca_mtl_ofi_la_LDFLAGS = \
47-
$(ompi_mtl_ofi_LDFLAGS) \
49+
$(opal_ofi_LDFLAGS) \
4850
-module -avoid-version
4951
mca_mtl_ofi_la_LIBADD = $(top_builddir)/ompi/lib@[email protected] \
50-
$(ompi_mtl_ofi_LIBS) \
51-
$(OPAL_TOP_BUILDDIR)/opal/mca/common/ofi/lib@OPAL_LIB_PREFIX@mca_common_ofi.la
52+
$(opal_ofi_LIBS)
5253

5354
noinst_LTLIBRARIES = $(component_noinst)
5455
libmca_mtl_ofi_la_SOURCES = $(mtl_ofi_sources)
5556
libmca_mtl_ofi_la_LDFLAGS = \
56-
$(ompi_mtl_ofi_LDFLAGS) \
57+
$(opal_ofi_LDFLAGS) \
5758
-module -avoid-version
58-
libmca_mtl_ofi_la_LIBADD = $(ompi_mtl_ofi_LIBS)
59+
libmca_mtl_ofi_la_LIBADD = $(opal_ofi_LIBS)

ompi/mca/mtl/ofi/configure.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Copyright (c) 2013-2014 Intel, Inc. All rights reserved
44
#
5-
# Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
5+
# Copyright (c) 2014-2019 Cisco Systems, Inc. All rights reserved
66
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
77
# reserved.
88
# $COPYRIGHT$
@@ -25,10 +25,10 @@ AC_DEFUN([MCA_ompi_mtl_ofi_POST_CONFIG], [
2525
AC_DEFUN([MCA_ompi_mtl_ofi_CONFIG],[
2626
AC_CONFIG_FILES([ompi/mca/mtl/ofi/Makefile])
2727

28-
# ensure we already ran the common OFI/libfabric config
29-
AC_REQUIRE([MCA_opal_common_ofi_CONFIG])
28+
# Check for OFI
29+
OPAL_CHECK_OFI
3030

31-
AS_IF([test "$opal_common_ofi_happy" = "yes"],
31+
AS_IF([test "$opal_ofi_happy" = "yes"],
3232
[$1],
3333
[$2])
3434
])dnl

opal/mca/btl/usnic/Makefile.am

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# All rights reserved.
1212
# Copyright (c) 2006 Sandia National Laboratories. All rights
1313
# reserved.
14-
# Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved.
14+
# Copyright (c) 2010-2019 Cisco Systems, Inc. All rights reserved
1515
# Copyright (c) 2015 Intel, Inc. All rights reserved.
1616
# Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
1717
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
@@ -23,7 +23,7 @@
2323
# $HEADER$
2424
#
2525

26-
AM_CPPFLAGS = -DBTL_IN_OPAL=1 $(opal_common_ofi_CPPFLAGS) -DOMPI_LIBMPI_NAME=\"$(OMPI_LIBMPI_NAME)\"
26+
AM_CPPFLAGS = -DBTL_IN_OPAL=1 $(opal_ofi_CPPFLAGS) -DOMPI_LIBMPI_NAME=\"$(OMPI_LIBMPI_NAME)\"
2727

2828
EXTRA_DIST = README.txt README.test
2929

@@ -88,13 +88,18 @@ mcacomponent_LTLIBRARIES = $(component)
8888
mca_btl_usnic_la_SOURCES = $(component_sources)
8989
mca_btl_usnic_la_LDFLAGS = \
9090
$(opal_btl_usnic_LDFLAGS) \
91+
$(opal_ofi_LDFLAGS) \
9192
-module -avoid-version
9293
mca_btl_usnic_la_LIBADD = $(top_builddir)/opal/lib@[email protected] \
93-
$(OPAL_TOP_BUILDDIR)/opal/mca/common/ofi/lib@OPAL_LIB_PREFIX@mca_common_ofi.la
94+
$(opal_ofi_LIBS)
9495

9596
noinst_LTLIBRARIES = $(lib)
9697
libmca_btl_usnic_la_SOURCES = $(lib_sources)
97-
libmca_btl_usnic_la_LDFLAGS = -module -avoid-version $(opal_btl_usnic_LDFLAGS)
98+
libmca_btl_usnic_la_LDFLAGS = \
99+
$(opal_btl_usnic_LDFLAGS) \
100+
$(opal_ofi_LDFLAGS) \
101+
-module -avoid-version
102+
libmca_btl_usnic_la_LIBADD = $(opal_ofi_LIBS)
98103

99104
if OPAL_BTL_USNIC_BUILD_UNIT_TESTS
100105
usnic_btl_run_tests_CPPFLAGS = \

opal/mca/btl/usnic/configure.m4

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# All rights reserved.
1313
# Copyright (c) 2006 Sandia National Laboratories. All rights
1414
# reserved.
15-
# Copyright (c) 2010-2017 Cisco Systems, Inc. All rights reserved
15+
# Copyright (c) 2010-2019 Cisco Systems, Inc. All rights reserved
1616
# Copyright (c) 2017 Los Alamos National Security, LLC. All rights
1717
# reserved.
1818
# $COPYRIGHT$
@@ -95,21 +95,17 @@ AC_DEFUN([_OPAL_BTL_USNIC_DO_CONFIG],[
9595
AC_MSG_RESULT([$opal_btl_usnic_happy])
9696
])
9797

98-
# The usnic BTL requires OFI libfabric support.
9998
AS_IF([test "$opal_btl_usnic_happy" = "yes"],
100-
[AC_MSG_CHECKING([whether OFI libfabric support is available])
101-
AS_IF([test "$opal_common_ofi_happy" = "yes"],
102-
[opal_btl_usnic_happy=yes],
103-
[opal_btl_usnic_happy=no])
104-
AC_MSG_RESULT([$opal_btl_usnic_happy])
105-
])
99+
[ # The usnic BTL requires OFI libfabric support
100+
OPAL_CHECK_OFI
101+
opal_btl_usnic_happy=$opal_ofi_happy])
106102

107103
# The usnic BTL requires at least OFI libfabric v1.1 (there was a
108104
# critical bug in libfabric v1.0).
109105
AS_IF([test "$opal_btl_usnic_happy" = "yes"],
110106
[AC_MSG_CHECKING([whether OFI libfabric is >= v1.1])
111107
opal_btl_usnic_CPPFLAGS_save=$CPPFLAGS
112-
CPPFLAGS="$opal_common_ofi_CPPFLAGS $CPPFLAGS"
108+
CPPFLAGS="$opal_ofi_CPPFLAGS $CPPFLAGS"
113109
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <rdma/fabric.h>]],
114110
[[
115111
#if !defined(FI_MAJOR_VERSION)
@@ -127,7 +123,7 @@ AC_DEFUN([_OPAL_BTL_USNIC_DO_CONFIG],[
127123
# Make sure we can find the OFI libfabric usnic extensions header
128124
AS_IF([test "$opal_btl_usnic_happy" = "yes" ],
129125
[opal_btl_usnic_CPPFLAGS_save=$CPPFLAGS
130-
CPPFLAGS="$opal_common_ofi_CPPFLAGS $CPPFLAGS"
126+
CPPFLAGS="$opal_ofi_CPPFLAGS $CPPFLAGS"
131127
AC_CHECK_HEADER([rdma/fi_ext_usnic.h],
132128
[],
133129
[opal_btl_usnic_happy=no])

0 commit comments

Comments
 (0)