-
Notifications
You must be signed in to change notification settings - Fork 290
/
configure.ac
executable file
·453 lines (393 loc) · 17.3 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# Copyright (C) 2001-2011 Mellanox Technologies Ltd. All rights reserved.
#
# This software is available to you under a choice of one of two
# licenses. You may choose to be licensed under the terms of the GNU
# General Public License (GPL) Version 2, available from the file
# COPYING in the main directory of this source tree, or the
# OpenIB.org BSD license below:
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# - Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# - Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
dnl Process this file with autoconf to produce a configure script.
AC_INIT([perftest],[6.24],[[email protected]])
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_CHECK_LIB([ibverbs], [ibv_reg_dmabuf_mr], [HAVE_REG_DMABUF_MR=yes], [HAVE_REG_DMABUF_MR=no])
if test $HAVE_REG_DMABUF_MR = yes; then
AC_DEFINE([HAVE_REG_DMABUF_MR], [1], [Enable HAVE_REG_DMABUF_MR])
fi
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/mlx5dv.h>],
[int x = __devx_dw_off(32);],[HAVE_MLX5_DEVX=yes], [HAVE_MLX5_DEVX=no])
AM_CONDITIONAL([HAVE_MLX5_DEVX],[test "x$HAVE_MLX5_DEVX" = "xyes"])
if [test $HAVE_MLX5_DEVX = yes] && [test $HAVE_MLX5DV = yes]; then
AC_DEFINE([HAVE_MLX5_DEVX], [1], [Have MLX5 DEVX support])
fi
AC_TRY_LINK([
#include <infiniband/mlx5dv.h>],
[int x = MLX5DV_QP_INIT_ATTR_MASK_DCI_STREAMS;],[HAVE_DCS=yes], [HAVE_DCS=no])
AM_CONDITIONAL([HAVE_DCS],[test "x$HAVE_DCS" = "xyes"])
if [test $HAVE_DCS = yes] && [test $HAVE_MLX5DV = yes]; then
AC_DEFINE([HAVE_DCS], [1], [Have DCS support])
fi
AC_TRY_LINK([
#include <infiniband/mlx5dv.h>],
[int x = MLX5DV_CONTEXT_MASK_OOO_RECV_WRS;],[HAVE_OOO_RECV_WRS=yes], [HAVE_OOO_RECV_WRS=no])
AM_CONDITIONAL([HAVE_OOO_RECV_WRS],[test "x$HAVE_OOO_RECV_WRS" = "xyes"])
if [test $HAVE_OOO_RECV_WRS = yes] && [test $HAVE_MLX5DV = yes]; then
AC_DEFINE([HAVE_OOO_RECV_WRS], [1], [Have DDP support])
fi
AC_TRY_LINK([
#include <infiniband/mlx5dv.h>],
[int x = MLX5DV_CRYPTO_STANDARD_AES_XTS;],[HAVE_AES_XTS=yes], [HAVE_AES_XTS=no])
AM_CONDITIONAL([HAVE_AES_XTS],[test "x$HAVE_AES_XTS" = "xyes"])
if [test $HAVE_AES_XTS = yes] && [test $HAVE_MLX5DV = yes]; then
AC_DEFINE([HAVE_AES_XTS], [1], [Have AES XTS support])
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[int c = IBV_GID_TYPE_ROCE_V1;],[HAVE_GID_TYPE_DECLARED=yes], [HAVE_GID_TYPE_DECLARED=no])
AM_CONDITIONAL([HAVE_GID_TYPE_DECLARED],[test "x$HAVE_GID_TYPE_DECLARED" = "xyes"])
if [test $HAVE_GID_TYPE_DECLARED = yes]; then
AC_DEFINE([HAVE_GID_TYPE_DECLARED], [1], [API GID compatibility])
fi
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
AC_CHECK_HEADERS([pci/pci.h],,[AC_MSG_ERROR([pciutils header files not found, consider installing pciutils-devel])])
AC_CHECK_LIB([pci], [pci_init], [LIBPCI=-lpci], AC_MSG_ERROR([libpci not found]))
CPU_IS_RO_COMPLIANT=yes
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])
LIBS=$LIBS" -lpci"
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_ARG_ENABLE([rocm],
[AS_HELP_STRING([--enable-rocm],
[Enable ROCm benchmarks])
],
[],
[enable_rocm=no])
AC_ARG_WITH([rocm],
[AS_HELP_STRING([--with-rocm=@<:@ROCm installation path@:>@],
[Provide path to ROCm installation])
],
[AS_CASE([$with_rocm],
[yes|no], [],
[CPPFLAGS="-I$with_rocm/include $CPPFLAGS"
LDFLAGS="-L$with_rocm/lib64 -Wl,-rpath=$with_rocm/lib64 -L$with_rocm/lib -Wl,-rpath=$with_rocm/lib -lamdhip64 $LDFLAGS"])
])
AS_IF([test "x$enable_rocm" = xyes], [
AC_DEFINE([__HIP_PLATFORM_AMD__], [1], [Enable ROCm])
AC_CHECK_HEADERS([hip/hip_runtime_api.h], [],
[AC_MSG_ERROR([cannot include hip/hip_runtime_api.h])])
AC_CHECK_HEADERS([hip/hip_version.h], [],
[AC_MSG_ERROR([cannot include hip_version.h])])
AC_SEARCH_LIBS([hipFree], [amdhip64], [],
[AC_MSG_ERROR([cannot link with -lamdhip64])])
AC_DEFINE([HAVE_ROCM], [1], [Enable ROCm])
])
AM_CONDITIONAL([ROCM], [test x$enable_rocm = xyes])
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"
AC_CHECK_LIB([cuda], [cuMemGetHandleForAddressRange], [HAVE_CUDA_CUMEMGETHANDLEFORADDRESSRANGE=yes], [HAVE_CUDA_CUMEMGETHANDLEFORADDRESSRANGE=no])
AC_TRY_LINK([
#include <$CUDA_H_PATH>],
[int x = CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD|CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED;],
[CUDA_DMA_BUF_PARAMETERS_SUPPORT=yes], [CUDA_DMA_BUF_PARAMETERS_SUPPORT=no])
if [test "x$HAVE_REG_DMABUF_MR" = "xyes"] && [test "x$HAVE_CUDA_CUMEMGETHANDLEFORADDRESSRANGE" = "xyes"] && [test "x$CUDA_DMA_BUF_PARAMETERS_SUPPORT" = "xyes"]; then
AC_DEFINE([HAVE_CUDA_DMABUF], [1], [Enable CUDA DMABUF feature])
fi
fi
AM_CONDITIONAL([CUDA_DMA_BUF_PARAMETERS_SUPPORT],[test "x$CUDA_DMA_BUF_PARAMETERS_SUPPORT" = "xyes"])
AM_CONDITIONAL([CUDA], [test "$CUDA_H_PATH"])
AC_ARG_ENABLE([neuron],
[AS_HELP_STRING([--enable-neuron],
[Enable Neuron benchmarks])
],
[],
[enable_neuron=no])
AC_ARG_WITH([neuron],
[AS_HELP_STRING([--with-neuron=@<:@NRT installation path@:>@],
[Provide path to NRT installation])
],
[AS_CASE([$with_neuron],
[yes|no], [],
[CPPFLAGS="-I$with_neuron/include $CPPFLAGS"
LDFLAGS="-L$with_neuron/lib -Wl,-rpath=$with_neuron/lib $LDFLAGS"])
])
AS_IF([test "x$enable_neuron" = xyes], [
AC_DEFINE([HAVE_NEURON], [1], [Enable Neuron benchmarks])
AC_CHECK_HEADERS([nrt/nrt.h], [],
[AC_MSG_ERROR([could not find nrt.h in include path])])
AC_SEARCH_LIBS([nrt_tensor_allocate], [nrt], [],
[AC_MSG_ERROR([could not find library, nrt])])
AC_SEARCH_LIBS([nrt_get_dmabuf_fd], [nrt],
[AC_DEFINE([HAVE_NEURON_DMABUF], [1], [Enable Neuron DMA buffers])],
[])
])
AM_CONDITIONAL([NEURON], [test x$enable_neuron = xyes])
AC_ARG_ENABLE([hl],
[AS_HELP_STRING([--enable-hl],
[Enable Habana Labs benchmarks])
],
[],
[enable_hl=no])
AC_ARG_WITH([hl],
[AS_HELP_STRING([--with-hl=@<:@habanalabs installation prefix@:>@],
[Provide Habana Labs installation prefix])
],
[AS_CASE([$with_hl],
[yes|no], [],
[CPPFLAGS="-I$with_hl/include/habanalabs $CPPFLAGS"
LDFLAGS="-L$with_hl/lib/habanalabs -Wl,-rpath=$with_hl/lib/habanalabs $LDFLAGS"])
])
AS_IF([test "x$enable_hl" = xyes], [
AC_DEFINE([HAVE_HL], [1], [Enable Habana Labs benchmarks])
AS_IF([test "x$HAVE_REG_DMABUF_MR" = "xno"],
[AC_MSG_ERROR([rdma-core doesn't support dmabuf mr registration])])
AC_CHECK_HEADERS([misc/habanalabs.h hlthunk.h synapse_api.h], [],
[AC_MSG_ERROR([could not find hl headers in include path])])
AC_SEARCH_LIBS([hlthunk_device_memory_export_dmabuf_fd], [hl-thunk], [],
[AC_MSG_ERROR([could not find library, hl-thunk])])
AC_SEARCH_LIBS([synDeviceMalloc], [Synapse], [],
[AC_MSG_ERROR([could not find library, Synapse])])
])
AM_CONDITIONAL([HABANALABS], [test x$enable_hl = xyes])
AC_ARG_ENABLE([mlu],
[AS_HELP_STRING([--enable-mlu],
[Enable MLU benchmarks])
],
[],
[enable_mlu=no])
AC_ARG_WITH([mlu],
[AS_HELP_STRING([--with-mlu=@<:@MLU installation path@:>@],
[Provide path to MLU installation])
],
[AS_CASE([$with_mlu],
[yes|no], [],
[CPPFLAGS="-I$with_mlu/include $CPPFLAGS"
LDFLAGS="-L$with_mlu/lib64 -Wl,-rpath=$with_mlu/lib64 -lcndrv $LDFLAGS"])
])
AS_IF([test "x$enable_mlu" = xyes], [
AC_DEFINE([HAVE_MLU], [1], [Enable MLU benchmarks])
AC_CHECK_HEADERS([cn_api.h], [],
[AC_MSG_ERROR([could not find cn_api.h in include path])])
AC_SEARCH_LIBS([cnMalloc], [cndrv], [],
[AC_MSG_ERROR([could not find library, cndrv])])
])
AM_CONDITIONAL([MLU], [test x$enable_mlu = xyes])
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
AC_TRY_LINK([#include <infiniband/efadv.h>],
[int x = EFADV_DEVICE_ATTR_CAPS_RDMA_WRITE;], [HAVE_RDMA_WRITE_SRD=yes], [HAVE_RDMA_WRITE_SRD=no])
if [test $HAVE_RDMA_WRITE_SRD = yes]; then
AC_DEFINE([HAVE_SRD_WITH_RDMA_WRITE], [1], [Have SRD with RDMA write support])
fi
AC_TRY_LINK([#include <infiniband/efadv.h>],
[int x = EFADV_DEVICE_ATTR_CAPS_UNSOLICITED_WRITE_RECV;], [HAVE_UNSOLICITED_WRITE_RECV_SRD=yes], [HAVE_UNSOLICITED_WRITE_RECV_SRD=no])
if [test $HAVE_UNSOLICITED_WRITE_RECV_SRD = yes]; then
AC_DEFINE([HAVE_SRD_WITH_UNSOLICITED_WRITE_RECV], [1], [Have SRD with unsolicited RDMA write with imm. 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
AC_CHECK_LIB([hns], [hnsdv_query_device], [HAVE_HNSDV=yes LIBHNS=-lhns], [HAVE_HNSDV=no])
AM_CONDITIONAL([HAVE_HNSDV], [test "x$HAVE_HNSDV" = "xyes"])
if [test $HAVE_HNSDV = yes]; then
AC_DEFINE([HAVE_HNSDV], [1], [Have hns Direct Verbs support])
AC_SUBST([LIBHNS])
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[ibv_cq_ex_to_cq], [HAVE_CQ_EX=yes], [HAVE_CQ_EX=no])
AM_CONDITIONAL([HAVE_CQ_EX], [test "x$HAVE_CQ_EX" = "xyes"])
if [test $HAVE_CQ_EX = yes]; then
AC_DEFINE([HAVE_CQ_EX], [1], [Have CQ EX API support])
fi
AC_TRY_LINK([#include <infiniband/verbs.h>],
[ibv_alloc_td], [HAVE_TD_API=yes], [HAVE_TD_API=no])
AM_CONDITIONAL([HAVE_TD_API], [test "x$HAVE_TD_API" = "xyes"])
if [test $HAVE_TD_API = yes]; then
AC_DEFINE([HAVE_TD_API], [1], [Have TD API support])
fi
CFLAGS="-g -Wall -D_GNU_SOURCE -O3 $CFLAGS"
LDFLAGS="$LDFLAGS"
LIBS=$LIBS" -lpthread"
AC_SUBST([LIBUMAD])
AC_SUBST([LIBMATH])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_COMMANDS([man], [${MKDIR_P} man])
AC_OUTPUT