## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Based on # https://src.fedoraproject.org/rpms/dbcsr # https://src.fedoraproject.org/rpms/MUSIC %ifarch i686 %global mpi_list mpich %else %global mpi_list mpich openmpi %endif %global precision_list single double Name: spfft Version: 1.1.0 Release: %autorelease Summary: Sparse 3D FFT library License: BSD-3-Clause URL: https://github.com/eth-cscs/SpFFT Source: %{URL}/archive/v%{version}/SpFFT-%{version}.tar.gz BuildRequires: cli11-devel BuildRequires: cmake BuildRequires: fftw3-devel BuildRequires: gcc-c++ BuildRequires: gcc-gfortran BuildRequires: gmock-devel BuildRequires: gtest-devel BuildRequires: json-devel BuildRequires: pkgconf %global _description %{expand: A 3D FFT library for sparse frequency domain data written in C++ with support for MPI, OpenMP, CUDA and ROCm. Inspired by the need of some computational material science applications with spherical cutoff data in frequency domain, SpFFT provides Fast Fourier Transformations of sparse frequency domain data. For distributed computations with MPI, slab decomposition in space domain and pencil decomposition in frequency domain (sparse data within a pencil / column must be on one rank) is used. ### Design Goals - Sparse frequency domain input - Reuse of pre-allocated memory - Support for shifted indexing with centered zero-frequency - Optional parallelization and GPU acceleration - Unified interface for calculations on CPUs and GPUs - Support of Complex-To-Real and Real-To-Complex transforms, where the full hermitian symmetry property is utilized - C++, C and Fortran interfaces ### Interface Design To allow for pre-allocation and reuse of memory, the design is based on two classes: - **Grid**: Provides memory for transforms up to a given size. - **Transform**: Created with information on sparse input data and is associated with a *Grid*. Maximum size is limited by *Grid* dimensions. Internal reference counting to *Grid* objects guarantee a valid state until *Transform* object destruction. A transform can be computed in-place and out-of-place. Addtionally, an internally allocated work buffer can optionally be used for input / output of space domain data.} %description %_description %package libs-single Summary: Libraries for single precision SpFFT %description libs-single %_description %package single-devel Summary: Development files for SpFFT Requires: %{name}%{?_isa} = %{version}-%{release} Requires: gcc-gfortran%{_isa} %description single-devel Development header files for SpFFT. %package libs-double Summary: Libraries for SpFFT %description libs-double %_description %package double-devel Summary: Development files for SpFFT Requires: %{name}%{?_isa} = %{version}-%{release} Requires: gcc-gfortran%{_isa} %description double-devel Development header files for SpFFT. %ifnarch i686 %package openmpi-libs Summary: SpFFT - openmpi version BuildRequires: openmpi-devel %description openmpi-libs %_description This package contains the parallel single- and multi-threaded versions using OpenMPI. %package openmpi-devel Summary: Development files for %{name}-openmpi Requires: %{name}-openmpi%{?_isa} = %{version}-%{release} Requires: gcc-gfortran%{_isa} %description openmpi-devel Development and header files for SpFFT built with OpenMPI. %endif %package mpich-libs Summary: SpFFT - mpich version BuildRequires: mpich-devel %description mpich-libs %_description This package contains the parallel single- and multi-threaded versions using mpich. %package mpich-devel Summary: Development files for %{name}-mpich Requires: %{name}-mpich%{?_isa} = %{version}-%{release} Requires: gcc-gfortran%{_isa} %description mpich-devel Development and header files for SpFFT built with mpich. %prep # Need to create separate build directories for each build %autosetup -c -n SpFFT-%{version} -N sed -i 's/googletest CONFIG REQUIRED/GTest CONFIG REQUIRED/g' \ SpFFT-%{version}/tests/CMakeLists.txt sed -i 's/gtest\_main/gtest\_main gtest/g' \ SpFFT-%{version}/tests/CMakeLists.txt for precision in %{precision_list} do cp -a -p SpFFT-%{version} SpFFT-%{version}-$precision done # Need to create separate build directories for each build for mpi in %{mpi_list} do for precision in %{precision_list} do cp -a -p SpFFT-%{version} SpFFT-%{version}-$mpi-$precision done done %build for precision in %{precision_list} do pushd SpFFT-%{version}-$precision %cmake -DSPFFT_STATIC=OFF \ -DSPFFT_OMP=OFF \ -DSPFFT_MPI=OFF \ -DSPFFT_SINGLE_PRECISION=$([ "$precision" = "single" ] && echo "ON" || echo "OFF") \ -DSPFFT_BUILD_TESTS=ON \ -DSPFFT_FORTRAN=ON \ -DSPFFT_BUNDLED_LIBS=OFF \ -DSPFFT_INSTALL=ON \ -DCMAKE_PREFIX_PATH=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR=%{_libdir}/spfft-$precision \ -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/spfft-$precision %cmake_build popd done for mpi in %{mpi_list} do module load mpi/$mpi-%{_arch} for precision in %{precision_list} do pushd SpFFT-%{version}-$mpi-$precision %cmake -DSPFFT_STATIC=OFF \ -DSPFFT_OMP=OFF \ -DSPFFT_MPI=ON \ -DSPFFT_SINGLE_PRECISION=$([ "$precision" = "single" ] && echo "ON" || echo "OFF") \ -DSPFFT_BUILD_TESTS=ON \ -DSPFFT_FORTRAN=ON \ -DSPFFT_BUNDLED_LIBS=OFF \ -DSPFFT_INSTALL=ON \ -DCMAKE_PREFIX_PATH=%{_prefix} \ -DCMAKE_INSTALL_LIBDIR=${MPI_LIB:-%{_libdir}}/spfft-$precision \ -DCMAKE_INSTALL_INCLUDEDIR=${MPI_INCLUDE:-%{_includedir}}/spfft-$precision %cmake_build popd done module purge done %install for precision in %{precision_list} do pushd SpFFT-%{version}-$precision %cmake_install mkdir -p %{buildroot}%{_fmoddir}/spfft-$precision mv %{buildroot}%{_includedir}/spfft-$precision/spfft.mod \ %{buildroot}%{_fmoddir}/spfft-$precision/spfft.mod popd done for mpi in %{mpi_list} do module load mpi/$mpi-%{_arch} for precision in %{precision_list} do pushd SpFFT-%{version}-$mpi-$precision %cmake_install popd done module purge done %check for precision in %{precision_list} do pushd SpFFT-%{version}-$precision # tests/run_local_tests popd done for mpi in %{mpi_list} do module load mpi/$mpi-%{_arch} for precision in %{precision_list} do pushd SpFFT-%{version}-$mpi-$precision # mpirun -n 2 tests/run_mpi_tests popd done module purge done %files libs-single %license SpFFT-%{version}-single/LICENSE %doc SpFFT-%{version}-single/README.md %{_libdir}/spfft-single/libspfft.so.1.1.0 %files single-devel %dir %{_includedir}/spfft-single %{_includedir}/spfft-single/*.h %{_includedir}/spfft-single/*.hpp %{_includedir}/spfft-single/*.f90 %{_fmoddir}/spfft-single/spfft.mod %{_libdir}/spfft-single/pkgconfig/SpFFT.pc %{_libdir}/spfft-single/libspfft.so %{_libdir}/spfft-single/libspfft.so.1 %dir %{_libdir}/spfft-single/ %dir %{_libdir}/spfft-single/cmake %dir %{_libdir}/spfft-single/cmake/SpFFT %{_libdir}/spfft-single/cmake/SpFFT/*.cmake %dir %{_libdir}/spfft-single/cmake/SpFFT/modules %{_libdir}/spfft-single/cmake/SpFFT/modules/*.cmake %files libs-double %license SpFFT-%{version}-double/LICENSE %doc SpFFT-%{version}-double/README.md %{_libdir}/spfft-double/libspfft.so.1.1.0 %files double-devel %dir %{_includedir}/spfft-double %{_includedir}/spfft-double/*.h %{_includedir}/spfft-double/*.hpp %{_includedir}/spfft-double/*.f90 %{_fmoddir}/spfft-double/spfft.mod %{_libdir}/spfft-double/pkgconfig/SpFFT.pc %{_libdir}/spfft-double/libspfft.so %{_libdir}/spfft-double/libspfft.so.1 %dir %{_libdir}/spfft-double/ %dir %{_libdir}/spfft-double/cmake %dir %{_libdir}/spfft-double/cmake/SpFFT %{_libdir}/spfft-double/cmake/SpFFT/*.cmake %dir %{_libdir}/spfft-double/cmake/SpFFT/modules %{_libdir}/spfft-double/cmake/SpFFT/modules/*.cmake %ifnarch i686 %files openmpi-libs %license SpFFT-%{version}/LICENSE %doc SpFFT-%{version}/README.md %{_libdir}/openmpi*/lib/libspfft.so.1.1.0 %files openmpi-devel %dir %{_includedir}/openmpi*/spfft %{_includedir}/openmpi*/spfft/*.h %{_includedir}/openmpi*/spfft/*.hpp %{_includedir}/openmpi*/spfft/*.f90 %{_includedir}/openmpi*/spfft/spfft.mod %dir %{_libdir}/openmpi*/lib/pkgconfig %{_libdir}/openmpi*/lib/pkgconfig/SpFFT.pc %{_libdir}/openmpi*/lib/libspfft.so %{_libdir}/openmpi*/lib/libspfft.so.1 %dir %{_libdir}/openmpi*/lib/cmake/SpFFT %{_libdir}/openmpi*/lib/cmake/SpFFT/*.cmake %dir %{_libdir}/openmpi*/lib/cmake/SpFFT/modules %{_libdir}/openmpi*/lib/cmake/SpFFT/modules/*.cmake %endif %files mpich-libs %license SpFFT-%{version}/LICENSE %doc SpFFT-%{version}/README.md %{_libdir}/mpich*/lib/libspfft.so.1.1.0 %files mpich-devel %dir %{_includedir}/mpich*/spfft %{_includedir}/mpich*/spfft/*.h %{_includedir}/mpich*/spfft/*.hpp %{_includedir}/mpich*/spfft/*.f90 %{_includedir}/mpich*/spfft/spfft.mod %dir %{_libdir}/mpich*/lib/pkgconfig %{_libdir}/mpich*/lib/pkgconfig/SpFFT.pc %{_libdir}/mpich*/lib/libspfft.so %{_libdir}/mpich*/lib/libspfft.so.1 %dir %{_libdir}/mpich*/lib/cmake/SpFFT %{_libdir}/mpich*/lib/cmake/SpFFT/*.cmake %dir %{_libdir}/mpich*/lib/cmake/SpFFT/modules %{_libdir}/mpich*/lib/cmake/SpFFT/modules/*.cmake %changelog ## START: Generated by rpmautospec * Fri Dec 20 2024 John Doe - 1.1.0-1 - Uncommitted changes ## END: Generated by rpmautospec