From ec03c9628caeba6fe4dacc4a8b9fe307f1d8af0b Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Sun, 30 Jan 2022 00:09:37 -0800 Subject: [PATCH 1/1] LU-15417 build: find the new path for MOFED 5.5 The path of the mofed header files has change to /usr/src/ofa_kernel/x86_64/, so we cannot assume it's /usr/src/ofa_kernel/default. Besides updating lbuild, we also need to update lustre-lnet.m4 and lustre.spec.in. Test-Parameters: trivial Change-Id: Iab42ce9e458f78b0dc0233ac6fd23a1760be5324 Fixes: 94a3f1bfa70 ("LU-15417 build: build MOFED 5.5") Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/46383 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Minh Diep Reviewed-by: Oleg Drokin --- lnet/autoconf/lustre-lnet.m4 | 4 +++- lustre.spec.in | 14 +++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index b9dffa0..daeb1cc 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -66,7 +66,9 @@ case $with_o2ib in OFED_INFO="ofed_info" LSPKG="rpm -ql" ]) - O2IBPATHS=$(eval $OFED_INFO | egrep -w 'mlnx-ofed-kernel-dkms|mlnx-ofa_kernel-devel|compat-rdma-devel|kernel-ib-devel|ofa_kernel-devel' | xargs $LSPKG | grep '\(/openib\|/ofa_kernel/default\|/ofa_kernel\)$' | head -n1) + O2IBPATHS=$(eval $OFED_INFO | + egrep -w 'mlnx-ofed-kernel-dkms|mlnx-ofa_kernel-devel|compat-rdma-devel|kernel-ib-devel|ofa_kernel-devel' | + xargs $LSPKG | grep -v 'ofa_kernel-' | grep rdma_cm.h | sed 's/\/include\/rdma\/rdma_cm.h//') AS_IF([test -z "$O2IBPATHS"], [ AC_MSG_ERROR([ You seem to have an OFED installed but have not installed it's devel package. diff --git a/lustre.spec.in b/lustre.spec.in index cced3d5..1995358 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -472,6 +472,18 @@ fi %{?_openmpi_load} %{?_mpich_load} +%if %{with mofed} + o2ib_path=$(find /usr/src/ofa_kernel/ -type d -name ofed_scripts | xargs dirname) + if [ -z "$o2ib_path" ]; then + echo "ERROR: could not find OFED devel headers" + exit 1 + fi + if [ $(echo $o2ib_path | wc -w) -ge 2 ]; then + echo "ERROR: multiple OFED versions installed" + exit 1 + fi +%endif + %eval_configure $CONFIGURE_ARGS \ %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \ %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \ @@ -488,7 +500,7 @@ fi %{!?with_manpages:--disable-manpages} \ %{!?with_systemd:--with-systemdsystemunitdir=no} \ %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \ - %{?with_mofed:--with-o2ib=/usr/src/ofa_kernel/default} \ + %{?with_mofed:--with-o2ib=$o2ib_path} \ --with-linux=%{kdir} \ --with-linux-obj=%{kobjdir} \ --with-kmp-moddir=%{kmoddir}/%{name} -- 1.8.3.1