From f912153f468217cb2f77b69cbd61eea8d9466500 Mon Sep 17 00:00:00 2001 From: Alexey Lyashkov Date: Fri, 8 Nov 2019 10:58:29 +0300 Subject: [PATCH 1/1] LU-12214 build: fix build with MPI lack of MPI library dependence will lost a mpi tests from build Cray-bug-id: LUS-6033, LUS-7204 Test-parameters: trivial Change-Id: I88b8ad67a9a2863fdcd02e2df5289fdd480c2a74 Signed-off-by: Alexey Lyashkov Reviewed-on: https://review.whamcloud.com/36427 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Alexander Boyko Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- lustre.spec.in | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/lustre.spec.in b/lustre.spec.in index 515fe2d..d896fbf 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -16,6 +16,7 @@ %bcond_without static %bcond_with systemd %bcond_with mofed +%bcond_without mpi # By default both gss and gss keyring are disabled. # gss keyring requires the gss core. If the builder @@ -128,6 +129,8 @@ %define with_systemd 1 %endif +%{!?mpi_name: %global mpi_name openmpi} + Summary: Lustre File System Name: %{lustre_name} Version: %{version} @@ -277,6 +280,18 @@ Requires: lustre-client = %{version} Requires: %{requires_kmod_name} = %{requires_kmod_version} Requires: %{requires_kmod_tests_name} = %{requires_kmod_version} Requires: attr, rsync, perl, lsof, libtool, /usr/bin/getconf +%if %{with mpi} +%if %{mpi_name} == "mpich" +BuildRequires: mpich-devel +%endif +%if %{mpi_name} == "openmpi" +%if %{_vendor} == "redhat" || 0%{?suse_version} < 1500 +BuildRequires: openmpi-devel +%else +BuildRequires: openmpi2-devel +%endif +%endif +%endif %description tests This package contains a set of test binaries and scripts that are intended @@ -376,6 +391,9 @@ 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} +%{?_mpich_load} + %eval_configure $CONFIGURE_ARGS \ %{?with_lustre_tests:--enable-tests}%{!?with_lustre_tests:--disable-tests} \ %{?with_lustre_utils:--enable-utils}%{!?with_lustre_utils:--disable-utils} \ @@ -400,6 +418,9 @@ fi make %{?_smp_mflags} -s %{?make_args} %install +%{?_openmpi_load} +%{?_mpich_load} + make install DESTDIR=$RPM_BUILD_ROOT # RHEL's kernel_module_path macro expects that all the modules @@ -503,12 +524,10 @@ echo '%{_bindir}/mcreate' >>lustre-tests.files echo '%{_bindir}/munlink' >>lustre-tests.files echo '%{_sbindir}/wirecheck' >>lustre-tests.files echo '%{_sbindir}/wiretest' >>lustre-tests.files -%if %{_vendor}=="redhat" -if [ -n "@MPI_BIN@" ]; then - echo '@MPI_BIN@/*' >>lustre-tests.files +if [ -n "$MPI_BIN" ]; then + echo "$MPI_BIN/*" >>lustre-tests.files fi %endif -%endif %files -f lustre.files %defattr(-,root,root) -- 1.8.3.1