-
Notifications
You must be signed in to change notification settings - Fork 18
/
configure.ac
211 lines (175 loc) · 6.77 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
# Copyright (C) 2015 Mellanox Technologies Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. 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.
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl Process this file with autoconf to produce a configure script.
define([scm_r], esyscmd([sh -c "git rev-parse --short=7 HEAD"])) dnl
define([ibverbs_tests_ver_major], 1)
define([ibverbs_tests_ver_minor], 0)
define([ts], esyscmd([sh -c "date +%Y%m%d%H%M%S"])) dnl
define([revcount], esyscmd([git rev-list HEAD | wc -l | sed -e 's/ *//g' | xargs -n1 printf])) dnl
AC_INIT([ibverbs-tests], [ibverbs_tests_ver_major.ibverbs_tests_ver_minor])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([1.10 foreign tar-ustar subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Checks for programs
AC_PROG_CC([mpicc gcc icc])
AC_PROG_CXX
AC_GNU_SOURCE
AC_PROG_LN_S
AC_PROG_LIBTOOL
##########################
# Enable support for valgrind
#
AC_ARG_WITH([valgrind],
AC_HELP_STRING([--with-valgrind],
[Enable Valgrind annotations (small runtime overhead, default NO)]))
if test x$with_valgrind = x || test x$with_valgrind = xno; then
want_valgrind=no
AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.])
else
want_valgrind=yes
if test -d $with_valgrind; then
CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
fi
fi
dnl Checks for libraries
AC_CHECK_LIB([ibverbs], [ibv_get_device_list], [], [AC_MSG_ERROR([libibverbs not found])])
AC_CHECK_LIB(dl, dlsym, [],
AC_MSG_ERROR([dlsym() not found. ibverbs-tests requires libdl.]))
AC_CHECK_LIB(pthread, pthread_mutex_init, [],
AC_MSG_ERROR([pthread_mutex_init() not found. ibverbs-tests requires libpthread.]))
dnl Checks for header files.
AC_HEADER_STDC
if test x$want_valgrind = xyes; then
AC_CHECK_HEADER(valgrind/memcheck.h,
[AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
[Define to 1 if you have the <valgrind/memcheck.h> header file.])],
[if test $want_valgrind = yes; then
AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
fi])
fi
AC_CHECK_DECLS([htobe64], [], [], [])
AC_CHECK_HEADERS([infiniband/verbs_exp.h])
AC_CHECK_HEADER([infiniband/peer_ops.h], [
peerdirect=1
AC_ARG_WITH([peer],
AC_HELP_STRING([--with-peerdirect-meminval],
[Enable Peer-direct memory invalidation.]))
AC_CHECK_DECL([ibv_exp_peer_commit_qp], [
AC_DEFINE(PEER_DIRECT_EXP,1,[Experimetal Peer-Direct API])], [], [
#include<infiniband/peer_ops.h>
])])
AM_CONDITIONAL([PEER_DIRECT], [test x$peerdirect = x1])
AM_CONDITIONAL([PEER_DIRECT_INVALIDATION_TEST],
[test x$with_peerdirect_meminval = xyes])
AC_CHECK_DECL([IBV_SRQT_TM], [tag_matching=1], [], [
#include <infiniband/verbs.h>
])
AC_CHECK_DECL([IBV_EXP_SRQT_TAG_MATCHING], [tag_matching=1], [], [
#include <infiniband/verbs_exp.h>
])
AM_CONDITIONAL([TAG_MATCHING], [test x$tag_matching = x1])
AC_CHECK_DECLS([ibv_post_srq_ops], [tag_matching_2=1], [], [
#include <infiniband/verbs.h>
])
AC_CHECK_DECLS([ibv_exp_post_srq_ops], [tag_matching_2=1], [], [
#include <infiniband/verbs_exp.h>
])
AM_CONDITIONAL([TAG_MATCHING_V0_2], [test x$tag_matching_2 = x1])
AC_CHECK_TYPES([struct ibv_exp_tmh_ravh], [], [], [
#include <infiniband/verbs_exp.h>
])
AC_CHECK_DECLS([ibv_prefetch_mr], [], [], [
#include <infiniband/verbs.h>
])
AC_CHECK_DECLS([ibv_exp_prefetch_mr], [], [], [
#include <infiniband/verbs_exp.h>
])
AC_CHECK_DECLS([mlx5dv_devx_general_cmd], [devx=1], [], [
#include <infiniband/mlx5dv.h>
])
AM_CONDITIONAL([DEVX], [test -n "$devx"])
AC_CHECK_DECLS([__devx_nullp], [], [], [
#include <infiniband/mlx5dv.h>
])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_CHECK_DECL([IBV_DEVICE_CROSS_CHANNEL], [cross_channel=1],
[cross_channel=0],
[[#include <infiniband/verbs.h>]])
AC_CHECK_DECLS([IBV_ACCESS_HUGETLB], [hugetlb=1], [], [
#include <infiniband/verbs.h>
])
AC_CHECK_DECLS([IBV_EXP_CREATE_SRQ_DC_OFFLOAD_PARAMS], [], [], [
#include <infiniband/verbs_exp.h>
])
if test x$cross_channel = x1; then
AC_DEFINE(HAVE_CROSS_CHANNEL, 1, [Cross-channel is supported])
fi
AC_CHECK_MEMBERS([struct ibv_flow_spec_tunnel.val], [Vxlan=1],
[Vxlan=0],
[[#include <infiniband/verbs.h>]])
AC_CHECK_MEMBERS([struct ibv_exp_flow_spec_tunnel.val], [Vxlan_exp=1],
[Vxlan_exp=0],
[[#include <infiniband/verbs_exp.h>]])
if test x$Vxlan_exp = x1 || test x$Vxlan = x1; then
AC_DEFINE(HAVE_VXLAN, 1, [Vxlan is supported])
fi
AC_CHECK_DECL([IBV_EXP_SIG_TYPE_T10_DIF], [
sig_handover=1
AC_CHECK_DECLS([IBV_EXP_SIG_TYPE_CRC32], [], [], [
#include <infiniband/verbs_exp.h>
])
], [], [
#include <infiniband/verbs_exp.h>
])
AM_CONDITIONAL([SIG_HANDOVER], [test x$sig_handover = x1])
if test $(basename ${CC}x) = mpiccx; then
AC_DEFINE(HAVE_MPICC, 1, [Use mpirun as a launcher])
fi
AC_CHECK_LIB([mlx5-rdmav2], [mlx5dv_query_device],
[AC_SUBST(LIB_MLX5, [-lmlx5-rdmav2])],[
AC_CHECK_LIB([mlx5], [mlx5dv_query_device],
[AC_SUBST(LIB_MLX5, [-lmlx5])],
[], [-libverbs])], [-libverbs])
AC_CHECK_DECLS([IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN], [], [], [[
#include <infiniband/verbs.h>
]])
AC_CHECK_DECLS([IBV_EXP_DEVICE_ATTR_RESERVED_2], [], [], [[
#include <infiniband/verbs_exp.h>
]])
AC_CHECK_HEADERS([infiniband/mlx5dv.h])
AC_CHECK_DECLS([
mlx5dv_init_obj,
mlx5dv_devx_subscribe_devx_event,
MLX5DV_DCTYPE_DCT,
MLX5DV_CONTEXT_FLAGS_DEVX], [], [], [[
#include <infiniband/mlx5dv.h>
]])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT