180 lines
5.0 KiB
RPMSpec
180 lines
5.0 KiB
RPMSpec
#
|
|
# spec file for package mpitests
|
|
#
|
|
# Copyright (c) 2025 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%global flavor @BUILD_FLAVOR@%nil
|
|
|
|
%if "%{flavor}" == ""
|
|
%define pack_suff %{nil}
|
|
%else
|
|
%define pack_suff -%{flavor}
|
|
|
|
#
|
|
# Returns where MPI home is.
|
|
# Looks in the RPM based on the arg name for bin/mpicc
|
|
# and extracts mpihome from there.
|
|
# This handles mpicc being in the main RPM, in a -devel
|
|
# or in a dependency (when the top is an HPC meta RPM).
|
|
# However all the necessary packages MUST be installed.
|
|
%define hpc_mpi_home %( \
|
|
check_package(){ (rpm -ql $1 | grep -E -q 'bin/mpicc$') && echo $1;}; \
|
|
get_linked_pack(){ rpm -qR $1 | grep -v rpmlib | grep -v /sh | awk '{print $1}';}; \
|
|
dirname $(dirname $(rpm -ql $(check_package %flavor || check_package %{flavor}-devel || \
|
|
check_package $(get_linked_pack %flavor) || check_package $(get_linked_pack %{flavor}-devel)) | \
|
|
grep -E 'bin/mpicc$')))
|
|
|
|
%endif
|
|
|
|
%define osu_ver 7.5.1
|
|
%define imb_ver 2021.10
|
|
%define imb_dir mpi-benchmarks-IMB-v%{imb_ver}
|
|
%define osu_dir osu-micro-benchmarks-%{osu_ver}
|
|
|
|
%define mpi_home %{hpc_mpi_home}
|
|
%define implem_list_dir %{_datadir}/mpitests/implem.d/
|
|
%define sles_pre_or_15 (0%{?sle_version} > 120000 && 0%{?sle_version} <= 150000)
|
|
%define sles_pre_16 (0%{?sle_version} > 120000 && 0%{?sle_version} < 160000)
|
|
|
|
Name: mpitests%{pack_suff}
|
|
%if "%{flavor}" == ""
|
|
Summary: MPI Benchmarks common files
|
|
License: BSD-3-Clause AND CPL-1.0
|
|
Group: Development/Languages/Other
|
|
%else
|
|
Summary: MPI Benchmarks and tests for %{flavor}
|
|
License: BSD-3-Clause AND CPL-1.0
|
|
Group: Development/Languages/Other
|
|
%endif
|
|
Version: 3.2
|
|
Release: 0
|
|
URL: http://www.openfabrics.org/downloads.htm
|
|
Source0: http://mvapich.cse.ohio-state.edu/download/mvapich/osu-micro-benchmarks-%{osu_ver}.tar.gz
|
|
Source1: https://github.com/intel/mpi-benchmarks/archive/IMB-v%{imb_ver}.tar.gz
|
|
Source3: mpitests-runtests.sh
|
|
Source4: mpitests-run.sh
|
|
Source100: mpitests-rpmlintrc
|
|
Source101: _multibuild
|
|
Source102: README.md
|
|
Patch1: imb-cpp-flags.patch
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
BuildRequires: dos2unix
|
|
BuildRequires: gcc-c++
|
|
%if "%{flavor}" != ""
|
|
BuildRequires: %{flavor}
|
|
BuildRequires: %{flavor}-devel
|
|
Requires: %{flavor}
|
|
BuildRequires: mpitests = %{version}
|
|
Requires: mpitests = %{version}
|
|
%endif
|
|
ExcludeArch: %{arm} %ix86
|
|
|
|
%if "%{flavor}" == "mvapich2-psm2"
|
|
ExclusiveArch: x86_64
|
|
%endif
|
|
|
|
%if "%{flavor}" == "openmpi4"
|
|
ExcludeArch: ppc64
|
|
%endif
|
|
|
|
%if "%{flavor}" == "openmpi5"
|
|
%if %{sles_pre_16}
|
|
# Disable openmpi5 builds for SLES < 16
|
|
ExclusiveArch: do_not_build
|
|
%else
|
|
ExcludeArch: ppc64
|
|
%endif
|
|
%endif
|
|
|
|
%description
|
|
Set of popular MPI benchmarks: IMB v%{imb_ver} OSU benchmarks ver %{osu_ver}
|
|
|
|
%prep
|
|
%setup -c -q
|
|
%setup -T -D -a 1 -q
|
|
%autopatch -p0
|
|
|
|
|
|
%if "%{flavor}" != ""
|
|
%build
|
|
|
|
echo echo %{mpi_home}
|
|
. %{mpi_home}/bin/mpivars.sh
|
|
|
|
export CFLAGS="%{optflags}"
|
|
export CXXFLAGS="%{optflags}"
|
|
export LDFLAGS="%{optflags}"
|
|
|
|
# IMB Build
|
|
make CC=mpicc CXX=mpicxx \
|
|
-C %{imb_dir}/ all WITH_OPENMP=1
|
|
|
|
# OSU Build
|
|
( cd %{osu_dir} && \
|
|
./configure CC=mpicc CXX=mpicxx &&
|
|
make all)
|
|
|
|
%install
|
|
# IMB
|
|
for imb_test in IMB-EXT IMB-IO IMB-MPI1 IMB-NBC IMB-RMA; do \
|
|
install -D -m0755 %{imb_dir}/$imb_test %{buildroot}%{mpi_home}/tests/IMB/$imb_test;\
|
|
done
|
|
# OSU
|
|
make -C %{osu_dir} install prefix=%{buildroot}/usr libexecdir=%{buildroot}%{mpi_home}/tests
|
|
|
|
# Run script
|
|
sed -e s/@IMPLEM@/%{flavor}/g -e 's&@MPI_HOME@&%{mpi_home}&g' %{S:3} > %{buildroot}%{mpi_home}/tests/runtests.sh
|
|
chmod 0755 %{buildroot}%{mpi_home}/tests/runtests.sh
|
|
mkdir -p %{buildroot}%{implem_list_dir}
|
|
echo %{mpi_home}/tests/runtests.sh > %{buildroot}%{implem_list_dir}/%{flavor}
|
|
|
|
%check
|
|
%bcond_with mpitests_check
|
|
%if %{with mpitests_check}
|
|
export SHORT=%{short}
|
|
export IMPLEM_LIST_DIR=%{implem_list_dir}
|
|
export BUILDROOT=%{buildroot}
|
|
%{_datadir}/mpitests/runtests.sh
|
|
%else
|
|
echo "Skipping tests"
|
|
%endif
|
|
|
|
%else
|
|
|
|
%build
|
|
|
|
%install
|
|
install -D -m0755 %{S:4} %{buildroot}%{_datadir}/%{name}/runtests.sh
|
|
mkdir -p %{buildroot}%{_datadir}/mpitests/implem.d/
|
|
|
|
%endif
|
|
|
|
%files
|
|
%defattr(-, root, root)
|
|
%dir %{_datadir}/mpitests/
|
|
%dir %{_datadir}/mpitests/implem.d/
|
|
%if "%{flavor}" == ""
|
|
%{_datadir}/%{name}/runtests.sh
|
|
%else
|
|
%doc %{imb_dir}/license/license.txt
|
|
%doc %{imb_dir}/license/use-of-trademark-license.txt
|
|
%doc %{osu_dir}/COPYRIGHT
|
|
%{mpi_home}/tests
|
|
%{_datadir}/mpitests/implem.d/%{flavor}
|
|
%endif
|
|
|
|
%changelog
|