summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--heffte.spec171
-rw-r--r--sources1
3 files changed, 173 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..8f25ded 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/heffte-2.4.1.tar.gz
diff --git a/heffte.spec b/heffte.spec
new file mode 100644
index 0000000..7227a9d
--- /dev/null
+++ b/heffte.spec
@@ -0,0 +1,171 @@
+Name: heffte
+Version: 2.4.1
+%global sover 2
+Release: 1%{?dist}
+Summary: Highly Efficient FFT for Exascale
+
+License: BSD-3-Clause
+URL: https://icl.utk.edu/fft/
+Source0: https://github.com/icl-utk-edu/heffte/archive/v%{version}/%{name}-%{version}.tar.gz
+
+# no openmpi on ix86
+# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
+# mpi is broken on s390x see, bug #2322073
+ExcludeArch: %{ix86} s390x
+
+BuildRequires: gcc-c++
+BuildRequires: gcc-fortran
+BuildRequires: cmake >= 3.16
+BuildRequires: doxygen
+BuildRequires: openmpi-devel
+BuildRequires: mpich-devel
+BuildRequires: fftw-devel
+BuildRequires: environment-modules
+
+%global heffte_desc \
+The Highly Efficient FFT for Exascale (heFFTe) library is being developed \
+as part of the Exascale Computing Project (ECP). HeFFTe delivers algorithms \
+for distributed fast-Fourier transforms in on a heterogeneous systems, \
+targeting the upcoming exascale machines.
+
+%description
+%{heffte_desc}
+
+%package openmpi
+Summary: Openmpi libraries for %{name}
+
+%description openmpi
+%{heffte_desc}
+
+This package contains %{name} libraries compiled with openmpi.
+
+%package openmpi-devel
+Summary: Openmpi development headers and libraries for %{name}
+Requires: %{name}-openmpi%{?_isa} = %{version}-%{release}
+Requires: openmpi-devel
+
+%description openmpi-devel
+%{heffte_desc}
+
+This package contains openmpi development files of %{name}.
+
+%package mpich
+Summary: Mpich libraries for %{name}
+
+%description mpich
+%{heffte_desc}
+
+This package contains %{name} libraries compiled with mpich.
+
+%package mpich-devel
+Summary: Mpich development headers and libraries for %{name}
+Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
+Requires: mpich-devel
+
+%description mpich-devel
+%{heffte_desc}
+
+This package contains mpich development files of %{name}.
+
+%package examples
+Summary: Example file for %{name}
+Requires: (%{name}-openmpi-devel = %{version} or %{name}-mpich-devel = %{version})
+BuildArch: noarch
+
+%description examples
+%{heffte_desc}
+
+This package contains example files for %{name}.
+
+%package doc
+Summary: Documentation for %{name}
+Requires: (%{name}-openmpi-devel = %{version} or %{name}-mpich-devel = %{version})
+BuildArch: noarch
+
+%description doc
+%{heffte_desc}
+
+This package contains documentation for %{name}.
+
+%prep
+%autosetup -p1
+
+%build
+source /etc/profile.d/modules.sh
+mkdir -p %{_target_platform}-${mpi} && cd %{_target_platform}-${mpi}
+export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
+
+for mpi in mpich openmpi; do
+ test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
+ %cmake .. \
+ -DHeffte_ENABLE_FFTW=ON \
+ -DHeffte_ENABLE_FORTRAN=ON \
+ -DHeffte_ENABLE_TESTING=ON \
+ -DHeffte_ENABLE_DOXYGEN=ON \
+ -DCMAKE_SKIP_INSTALL_RPATH=ON \
+ -DHeffte_SEQUENTIAL_TESTING=ON \
+ -DCMAKE_INSTALL_LIBDIR=${MPI_LIB:-%{_libdir}} \
+ -DCMAKE_INSTALL_INCLUDEDIR=${MPI_INCLUDE:-%{_includedir}} \
+ %{nil}
+ %make_build
+ test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
+done
+
+%install
+for mpi in mpich openmpi; do
+ test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
+ %make_install -C %{_target_platform}-${mpi}
+ test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
+done
+
+# files for testing install are not useful to package
+rm -rf %{buildroot}%{_datadir}/%{name}/testing
+
+%check
+# allow openmpi to oversubscribe, i.e. runs test with more
+# cores than the builder has
+export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
+
+for mpi in mpich openmpi; do
+ test -n "${mpi}" && module load mpi/${mpi}-%{_arch}
+ %ctest %{?testargs} -C %{_target_platform}-${mpi}
+ test -n "${mpi}" && module unload mpi/${mpi}-%{_arch}
+done
+
+%files openmpi
+%doc README.md
+%license LICENSE
+%{_libdir}/openmpi*/lib/lib%{name}*.so.%{version}
+
+%files openmpi-devel
+%{_includedir}/openmpi*/%{name}*
+%dir %{_includedir}/openmpi*/stock_fft
+%{_includedir}/openmpi*/stock_fft/*.h
+%{_libdir}/openmpi*/lib/cmake/Heffte
+%{_libdir}/openmpi*/lib/lib%{name}*.so
+%{_libdir}/openmpi*/lib/lib%{name}*.so.%{sover}
+
+%files mpich
+%doc README.md
+%license LICENSE
+%{_libdir}/mpich*/lib/lib%{name}*.so.%{version}
+
+%files mpich-devel
+%{_includedir}/mpich*/%{name}*
+%dir %{_includedir}/mpich*/stock_fft
+%{_includedir}/mpich*/stock_fft/*.h
+%{_libdir}/mpich*/lib/cmake/Heffte
+%{_libdir}/mpich*/lib/lib%{name}*.so
+%{_libdir}/mpich*/lib/lib%{name}*.so.%{sover}
+
+%files examples
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}/examples
+%{_datadir}/%{name}/HeffteMakefile.in
+
+%files doc
+%{_datadir}/%{name}/docs
+
+%changelog
+* Tue Dec 12 2024 张天宇 <zhangtianyu@iscas.ac.cn> - 2.4.1-1
+- Initial package
diff --git a/sources b/sources
new file mode 100644
index 0000000..66ebe2c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+8230cbefd7d7f0e0034e36af02d19c28 heffte-2.4.1.tar.gz