1
1
dnl -* - shell-script -* -
2
2
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.
4
4
dnl Copyright (c) 2016-2017 Los Alamos National Security, LLC. All rights
5
5
dnl reserved.
6
6
dnl $COPYRIGHT $
@@ -10,102 +10,116 @@ dnl
10
10
dnl $HEADER $
11
11
dnl
12
12
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
93
41
fi
94
42
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
103
45
fi
104
46
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],
107
97
[AS_IF([test -n " $with_ofi " && test " $with_ofi " != " no" ],
108
98
[AC_MSG_WARN([OFI libfabric support requested (via --with-ofi or --with-libfabric), but not found.])
109
99
AC_MSG_ERROR([Cannot continue.])])
110
- $3 ])
100
+ ])
111
101
])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
+ ])
0 commit comments