Whamcloud - gitweb
LU-15699 build: without mpi build fails 38/46938/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Sun, 27 Mar 2022 11:14:24 +0000 (07:14 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Jun 2022 05:53:47 +0000 (05:53 +0000)
RPM build must honor the --without mpi and should ensure
that packaging does not fail.

Also where multiple mpi flavors are installed only the
desired mpi_name should be loaded / unloaded

Test-Parameters: trivial
HPE-bug-id: LUS-8718
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I2367597c715f68166275a689fe62634bf8a0607f
Reviewed-on: https://review.whamcloud.com/46938
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre.spec.in

index 8f0686b..1cb88fa 100644 (file)
@@ -370,8 +370,8 @@ BuildRequires: openmpi-devel
 %else
 BuildRequires: openmpi2-devel
 %endif
-%endif
-%endif
+%endif # openmpi
+%endif # mpi
 
 %description tests
 This package contains a set of test binaries and scripts that are intended
@@ -481,8 +481,14 @@ fi
 # kmod tools/scripts require "name" directory with kernel modules
 %define eval_configure %(echo '%configure' | sed -e 's#\./configure#eval ./configure#' -e 's/--\\(build\\|host\\|target\\)=[^ ][^ ]* //g')
 
-%{?_openmpi_load}
+%if %{with mpi}
+%if %{mpi_name} == "mpich"
 %{?_mpich_load}
+%endif
+%if %{mpi_name} == "openmpi"
+%{?_openmpi_load}
+%endif
+%endif # mpi
 
 %if %{with mofed}
        o2ib_path=$(find /usr/src/ofa_kernel/ -type d -name ofed_scripts | xargs dirname)
@@ -526,9 +532,25 @@ fi
 
 make %{?_smp_mflags} -s %{?make_args}
 
+%if %{with mpi}
+%if %{mpi_name} == "mpich"
+%{?_mpich_unload}
+%endif
+%if %{mpi_name} == "openmpi"
+%{?_openmpi_unload}
+%endif
+%endif # mpi
+
 %install
-%{?_openmpi_load}
+
+%if %{with mpi}
+%if %{mpi_name} == "mpich"
 %{?_mpich_load}
+%endif
+%if %{mpi_name} == "openmpi"
+%{?_openmpi_load}
+%endif
+%endif # mpi
 
 make install DESTDIR=$RPM_BUILD_ROOT
 
@@ -558,6 +580,15 @@ mv $basemodpath/fs/kinode.ko $RPM_BUILD_ROOT%{_libdir}/lustre/tests/kernel/
 %endif
 %endif
 
+%if %{without mpi}
+if [ -d $RPM_BUILD_ROOT%{_libdir}/openmpi ] ; then
+       rm -fr $RPM_BUILD_ROOT%{_libdir}/openmpi
+fi
+if [ -d $RPM_BUILD_ROOT%{_libdir}/mpich ] ; then
+       rm -fr $RPM_BUILD_ROOT%{_libdir}/mpich
+fi
+%endif
+
 :> lustre.files
 
 %if %{with servers} && %{with lustre_utils}
@@ -630,6 +661,14 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/liblustreapi.la
 
 %if %{with lustre_tests}
 :> lustre-tests.files
+%if %{with mpi}
+%if %{mpi_name} == "mpich"
+%{?_mpich_load}
+%endif
+%if %{mpi_name} == "openmpi"
+%{?_openmpi_load}
+%endif
+%endif # mpi
 echo '%{_libdir}/lustre/tests/*' >>lustre-tests.files
 echo '%{_bindir}/mcreate' >>lustre-tests.files
 echo '%{_bindir}/munlink' >>lustre-tests.files