blob: 03471155d635e164971c218ecb07e1cbd5a9b2da [file] [log] [blame]
Leon Romanovsky51940842015-11-08 14:39:44 +02001# Copyright (C) 2015 Mellanox Technologies Ltd. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions
5# are met:
6#
7# 1. Redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer.
9# 2. Redistributions in binary form must reproduce the above copyright
10# notice, this list of conditions and the following disclaimer in the
11# documentation and/or other materials provided with the distribution.
12# 3. Neither the name of the copyright holder nor the names of its
13# contributors may be used to endorse or promote products derived from
14# this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28dnl Process this file with autoconf to produce a configure script.
29
30define([scm_r], esyscmd([sh -c "git rev-parse --short=7 HEAD"])) dnl
31define([ibverbs_tests_ver_major], 1)
32define([ibverbs_tests_ver_minor], 0)
33define([ts], esyscmd([sh -c "date +%Y%m%d%H%M%S"])) dnl
34define([revcount], esyscmd([git rev-list HEAD | wc -l | sed -e 's/ *//g' | xargs -n1 printf])) dnl
35
36AC_INIT([ibverbs-tests], [ibverbs_tests_ver_major.ibverbs_tests_ver_minor])
37
38AC_CONFIG_AUX_DIR(config)
39AC_CONFIG_MACRO_DIR(config)
40AC_CONFIG_HEADER(config.h)
Artemy Kovalyov5070fdf2016-09-07 16:31:34 +030041AM_INIT_AUTOMAKE([1.10 foreign tar-ustar subdir-objects])
Leon Romanovsky51940842015-11-08 14:39:44 +020042m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
43
44dnl Checks for programs
45AC_PROG_CC([mpicc gcc icc])
46AC_PROG_CXX
47AC_GNU_SOURCE
48AC_PROG_LN_S
49AC_PROG_LIBTOOL
50
51##########################
Leon Romanovsky51940842015-11-08 14:39:44 +020052# Enable support for valgrind
53#
54AC_ARG_WITH([valgrind],
55 AC_HELP_STRING([--with-valgrind],
56 [Enable Valgrind annotations (small runtime overhead, default NO)]))
57if test x$with_valgrind = x || test x$with_valgrind = xno; then
58 want_valgrind=no
59 AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.])
60else
61 want_valgrind=yes
62 if test -d $with_valgrind; then
63 CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
64 fi
65fi
66
Leon Romanovsky51940842015-11-08 14:39:44 +020067dnl Checks for libraries
68AC_CHECK_LIB([ibverbs], [ibv_get_device_list], [], [AC_MSG_ERROR([libibverbs not found])])
69
70AC_CHECK_LIB(dl, dlsym, [],
71 AC_MSG_ERROR([dlsym() not found. ibverbs-tests requires libdl.]))
72
73AC_CHECK_LIB(pthread, pthread_mutex_init, [],
74 AC_MSG_ERROR([pthread_mutex_init() not found. ibverbs-tests requires libpthread.]))
75
76dnl Checks for header files.
77AC_HEADER_STDC
78
79if test x$want_valgrind = xyes; then
80AC_CHECK_HEADER(valgrind/memcheck.h,
81 [AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
82 [Define to 1 if you have the <valgrind/memcheck.h> header file.])],
83 [if test $want_valgrind = yes; then
84 AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
85 fi])
86fi
87
Artemy Kovalyovf4348fe2017-02-22 13:33:20 +020088AC_CHECK_DECLS([htobe64], [], [], [])
Leon Romanovskyce965a42015-11-09 16:02:32 +020089
Artemy Kovalyov4147f622017-02-27 13:11:03 +020090
Artemy Kovalyovf4348fe2017-02-22 13:33:20 +020091AC_CHECK_HEADERS([infiniband/verbs_exp.h])
Artemy Kovalyov2afd4292017-02-16 20:44:32 +020092
Kovalyov Artemyb324b012015-11-11 12:09:18 +020093AC_CHECK_HEADER([infiniband/peer_ops.h], [
Kovalyov Artemy970f38c2016-01-10 10:40:40 +020094 peerdirect=1
95 AC_ARG_WITH([peer],
96 AC_HELP_STRING([--with-peerdirect-meminval],
97 [Enable Peer-direct memory invalidation.]))
98 AC_CHECK_DECL([ibv_exp_peer_commit_qp], [
99 AC_DEFINE(PEER_DIRECT_EXP,1,[Experimetal Peer-Direct API])], [], [
Kovalyov Artemyb324b012015-11-11 12:09:18 +0200100#include<infiniband/peer_ops.h>
101])])
102AM_CONDITIONAL([PEER_DIRECT], [test x$peerdirect = x1])
Kovalyov Artemy970f38c2016-01-10 10:40:40 +0200103AM_CONDITIONAL([PEER_DIRECT_INVALIDATION_TEST],
104 [test x$with_peerdirect_meminval = xyes])
Kovalyov Artemyb324b012015-11-11 12:09:18 +0200105
Artemy Kovalyovfaf40a52017-07-15 12:30:50 +0300106AC_CHECK_DECL([IBV_SRQT_TM], [tag_matching=1], [], [
Artemy Kovalyovea26e1c2016-06-20 17:14:47 +0300107#include <infiniband/verbs.h>
108])
Artemy Kovalyovde0c6c12017-03-07 14:46:25 +0200109AC_CHECK_DECL([IBV_EXP_SRQT_TAG_MATCHING], [tag_matching=1], [], [
110#include <infiniband/verbs_exp.h>
111])
Artemy Kovalyovea26e1c2016-06-20 17:14:47 +0300112AM_CONDITIONAL([TAG_MATCHING], [test x$tag_matching = x1])
Artemy Kovalyove5c93662017-01-30 17:17:22 +0200113AC_CHECK_DECLS([ibv_post_srq_ops], [tag_matching_2=1], [], [
Artemy Kovalyov2afd4292017-02-16 20:44:32 +0200114#include <infiniband/verbs.h>
115])
Artemy Kovalyovde0c6c12017-03-07 14:46:25 +0200116AC_CHECK_DECLS([ibv_exp_post_srq_ops], [tag_matching_2=1], [], [
117#include <infiniband/verbs_exp.h>
118])
Artemy Kovalyove5c93662017-01-30 17:17:22 +0200119AM_CONDITIONAL([TAG_MATCHING_V0_2], [test x$tag_matching_2 = x1])
Artemy Kovalyovea26e1c2016-06-20 17:14:47 +0300120
Artemy Kovalyov7682d662017-06-13 13:58:48 +0300121AC_CHECK_TYPES([struct ibv_exp_tmh_ravh], [], [], [
122#include <infiniband/verbs_exp.h>
123])
124
Artemy Kovalyov4147f622017-02-27 13:11:03 +0200125AC_CHECK_DECLS([ibv_prefetch_mr], [], [], [
126#include <infiniband/verbs.h>
127])
128
129AC_CHECK_DECLS([ibv_exp_prefetch_mr], [], [], [
130#include <infiniband/verbs_exp.h>
131])
132
Leon Romanovsky51940842015-11-08 14:39:44 +0200133dnl Checks for typedefs, structures, and compiler characteristics.
134AC_C_CONST
135
Leon Romanovsky2426b4d2015-11-24 12:50:00 +0200136AC_CHECK_DECL([IBV_DEVICE_CROSS_CHANNEL], [cross_channel=1],
137 [cross_channel=0],
138 [[#include <infiniband/verbs.h>]])
139
Artemy Kovalyova36c8fe2017-01-23 21:45:45 +0200140AC_CHECK_DECLS([IBV_ACCESS_HUGETLB], [hugetlb=1], [], [
141#include <infiniband/verbs.h>
142])
143
Artemy Kovalyov42405312017-08-13 15:59:34 +0300144AC_CHECK_DECLS([IBV_EXP_CREATE_SRQ_DC_OFFLOAD_PARAMS], [], [], [
145#include <infiniband/verbs_exp.h>
146])
147
Leon Romanovsky2426b4d2015-11-24 12:50:00 +0200148if test x$cross_channel = x1; then
149 AC_DEFINE(HAVE_CROSS_CHANNEL, 1, [Cross-channel is supported])
150fi
151
Moses Reubendd87d4c2017-01-09 09:27:48 +0000152AC_CHECK_MEMBERS([struct ibv_flow_spec_tunnel.val], [Vxlan=1],
153 [Vxlan=0],
154 [[#include <infiniband/verbs.h>]])
155
156AC_CHECK_MEMBERS([struct ibv_exp_flow_spec_tunnel.val], [Vxlan_exp=1],
157 [Vxlan_exp=0],
158 [[#include <infiniband/verbs_exp.h>]])
159
160if test x$Vxlan_exp = x1 || test x$Vxlan = x1; then
161 AC_DEFINE(HAVE_VXLAN, 1, [Vxlan is supported])
162fi
163
Artemy Kovalyovf29f8a82018-12-12 09:55:06 +0200164AC_CHECK_DECL([IBV_EXP_SIG_TYPE_T10_DIF], [
165 sig_handover=1
166 AC_CHECK_DECLS([IBV_EXP_SIG_TYPE_CRC32], [], [], [
167#include <infiniband/verbs_exp.h>
168 ])
169], [], [
Artemy Kovalyov23e89242017-06-14 12:53:37 +0000170#include <infiniband/verbs_exp.h>
171])
172AM_CONDITIONAL([SIG_HANDOVER], [test x$sig_handover = x1])
173
Leon Romanovsky51940842015-11-08 14:39:44 +0200174if test $(basename ${CC}x) = mpiccx; then
175 AC_DEFINE(HAVE_MPICC, 1, [Use mpirun as a launcher])
176fi
177
Artemy Kovalyovb4f5b672018-10-13 21:35:43 +0000178AC_CHECK_LIB([mlx5-rdmav2], [mlx5dv_query_device],
179 [AC_SUBST(LIB_MLX5, [-lmlx5-rdmav2])],[
180AC_CHECK_LIB([mlx5], [mlx5dv_query_device],
181 [AC_SUBST(LIB_MLX5, [-lmlx5])],
182 [], [-libverbs])], [-libverbs])
183
Artemy Kovalyov7f03ef92018-12-12 10:01:51 +0200184AC_CHECK_DECLS([IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN], [], [], [[
185#include <infiniband/verbs.h>
186]])
187
Artemy Kovalyovfc18a362018-12-12 10:07:23 +0200188AC_CHECK_DECLS([IBV_EXP_DEVICE_ATTR_RESERVED_2], [], [], [[
189#include <infiniband/verbs_exp.h>
190]])
191
Artemy Kovalyovb4f5b672018-10-13 21:35:43 +0000192AC_CHECK_DECLS([MLX5DV_DCTYPE_DCT], [], [], [[
193#include <infiniband/mlx5dv.h>
194]])
195
Leon Romanovsky51940842015-11-08 14:39:44 +0200196AC_CONFIG_FILES([Makefile])
197AC_OUTPUT