Leon Romanovsky | 5194084 | 2015-11-08 14:39:44 +0200 | [diff] [blame] | 1 | # 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 | |
| 28 | dnl Process this file with autoconf to produce a configure script. |
| 29 | |
| 30 | define([scm_r], esyscmd([sh -c "git rev-parse --short=7 HEAD"])) dnl |
| 31 | define([ibverbs_tests_ver_major], 1) |
| 32 | define([ibverbs_tests_ver_minor], 0) |
| 33 | define([ts], esyscmd([sh -c "date +%Y%m%d%H%M%S"])) dnl |
| 34 | define([revcount], esyscmd([git rev-list HEAD | wc -l | sed -e 's/ *//g' | xargs -n1 printf])) dnl |
| 35 | |
| 36 | AC_INIT([ibverbs-tests], [ibverbs_tests_ver_major.ibverbs_tests_ver_minor]) |
| 37 | |
| 38 | AC_CONFIG_AUX_DIR(config) |
| 39 | AC_CONFIG_MACRO_DIR(config) |
| 40 | AC_CONFIG_HEADER(config.h) |
Artemy Kovalyov | 5070fdf | 2016-09-07 16:31:34 +0300 | [diff] [blame] | 41 | AM_INIT_AUTOMAKE([1.10 foreign tar-ustar subdir-objects]) |
Leon Romanovsky | 5194084 | 2015-11-08 14:39:44 +0200 | [diff] [blame] | 42 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 43 | |
| 44 | dnl Checks for programs |
| 45 | AC_PROG_CC([mpicc gcc icc]) |
| 46 | AC_PROG_CXX |
| 47 | AC_GNU_SOURCE |
| 48 | AC_PROG_LN_S |
| 49 | AC_PROG_LIBTOOL |
| 50 | |
| 51 | ########################## |
Leon Romanovsky | 5194084 | 2015-11-08 14:39:44 +0200 | [diff] [blame] | 52 | # Enable support for valgrind |
| 53 | # |
| 54 | AC_ARG_WITH([valgrind], |
| 55 | AC_HELP_STRING([--with-valgrind], |
| 56 | [Enable Valgrind annotations (small runtime overhead, default NO)])) |
| 57 | if 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.]) |
| 60 | else |
| 61 | want_valgrind=yes |
| 62 | if test -d $with_valgrind; then |
| 63 | CPPFLAGS="$CPPFLAGS -I$with_valgrind/include" |
| 64 | fi |
| 65 | fi |
| 66 | |
Leon Romanovsky | 5194084 | 2015-11-08 14:39:44 +0200 | [diff] [blame] | 67 | dnl Checks for libraries |
| 68 | AC_CHECK_LIB([ibverbs], [ibv_get_device_list], [], [AC_MSG_ERROR([libibverbs not found])]) |
| 69 | |
| 70 | AC_CHECK_LIB(dl, dlsym, [], |
| 71 | AC_MSG_ERROR([dlsym() not found. ibverbs-tests requires libdl.])) |
| 72 | |
| 73 | AC_CHECK_LIB(pthread, pthread_mutex_init, [], |
| 74 | AC_MSG_ERROR([pthread_mutex_init() not found. ibverbs-tests requires libpthread.])) |
| 75 | |
| 76 | dnl Checks for header files. |
| 77 | AC_HEADER_STDC |
| 78 | |
| 79 | if test x$want_valgrind = xyes; then |
| 80 | AC_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]) |
| 86 | fi |
| 87 | |
Artemy Kovalyov | f4348fe | 2017-02-22 13:33:20 +0200 | [diff] [blame] | 88 | AC_CHECK_DECLS([htobe64], [], [], []) |
Leon Romanovsky | ce965a4 | 2015-11-09 16:02:32 +0200 | [diff] [blame] | 89 | |
Artemy Kovalyov | 4147f62 | 2017-02-27 13:11:03 +0200 | [diff] [blame] | 90 | |
Artemy Kovalyov | f4348fe | 2017-02-22 13:33:20 +0200 | [diff] [blame] | 91 | AC_CHECK_HEADERS([infiniband/verbs_exp.h]) |
Artemy Kovalyov | 2afd429 | 2017-02-16 20:44:32 +0200 | [diff] [blame] | 92 | |
Kovalyov Artemy | b324b01 | 2015-11-11 12:09:18 +0200 | [diff] [blame] | 93 | AC_CHECK_HEADER([infiniband/peer_ops.h], [ |
Kovalyov Artemy | 970f38c | 2016-01-10 10:40:40 +0200 | [diff] [blame] | 94 | 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 Artemy | b324b01 | 2015-11-11 12:09:18 +0200 | [diff] [blame] | 100 | #include<infiniband/peer_ops.h> |
| 101 | ])]) |
| 102 | AM_CONDITIONAL([PEER_DIRECT], [test x$peerdirect = x1]) |
Kovalyov Artemy | 970f38c | 2016-01-10 10:40:40 +0200 | [diff] [blame] | 103 | AM_CONDITIONAL([PEER_DIRECT_INVALIDATION_TEST], |
| 104 | [test x$with_peerdirect_meminval = xyes]) |
Kovalyov Artemy | b324b01 | 2015-11-11 12:09:18 +0200 | [diff] [blame] | 105 | |
Artemy Kovalyov | faf40a5 | 2017-07-15 12:30:50 +0300 | [diff] [blame] | 106 | AC_CHECK_DECL([IBV_SRQT_TM], [tag_matching=1], [], [ |
Artemy Kovalyov | ea26e1c | 2016-06-20 17:14:47 +0300 | [diff] [blame] | 107 | #include <infiniband/verbs.h> |
| 108 | ]) |
Artemy Kovalyov | de0c6c1 | 2017-03-07 14:46:25 +0200 | [diff] [blame] | 109 | AC_CHECK_DECL([IBV_EXP_SRQT_TAG_MATCHING], [tag_matching=1], [], [ |
| 110 | #include <infiniband/verbs_exp.h> |
| 111 | ]) |
Artemy Kovalyov | ea26e1c | 2016-06-20 17:14:47 +0300 | [diff] [blame] | 112 | AM_CONDITIONAL([TAG_MATCHING], [test x$tag_matching = x1]) |
Artemy Kovalyov | e5c9366 | 2017-01-30 17:17:22 +0200 | [diff] [blame] | 113 | AC_CHECK_DECLS([ibv_post_srq_ops], [tag_matching_2=1], [], [ |
Artemy Kovalyov | 2afd429 | 2017-02-16 20:44:32 +0200 | [diff] [blame] | 114 | #include <infiniband/verbs.h> |
| 115 | ]) |
Artemy Kovalyov | de0c6c1 | 2017-03-07 14:46:25 +0200 | [diff] [blame] | 116 | AC_CHECK_DECLS([ibv_exp_post_srq_ops], [tag_matching_2=1], [], [ |
| 117 | #include <infiniband/verbs_exp.h> |
| 118 | ]) |
Artemy Kovalyov | e5c9366 | 2017-01-30 17:17:22 +0200 | [diff] [blame] | 119 | AM_CONDITIONAL([TAG_MATCHING_V0_2], [test x$tag_matching_2 = x1]) |
Artemy Kovalyov | ea26e1c | 2016-06-20 17:14:47 +0300 | [diff] [blame] | 120 | |
Artemy Kovalyov | 7682d66 | 2017-06-13 13:58:48 +0300 | [diff] [blame] | 121 | AC_CHECK_TYPES([struct ibv_exp_tmh_ravh], [], [], [ |
| 122 | #include <infiniband/verbs_exp.h> |
| 123 | ]) |
| 124 | |
Artemy Kovalyov | 4147f62 | 2017-02-27 13:11:03 +0200 | [diff] [blame] | 125 | AC_CHECK_DECLS([ibv_prefetch_mr], [], [], [ |
| 126 | #include <infiniband/verbs.h> |
| 127 | ]) |
| 128 | |
| 129 | AC_CHECK_DECLS([ibv_exp_prefetch_mr], [], [], [ |
| 130 | #include <infiniband/verbs_exp.h> |
| 131 | ]) |
| 132 | |
Leon Romanovsky | 5194084 | 2015-11-08 14:39:44 +0200 | [diff] [blame] | 133 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 134 | AC_C_CONST |
| 135 | |
Leon Romanovsky | 2426b4d | 2015-11-24 12:50:00 +0200 | [diff] [blame] | 136 | AC_CHECK_DECL([IBV_DEVICE_CROSS_CHANNEL], [cross_channel=1], |
| 137 | [cross_channel=0], |
| 138 | [[#include <infiniband/verbs.h>]]) |
| 139 | |
Artemy Kovalyov | a36c8fe | 2017-01-23 21:45:45 +0200 | [diff] [blame] | 140 | AC_CHECK_DECLS([IBV_ACCESS_HUGETLB], [hugetlb=1], [], [ |
| 141 | #include <infiniband/verbs.h> |
| 142 | ]) |
| 143 | |
Artemy Kovalyov | 4240531 | 2017-08-13 15:59:34 +0300 | [diff] [blame] | 144 | AC_CHECK_DECLS([IBV_EXP_CREATE_SRQ_DC_OFFLOAD_PARAMS], [], [], [ |
| 145 | #include <infiniband/verbs_exp.h> |
| 146 | ]) |
| 147 | |
Leon Romanovsky | 2426b4d | 2015-11-24 12:50:00 +0200 | [diff] [blame] | 148 | if test x$cross_channel = x1; then |
| 149 | AC_DEFINE(HAVE_CROSS_CHANNEL, 1, [Cross-channel is supported]) |
| 150 | fi |
| 151 | |
Moses Reuben | dd87d4c | 2017-01-09 09:27:48 +0000 | [diff] [blame] | 152 | AC_CHECK_MEMBERS([struct ibv_flow_spec_tunnel.val], [Vxlan=1], |
| 153 | [Vxlan=0], |
| 154 | [[#include <infiniband/verbs.h>]]) |
| 155 | |
| 156 | AC_CHECK_MEMBERS([struct ibv_exp_flow_spec_tunnel.val], [Vxlan_exp=1], |
| 157 | [Vxlan_exp=0], |
| 158 | [[#include <infiniband/verbs_exp.h>]]) |
| 159 | |
| 160 | if test x$Vxlan_exp = x1 || test x$Vxlan = x1; then |
| 161 | AC_DEFINE(HAVE_VXLAN, 1, [Vxlan is supported]) |
| 162 | fi |
| 163 | |
Artemy Kovalyov | 23e8924 | 2017-06-14 12:53:37 +0000 | [diff] [blame] | 164 | AC_CHECK_DECL([IBV_EXP_SIG_TYPE_T10_DIF], [sig_handover=1], [], [ |
| 165 | #include <infiniband/verbs_exp.h> |
| 166 | ]) |
| 167 | AM_CONDITIONAL([SIG_HANDOVER], [test x$sig_handover = x1]) |
| 168 | |
Leon Romanovsky | 5194084 | 2015-11-08 14:39:44 +0200 | [diff] [blame] | 169 | if test $(basename ${CC}x) = mpiccx; then |
| 170 | AC_DEFINE(HAVE_MPICC, 1, [Use mpirun as a launcher]) |
| 171 | fi |
| 172 | |
Artemy Kovalyov | b4f5b67 | 2018-10-13 21:35:43 +0000 | [diff] [blame] | 173 | AC_CHECK_LIB([mlx5-rdmav2], [mlx5dv_query_device], |
| 174 | [AC_SUBST(LIB_MLX5, [-lmlx5-rdmav2])],[ |
| 175 | AC_CHECK_LIB([mlx5], [mlx5dv_query_device], |
| 176 | [AC_SUBST(LIB_MLX5, [-lmlx5])], |
| 177 | [], [-libverbs])], [-libverbs]) |
| 178 | |
| 179 | AC_CHECK_DECLS([MLX5DV_DCTYPE_DCT], [], [], [[ |
| 180 | #include <infiniband/mlx5dv.h> |
| 181 | ]]) |
| 182 | |
Leon Romanovsky | 5194084 | 2015-11-08 14:39:44 +0200 | [diff] [blame] | 183 | AC_CONFIG_FILES([Makefile]) |
| 184 | AC_OUTPUT |