From 9f6a6b19422d534f57f219558bdaea9e483ecb4a Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Tue, 5 Feb 2019 12:19:05 +0100 Subject: [PATCH] configure: detect IBV_WR_SEND_WITH_INV instead checking version Checking version of libibverbs is error prone as custom version might be installed that implements needed features but version number is not incremented. Instead test if we can compile with needed features. Fixes #524 Change-Id: I18e9ca923eea92b124e95a5f660955a01afad5c4 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/c/443387 (master) Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447587 Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- configure | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/configure b/configure index 264b8fa560..7cd9bacad7 100755 --- a/configure +++ b/configure @@ -359,20 +359,9 @@ fi if [ "${CONFIG[RDMA]}" = "y" ]; then if [ "$OSTYPE" != "FreeBSD"* ]; then - ibv_lib_file="$(ldconfig -p | grep 'libibverbs.so ' || true)" - if [ ! -z "$ibv_lib_file" ]; then - ibv_lib_file="${ibv_lib_file##*=> }" - ibv_lib_file="$(readlink -f $ibv_lib_file)" || true - fi - - if [ -z $ibv_lib_file ]; then - ibv_lib_file="libibverbs.so.0.0.0" - fi - - ibv_ver_str="$(basename $ibv_lib_file)" - ibv_maj_ver=`echo $ibv_ver_str | cut -d. -f3` - ibv_min_ver=`echo $ibv_ver_str | cut -d. -f4` - if [[ "$ibv_maj_var" -gt 1 || ("$ibv_maj_ver" -eq 1 && "$ibv_min_ver" -ge 1) ]]; then + if echo -e '#include \n \ + int main(void){ return !!IBV_WR_SEND_WITH_INV; }\n' \ + | ${CC:-cc} ${CFLAGS} -x c -c -o /dev/null - 2>/dev/null; then CONFIG[RDMA_SEND_WITH_INVAL]="y" else CONFIG[RDMA_SEND_WITH_INVAL]="n"