From: Shaun Tancheff Date: Sun, 27 Mar 2022 11:14:24 +0000 (-0400) Subject: LU-15699 build: without mpi build fails X-Git-Tag: 2.15.51~142 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b07b6cd6c9622c44f45c017862103d2093e0aba1;ds=sidebyside LU-15699 build: without mpi build fails 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 Change-Id: I2367597c715f68166275a689fe62634bf8a0607f Reviewed-on: https://review.whamcloud.com/46938 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alexey Lyashkov Reviewed-by: Petros Koutoupis Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre.spec.in b/lustre.spec.in index 8f0686b..1cb88fa 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -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