Skip to content

Commit 30529a5

Browse files
committed
CI: add rpmbuild.yml
1 parent 057ae52 commit 30529a5

File tree

2 files changed

+159
-0
lines changed

2 files changed

+159
-0
lines changed

.github/workflows/ArborX.spec

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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+
for mpi in '' mpich openmpi; do
73+
test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
74+
%cmake \
75+
-DARBORX_ENABLE_TESTS=ON \
76+
-DARBORX_ENABLE_EXAMPLES=OFF \
77+
-DARBORX_ENABLE_BENCHMARKS=OFF \
78+
$(test -z "${mpi}" && echo -DARBORX_ENABLE_MPI=OFF || echo -DARBORX_ENABLE_MPI=ON) \
79+
-DCMAKE_INSTALL_DATADIR=${MPI_LIB:-%{_datadir}} \
80+
-DCMAKE_INSTALL_INCLUDEDIR=${MPI_INCLUDE:-%{_includedir}} \
81+
%{nil}
82+
%cmake_build
83+
test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
84+
done
85+
86+
%install
87+
for mpi in '' mpich openmpi; do
88+
test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
89+
%cmake_install
90+
test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
91+
done
92+
93+
%check
94+
for mpi in '' mpich openmpi; do
95+
test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
96+
%ctest
97+
test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
98+
done
99+
100+
%files devel
101+
%doc README.md
102+
%license LICENSE
103+
%{_includedir}/%{name}
104+
%{_datadir}/cmake/%{name}
105+
106+
%files openmpi-devel
107+
%doc README.md
108+
%license LICENSE
109+
%{_includedir}/openmpi*/%{name}
110+
%{_libdir}/openmpi*/lib/cmake/%{name}
111+
112+
%files mpich-devel
113+
%doc README.md
114+
%license LICENSE
115+
%{_includedir}/mpich*/%{name}
116+
%{_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)