Whamcloud - gitweb
LU-15417 build: find the new path for MOFED 5.5
authorJian Yu <yujian@whamcloud.com>
Tue, 1 Feb 2022 17:46:28 +0000 (09:46 -0800)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 2 Feb 2022 23:59:36 +0000 (23:59 +0000)
The path of the mofed header files has change to
/usr/src/ofa_kernel/x86_64/<kernel>,
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.

Lustre-change: https://review.whamcloud.com/46383
Lustre-commit: TBD (from a770658032bfe2717a689b3d6346e6b98e5cdeff)

Test-Parameters: trivial

Change-Id: Iab42ce9e458f78b0dc0233ac6fd23a1760be5324
Fixes: 0dbbe482148 ("LU-15417 build: build MOFED 5.5")
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46412
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Colin Faber <cfaber@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
autoMakefile.am
lnet/autoconf/lustre-lnet.m4
lustre.spec.in

index e387f65..e4ce7ef 100644 (file)
@@ -353,9 +353,23 @@ dkms-debs: undef.h
                echo -e "1i\nlustre ($$lversion-1) unstable; urgency=low\n\n  * Automated changelog entry update\n\n -- Brian J. Murrell <brian@interlinx.bc.ca>  $$(date -R)\n\n.\nwq" | ed debian/changelog; \
        fi; \
        rm -rf debs; \
+       if test "x@ENABLEO2IB@" != "xno"; then \
+               export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \
+               export O2IB_SRC="@O2IBPATH@"; \
+       fi; \
        export DEB_BUILD_PROFILES="client"; \
        export KERNEL_OBJ="$(LINUX_OBJ)"; \
        export KERNEL_SRC="$(LINUX)"; \
+       if test "x@ENABLEO2IB@" = "xno"; then \
+               export IB_OPTIONS="--with-o2ib=no"; \
+       else \
+               if test "x@ENABLEO2IB@" != "xyes" && \
+                  test -n "@O2IBPATH@"; then \
+                       export IB_OPTIONS="--with-o2ib=@O2IBPATH@"; \
+               else \
+                       export IB_OPTIONS="--with-o2ib=yes"; \
+               fi; \
+       fi; \
        if test "x@systemdsystemunitdir@" != "x"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
        fi; \
index 5c3825c..e2e6c04 100644 (file)
@@ -80,7 +80,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.
index 347bba5..5d8d149 100644 (file)
@@ -647,6 +647,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} \
@@ -664,7 +676,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}