Skip to content

Commit 68437ef

Browse files
committed
CI: add rpmbuild.yml
1 parent 057ae52 commit 68437ef

File tree

2 files changed

+162
-0
lines changed

2 files changed

+162
-0
lines changed

.github/workflows/ArborX.spec

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Stolen from eigen spec
2+
# The (empty) main package is arch, to have the package built and tests run
3+
# on all arches, but the actual result package is the noarch -devel subpackge.
4+
# Debuginfo packages are disabled to prevent rpmbuild from generating an empty
5+
# debuginfo package for the empty main package.
6+
%global debug_package %{nil}
7+
8+
Name: ArborX
9+
Version: 9999
10+
%global sover 0
11+
Release: 1%{?dist}
12+
Summary: Performance-portable geometric search library
13+
# no support for 32-bit archs https://github.com/kokkos/kokkos/issues/2312
14+
# mpi is broken on s390x see: bug#2322073
15+
ExcludeArch: i686 armv7hl s390x
16+
17+
License: BSD-3-Clause
18+
URL: https://github.com/arborx/%{name}
19+
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
20+
21+
BuildRequires: gcc-c++
22+
BuildRequires: cmake >= 3.16
23+
BuildRequires: kokkos-devel
24+
BuildRequires: openmpi-devel
25+
BuildRequires: mpich-devel
26+
BuildRequires: boost-devel
27+
BuildRequires: google-benchmark-devel
28+
29+
%global arborx_desc \
30+
ArborX is an open-source library designed to provide performance portable \
31+
algorithms for geometric search, similarly to nanoflann and Boost Geometry.
32+
33+
%description
34+
%{arborx_desc}
35+
36+
%package devel
37+
Summary: Development package for %{name} packages
38+
BuildArch: noarch
39+
%description devel
40+
%{arborx_desc}
41+
42+
This package contains the development files of %{name}.
43+
44+
%package openmpi-devel
45+
Summary: openmpi development headers and libraries for %{name}
46+
BuildArch: noarch
47+
Requires: openmpi-devel
48+
49+
%description openmpi-devel
50+
%{arborx_desc}
51+
52+
This package contains openmpi development files of %{name}.
53+
54+
%package mpich-devel
55+
Summary: mpich development headers and libraries for %{name}
56+
BuildArch: noarch
57+
Requires: mpich-devel
58+
59+
%description mpich-devel
60+
%{arborx_desc}
61+
62+
This package contains mpich development files of %{name}.
63+
64+
%prep
65+
%autosetup -p1 -n %{name}
66+
67+
%build
68+
# save memory
69+
%global _smp_mflags -j1
70+
%global _vpath_builddir %{_target_platform}-${mpi:-serial}
71+
72+
. /etc/profile.d/modules.sh
73+
for mpi in '' mpich openmpi; do
74+
test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
75+
%cmake \
76+
-DARBORX_ENABLE_TESTS=ON \
77+
-DARBORX_ENABLE_EXAMPLES=OFF \
78+
-DARBORX_ENABLE_BENCHMARKS=OFF \
79+
$(test -z "${mpi}" && echo -DARBORX_ENABLE_MPI=OFF || echo -DARBORX_ENABLE_MPI=ON) \
80+
-DCMAKE_INSTALL_DATADIR=${MPI_LIB:-%{_datadir}} \
81+
-DCMAKE_INSTALL_INCLUDEDIR=${MPI_INCLUDE:-%{_includedir}} \
82+
%{nil}
83+
%cmake_build
84+
test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
85+
done
86+
87+
%install
88+
. /etc/profile.d/modules.sh
89+
for mpi in '' mpich openmpi; do
90+
test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
91+
%cmake_install
92+
test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
93+
done
94+
95+
%check
96+
. /etc/profile.d/modules.sh
97+
for mpi in '' mpich openmpi; do
98+
test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
99+
%ctest
100+
test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
101+
done
102+
103+
%files devel
104+
%doc README.md
105+
%license LICENSE
106+
%{_includedir}/%{name}
107+
%{_datadir}/cmake/%{name}
108+
109+
%files openmpi-devel
110+
%doc README.md
111+
%license LICENSE
112+
%{_includedir}/openmpi*/%{name}
113+
%{_libdir}/openmpi*/lib/cmake/%{name}
114+
115+
%files mpich-devel
116+
%doc README.md
117+
%license LICENSE
118+
%{_includedir}/mpich*/%{name}
119+
%{_libdir}/mpich*/lib/cmake/%{name}

.github/workflows/rpmbuild.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: rpmbuild
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- rpmbuild
7+
pull_request:
8+
9+
concurrency:
10+
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
rpmbuild:
15+
continue-on-error: ${{ matrix.config.continue-on-error == 'true' }}
16+
strategy:
17+
matrix:
18+
config:
19+
- {arch: 'arm64'}
20+
- {arch: 'amd64'}
21+
runs-on: ${{ matrix.config.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
22+
container: fedora:latest
23+
steps:
24+
- name: Install fedpkg
25+
run: dnf -y install fedpkg
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
path: ArborX
30+
- name: Prepare rpmbuild
31+
run: |
32+
mkdir ArborX.rpm
33+
tar -cvzf ArborX-9999.tar.gz ArborX/
34+
cp ArborX-9999.tar.gz ArborX/.github/workflows/ArborX.spec ArborX.rpm
35+
- name: Install build deps
36+
working-directory: ArborX.rpm
37+
run: |
38+
dnf -y builddep ArborX.spec
39+
- name: Build rpm
40+
working-directory: ArborX.rpm
41+
run: |
42+
fedpkg --verbose --debug local
43+

0 commit comments

Comments
 (0)