%bcond_without openmpi %bcond_without check %global forgeurl https://github.com/cburstedde/libsc %global date 20230709 %global commit 83bd019fc9f029a9c15a3ae823e6d7d20e6e0340 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %forgemeta Name: libsc Version: 2.8.5 Release: %autorelease Summary: The sc Auxiliary Library # The library is under LGPL-2.0-or-later license, except: # The files under libb64/ directory are licensed unter the CC-PDDC license # The files under iniparser/ directory are licensed unter the MIT license License: LGPL-2.0-or-later AND CC-PDDC AND MIT URL: %{forgeurl} Source0: %{forgesource} # Remove builtin headers from install # use ${PROJECT_VERSION} and ${PROJECT_VERSION_MAJOR} to define API and ABI version # fix cmake config install path # fix cmake/pkgconf.pc.in file # Remove unneeded FindSC.cmake file # resolve symlink issue of the pkgconfig file Patch0: libsc-fix-cmake.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: zlib-devel BuildRequires: jansson-devel # https://github.com/ndevilla/iniparser Provides: bundled(iniparser) %description The sc library provides functions and data types that can be useful in scientific computing. It is part of the p4est project, which uses it extensively. Consequently, it is also a dependency of all projects that use p4est. Some of the more important features are the following: * The build system is based on the GNU autotools. Several macro files reside in the config/ subdirectory. These are used in sc but also available to other projects for convenience. It is possible to nest packages this way. * The library provides MPI wrappers in case it is configured without MPI. They implement initialize/finalize and collective calls as noops, which means that these do not have to be protected with the #ifdef SC_MPI construct in the code. * The library provides a logging framework that can be adapted by other packages. Multiple log levels are available, as well as options to output on just one or all MPI processes. * The library provides a set of data containers, such as dynamically resizable arrays. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %if %{with openmpi} %package openmpi Summary: OpenMPI version of %{name} BuildRequires: openmpi-devel Requires: openmpi%{?_isa} %description openmpi This package contains the %{name} library compiled against OpenMPI. %package openmpi-devel Summary: Development files for OpenMPI version of %{name} Requires: %{name}-openmpi%{?_isa} = %{version}-%{release} Requires: openmpi-devel%{?_isa} %description openmpi-devel This package contains the %{name} development library compiled against OpenMPI. %endif %prep %forgeautosetup -p1 %build OPTIONS=( -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -Dzlib=OFF \ -Dopenmp=ON \ -DCMAKE_SKIP_BUILD_RPATH=OFF \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ ) %global _vpath_builddir %{_target_platform} %cmake \ ${OPTIONS[@]} \ -Dmpi=OFF \ %cmake_build %if %{with openmpi} %{_openmpi_load} %global _vpath_builddir %{_target_platform}-openmpi %cmake \ ${OPTIONS[@]} \ -Dmpi=ON \ -DCMAKE_INSTALL_LIBDIR=${MPI_LIB} \ -DCMAKE_INSTALL_INCLUDEDIR=${MPI_INCLUDE} \ %cmake_build %{_openmpi_unload} %endif %install %global _vpath_builddir %{_target_platform} %cmake_install %if %{with openmpi} %{_openmpi_load} %global _vpath_builddir %{_target_platform}-openmpi %cmake_install %{_openmpi_unload} %endif rm -r %{buildroot}%{_datadir}/docs/SC %if %{with check} %check %global _vpath_builddir %{_target_platform} %ctest %if %{with openmpi} %{_openmpi_load} %global _vpath_builddir %{_target_platform}-openmpi %ctest %{_openmpi_unload} %endif %endif %files %license COPYING %doc README %{_libdir}/libsc.so.2* %files devel %{_includedir}/sc*.h %{_libdir}/libsc.so %dir %{_libdir}/cmake/SC %{_libdir}/cmake/SC/*.cmake %{_libdir}/pkgconfig/libsc-%{version}.pc %{_libdir}/pkgconfig/libsc.pc %if %{with openmpi} %files openmpi %license COPYING %doc README %{_libdir}/openmpi/lib/libsc.so.2* %files openmpi-devel %{_includedir}/openmpi-%{_arch}/sc*.h %{_libdir}/openmpi/lib/libsc.so %{_libdir}/openmpi/lib/cmake/SC/ %{_libdir}/openmpi/lib/pkgconfig/libsc-%{version}.pc %{_libdir}/openmpi/lib/pkgconfig/libsc.pc %endif %changelog %autochangelog