-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
executable file
·225 lines (191 loc) · 7.74 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
dnl Process this file with autoconf to produce a configure script.
AC_INIT([perftest],[5.93],[linux-rdma@vger.kernel.org])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_ARG_VAR(CUDA_H_PATH, help-string)
AC_ARG_VAR(RANLIB, ranlib tool)
AC_ARG_ENABLE([ibv_wr_api],
[AS_HELP_STRING([--disable-ibv_wr_api],
[Disable new post send API])])
AS_IF([test "x$enable_ibv_wr_api" = "xno"],
[USE_IBV_WR_API=no],
[USE_IBV_WR_API=yes])
AC_PREFIX_DEFAULT("/usr")
AC_PROG_CC
AC_PROG_CXX
AM_PROG_AS
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_RANLIB
AC_HEADER_STDC
AC_CHECK_HEADERS([infiniband/verbs.h],,[AC_MSG_ERROR([ibverbs header files not found])])
AC_CHECK_LIB([ibverbs], [ibv_get_device_list], [], [AC_MSG_ERROR([libibverbs not found])])
AC_CHECK_LIB([rdmacm], [rdma_create_event_channel], [], AC_MSG_ERROR([librdmacm-devel not found]))
AC_CHECK_LIB([ibumad], [umad_init], [LIBUMAD=-libumad], AC_MSG_ERROR([libibumad not found]))
AC_CHECK_LIB([m], [log], [LIBMATH=-lm], AC_MSG_ERROR([libm not found]))
AC_TRY_LINK([#include <infiniband/verbs.h>],
[struct ibv_flow *t = ibv_create_flow(NULL,NULL);],[HAVE_RAW_ETH_REG=yes], [HAVE_RAW_ETH_REG=no])
AM_CONDITIONAL([HAVE_RAW_ETH_REG],[test "x$HAVE_RAW_ETH_REG" = "xyes"])
if test $HAVE_RAW_ETH_REG = yes; then
AC_DEFINE([HAVE_RAW_ETH_REG], [1], [Enable RAW_ETH_TEST_REG])
fi
AM_CONDITIONAL([HAVE_RAW_ETH],true)
if [test $HAVE_RAW_ETH_REG = yes]; then
AC_DEFINE([HAVE_RAW_ETH], [1], [Enable RAW_ETH_TEST])
else
AM_CONDITIONAL([HAVE_RAW_ETH],false)
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[struct ibv_xrcd *t = ibv_open_xrcd(NULL,NULL);],[HAVE_XRCD=yes], [HAVE_XRCD=no])
AM_CONDITIONAL([HAVE_XRCD],[test "x$HAVE_XRCD" = "xyes"])
if test $HAVE_XRCD = yes; then
AC_DEFINE([HAVE_XRCD], [1], [Enable XRCD feature])
fi
AC_TRY_LINK([
#if !defined(__FreeBSD__)
#include <endian.h>
#else
#include <sys/endian.h>
#endif],
[int x = htobe32(0);],[HAVE_ENDIAN=yes], [HAVE_ENDIAN=no])
AM_CONDITIONAL([HAVE_ENDIAN],[test "x$HAVE_ENDIAN" = "xyes"])
if test $HAVE_ENDIAN = yes; then
AC_DEFINE([HAVE_ENDIAN], [1], [Enable endian conversion])
fi
AC_TRY_LINK([],
[#if !defined(__FreeBSD__)
#error nope
#endif],
[IS_FREEBSD=yes], [IS_FREEBSD=no])
AM_CONDITIONAL([IS_FREEBSD],[test "x$IS_FREEBSD" = "xyes"])
if test $IS_FREEBSD = yes; then
AC_DEFINE([IS_FREEBSD], [1], [OS is FreeBSD])
LIBMLX5=-lmlx5
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[char *c = IBV_LINK_LAYER_SCIF;],[HAVE_SCIF=yes], [HAVE_SCIF=no])
AM_CONDITIONAL([HAVE_SCIF],[test "x$HAVE_SCIF" = "xyes"])
if test $HAVE_SCIF = yes; then
AC_DEFINE([HAVE_SCIF], [1], [Enable SCIF link Layer])
fi
AC_TRY_LINK([
#include <infiniband/verbs.h>],
[int x = IBV_QP_INIT_ATTR_SEND_OPS_FLAGS;],[HAVE_IBV_WR_API=yes],[HAVE_IBV_WR_API=no])
AM_CONDITIONAL([HAVE_IBV_WR_API],[test "x$HAVE_IBV_WR_API" = "xyes"])
# TODO: Add appropriate check. Currently we consider that if rdma-core
# has new post send, it also has ibv_query_gid_type
if [test $HAVE_IBV_WR_API = yes]; then
AC_DEFINE([HAVE_GID_TYPE], [1], [Have a way to check gid type])
fi
if [test $HAVE_IBV_WR_API = yes] && [test $USE_IBV_WR_API = yes]; then
AC_DEFINE([HAVE_IBV_WR_API], [1], [Have new post send API support])
else
HAVE_IBV_WR_API=no
fi
AC_TRY_LINK([
#include <infiniband/mlx5dv.h>],
[int x = MLX5DV_QP_INIT_ATTR_MASK_QP_CREATE_FLAGS;],[HAVE_MLX5DV=yes], [HAVE_MLX5DV=no])
AM_CONDITIONAL([HAVE_MLX5DV],[test "x$HAVE_MLX5DV" = "xyes"])
AC_TRY_LINK([
#include <infiniband/verbs.h>],
[int x = IBV_FLOW_SPEC_IPV6;],[HAVE_IPV6=yes], [HAVE_IPV6=no])
AM_CONDITIONAL([HAVE_IPV6],[test "x$HAVE_IPV6" = "xyes"])
if [test $HAVE_IPV6 = yes]; then
AC_DEFINE([HAVE_IPV6], [1], [Enable IPv6 Flow Specification])
fi
AC_TRY_LINK([
#include <infiniband/verbs.h>],
[int x = IBV_FLOW_SPEC_IPV4_EXT;],[HAVE_IPV4_EXT=yes], [HAVE_IPV4_EXT=no])
AM_CONDITIONAL([HAVE_IPV4_EXT],[test "x$HAVE_IPV4_EXT" = "xyes"])
if [test $HAVE_IPV4_EXT = yes]; then
AC_DEFINE([HAVE_IPV4_EXT], [1], [Enable IPv4 Extended Flow Specification])
fi
AC_TRY_LINK([
#include <infiniband/verbs.h>],
[int x = IBV_FLOW_ATTR_SNIFFER;],[HAVE_SNIFFER=yes], [HAVE_SNIFFER=no])
AM_CONDITIONAL([HAVE_SNIFFER],[test "x$HAVE_SNIFFER" = "xyes"])
if [test $HAVE_SNIFFER = yes]; then
AC_DEFINE([HAVE_SNIFFER], [1], [Enable Sniffer Flow Specification])
fi
if [test $IS_FREEBSD = no]; then
CPU_IS_RO_COMPLIANT=yes
# Actually this is check for being affected by a known issue
# with Intel CPUs:
# https://lore.kernel.org/patchwork/patch/820922/
intel_no_ro_devices="6f01 6f02 6f03 6f04 6f05 6f06 6f07 6f08 6f09 6f0a 6f0b 6f0c 6f0d 6f0e 2f01 2f02 2f03 2f04 2f05 2f06 2f07 2f08 2f09 2f0a 2f0b 2f0c 2f0d 2f0e"
for cpu_num in $intel_no_ro_devices; do
ro_nonsupported=$(lspci -nn | grep -i 8086:$cpu_num)
if [ test "$ro_nonsupported" ]; then
CPU_IS_RO_COMPLIANT=no
fi
done
fi
AC_TRY_LINK([
#include <infiniband/verbs.h>],
[int x = IBV_ACCESS_RELAXED_ORDERING;],[HAVE_RO=yes], [HAVE_RO=no])
AM_CONDITIONAL([HAVE_RO],[test "x$HAVE_RO" = "xyes"])
if [test $HAVE_RO = yes] && [test "x$CPU_IS_RO_COMPLIANT" = "xyes"]; then
AC_DEFINE([HAVE_RO], [1], [Enable Relaxed Ordering])
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[struct ibv_device_attr_ex *attr_ex; int x = attr_ex->comp_mask;],[HAVE_EX=yes], [HAVE_EX=no])
AM_CONDITIONAL([HAVE_EX],[test "x$HAVE_EX" = "xyes"])
if [test $HAVE_EX = yes]; then
AC_DEFINE([HAVE_EX], [1], [Have EX support])
fi
AC_TRY_LINK([
#include <infiniband/verbs.h>],
[int x = IBV_ACCESS_ON_DEMAND;],[HAVE_EX_ODP=yes], [HAVE_EX_ODP=no])
AM_CONDITIONAL([HAVE_EX_ODP],[test "x$HAVE_EX_ODP" = "xyes"])
if [test $HAVE_EX_ODP = yes] && [test $HAVE_EX = yes]; then
AC_DEFINE([HAVE_EX_ODP], [1], [Have Extended ODP support])
fi
if [test "$CUDA_H_PATH" ]; then
AC_DEFINE([HAVE_CUDA], [1], [Enable CUDA feature])
AC_DEFINE_UNQUOTED([CUDA_PATH], "$CUDA_H_PATH" , [Enable CUDA feature])
LIBS=$LIBS" -lcuda"
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[struct ibv_qp_attr *attr; int x = attr->rate_limit;],[HAVE_PACKET_PACING=yes], [HAVE_PACKET_PACING=no])
AM_CONDITIONAL([HAVE_PACKET_PACING],[test "x$HAVE_PACKET_PACING" = "xyes"])
if [test $HAVE_PACKET_PACING = yes]; then
AC_DEFINE([HAVE_PACKET_PACING], [1], [Have PACKET_PACING support])
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[int x = IBV_OOO_RW_DATA_PLACEMENT;], [HAVE_OOO_ATTR=yes], [HAVE_OOO_ATTR=no])
AM_CONDITIONAL([HAVE_OOO_ATTR], [test "x$HAVE_OOO_ATTR" = "xyes"])
if [test $HAVE_OOO_ATTR = yes]; then
AC_DEFINE([HAVE_OOO_ATTR], [1], [Have Out of order data placement support])
fi
if [test $HAVE_IBV_WR_API = yes]; then
AC_CHECK_LIB([efa], [efadv_create_qp_ex], [HAVE_SRD=yes], [HAVE_SRD=no])
AC_TRY_LINK([#include <infiniband/efadv.h>],
[int x = EFADV_DEVICE_ATTR_CAPS_RDMA_READ;], [HAVE_RDMA_READ_SRD=yes], [HAVE_RDMA_READ_SRD=no])
if [test $HAVE_RDMA_READ_SRD = yes]; then
AC_DEFINE([HAVE_SRD_WITH_RDMA_READ], [1], [Have SRD with RDMA read support])
fi
else
AC_CHECK_LIB([efa], [efadv_create_driver_qp], [HAVE_SRD=yes], [HAVE_SRD=no])
fi
AM_CONDITIONAL([HAVE_SRD], [test "x$HAVE_SRD" = "xyes"])
if [test $HAVE_SRD = yes]; then
AC_DEFINE([HAVE_SRD], [1], [Have SRD support])
AC_SUBST([LIBEFA], [-lefa])
fi
AC_CHECK_LIB([mlx5], [mlx5dv_create_qp], [HAVE_MLX5DV_LIB=yes LIBMLX5=-lmlx5], [HAVE_MLX5DV_LIB=no])
AM_CONDITIONAL([HAVE_MLX5DV_LIB], [test "x$HAVE_MLX5DV_LIB" = "xyes"])
if [test $HAVE_MLX5DV_LIB = yes] && [test $HAVE_MLX5DV = yes]; then
AC_DEFINE([HAVE_MLX5DV], [1], [Have Direct Verbs support])
AC_SUBST([LIBMLX5])
fi
CFLAGS="-g -Wall -D_GNU_SOURCE -O3 $CFLAGS"
LIBS=$LIBS" -lpthread"
AC_SUBST([LIBUMAD])
AC_SUBST([LIBMATH])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT