Whamcloud - gitweb
LU-15699 build: without mpi build fails 12/47712/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Thu, 23 Jun 2022 07:43:47 +0000 (00:43 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 5 Jul 2022 22:14:04 +0000 (22:14 +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

Lustre-change: https://review.whamcloud.com/46938
Lustre-commit: b07b6cd6c9622c44f45c017862103d2093e0aba1

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

index baf34bc..7de01e6 100644 (file)
@@ -366,8 +366,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
@@ -477,8 +477,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)
@@ -522,9 +528,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
 
@@ -554,6 +576,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}
@@ -626,6 +657,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