|
| 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} |
0 commit comments