From a5380c752bc94d5054c79eadb9612028c36fd426 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Tue, 4 Dec 2018 13:06:31 +0100 Subject: [PATCH] configure: detect libibverbs using ldcofnig This should be most robust way of detecting it. Fixes #524 Change-Id: Ic1e50500ca5eb51177ac5197c59005b133cd8367 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/435996 Tested-by: SPDK CI Jenkins Reviewed-by: Andrey Kuzmin Reviewed-by: Ben Walker Reviewed-by: Jim Harris Chandler-Test-Pool: SPDK Automated Test System --- configure | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 8298fc818..cba938dde 100755 --- a/configure +++ b/configure @@ -332,14 +332,20 @@ fi if [ "${CONFIG[RDMA]}" = "y" ]; then if [ "$OSTYPE" != "FreeBSD"* ]; then - ibv_lib_file="$(readlink -f /usr/lib64/libibverbs.so)" || true + 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" > 1 || ("$ibv_maj_ver" -eq 1 && "$ibv_min_ver" -ge 1) ]]; then + if [[ "$ibv_maj_var" -gt 1 || ("$ibv_maj_ver" -eq 1 && "$ibv_min_ver" -ge 1) ]]; then CONFIG[RDMA_SEND_WITH_INVAL]="y" else CONFIG[RDMA_SEND_WITH_INVAL]="n"