%global sover 25 %bcond_without openmpi %bcond_without mpich %global forgeurl https://github.com/gismo/gismo Version: 25.07.0 %forgemeta Name: gismo Release: %autorelease Summary: A C++ library for isogeometric analysis (IGA) License: MPL-2.0 URL: %{forgeurl} Source0: %{forgesource} Patch0: https://topazus.fedorapeople.org/gismo-25.07.0-fix.patch # stat(lib/libgismo.a): Value too large for defined data type. ExcludeArch: %{ix86} BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: SuperLU-devel BuildRequires: suitesparse-devel BuildRequires: flexiblas-devel BuildRequires: metis-devel %description G+Smo (Geometry + Simulation Modules, pronounced "gismo") is an open-source C++ library that brings together mathematical tools for geometric design and numerical simulation. It implements the relatively new paradigm of isogeometric analysis, which suggests the use of a unified framework in the design and analysis pipeline. G+Smo is an object-oriented, cross-platform, template C++ library and follows the generic programming principle, with a focus on both efficiency and ease of use. The library aims at providing access to high quality, open-source software to the forming isogeometric numerical simulation community and beyond. %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}. %package examples Summary: Example files of %{name} %description examples The %{name}-examples package contains example files of %{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 %if %{with mpich} %package mpich Summary: MPICH version of %{name} BuildRequires: mpich-devel Requires: mpich%{?_isa} %description mpich This package contains the %{name} library compiled against MPICH. %package mpich-devel Summary: Development libraries for MPICH version of %{name} Requires: %{name}-mpich%{?_isa} = %{version}-%{release} Requires: mpich-devel%{?_isa} %description mpich-devel This package contains the %{name} development library compiled against MPICH. %endif %prep %forgeautosetup -p1 sed -i 's/SuperLU/superlu/' CMakeLists.txt sed -i 's|${SUPERLU_INCLUDES}|/usr/include/SuperLU|' CMakeLists.txt sed -i 's|${SUPERLU_LIBRARIES}|superlu::superlu|' cmake/gsLibrary.cmake cat cmake/gsLibrary.cmake %build OPTIONS=( -GNinja \ -DGISMO_BUILD_UNITTESTS=OFF \ -DGISMO_PLUGIN_AXL=OFF \ -DGISMO_WITH_PSOLID=OFF \ -DTARGET_ARCHITECTURE=none \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DGISMO_WITH_SUPERLU=ON \ -DGISMO_WITH_UMFPACK=ON \ ) %global _vpath_builddir %{_target_platform} %cmake \ ${OPTIONS[@]} \ -DGISMO_BUILD_EXAMPLES=ON \ -DLIB_INSTALL_DIR=%{_libdir} \ -DBIN_INSTALL_DIR=%{_bindir} \ -DINCLUDE_INSTALL_DIR=%{_includedir} \ -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/gismo \ %cmake_build %if %{with openmpi} %{_openmpi_load} %global _vpath_builddir %{_target_platform}-openmpi %cmake \ ${OPTIONS[@]} \ -DGISMO_BUILD_EXAMPLES=OFF \ -DLIB_INSTALL_DIR=${MPI_LIB} \ -DBIN_INSTALL_DIR=%${MPI_BIN} \ -DINCLUDE_INSTALL_DIR=${MPI_INCLUDE} \ -DCMAKE_INSTALL_DIR=${MPI_LIB}/cmake/gismo \ -DGISMO_WITH_MPI=ON \ %cmake_build %{_openmpi_unload} %endif %if %{with mpich} %{_mpich_load} %global _vpath_builddir %{_target_platform}-mpich %cmake \ ${OPTIONS[@]} \ -DGISMO_BUILD_EXAMPLES=OFF \ -DLIB_INSTALL_DIR=${MPI_LIB} \ -DBIN_INSTALL_DIR=%${MPI_BIN} \ -DINCLUDE_INSTALL_DIR=${MPI_INCLUDE} \ -DCMAKE_INSTALL_DIR=${MPI_LIB}/cmake/gismo \ -DGISMO_WITH_MPI=ON \ %cmake_build %{_mpich_unload} %endif %install %global _vpath_builddir %{_target_platform} %cmake_install rm %{buildroot}%{_libdir}/libgismo.a rm %{buildroot}%{_libdir}/cmake/gismo/*.{txt,cxx} rm -rf %{buildroot}%{_includedir}/{UnitTest++,unittests} #rm %{buildroot}%{_prefix}/lib/libUnitTestPP.a %if %{with openmpi} %{_openmpi_load} %global _vpath_builddir %{_target_platform}-openmpi %cmake_install rm %{buildroot}${MPI_LIB}/libgismo.a rm %{buildroot}${MPI_LIB}/cmake/gismo/*.{txt,cxx} rm -rf %{buildroot}${MPI_INCLUDE}/{UnitTest++,unittests} %{_openmpi_unload} %endif %if %{with mpich} %{_mpich_load} %global _vpath_builddir %{_target_platform}-mpich %cmake_install rm %{buildroot}${MPI_LIB}/libgismo.a rm %{buildroot}${MPI_LIB}/cmake/gismo/*.{txt,cxx} rm -rf %{buildroot}${MPI_INCLUDE}/{UnitTest++,unittests} %{_mpich_unload} %endif %check %global _vpath_builddir %{_target_platform} %ctest %if %{with openmpi} %{_openmpi_load} %global _vpath_builddir %{_target_platform}-openmpi %ctest %{_openmpi_unload} %endif %if %{with mpich} %{_mpich_load} %global _vpath_builddir %{_target_platform}-mpich %ctest %{_mpich_unload} %endif %files %license COPYRIGHT.txt %doc README.md %{_libdir}/libgismo.so.%{sover}* %files devel %{_includedir}/gismo/ %{_libdir}/libgismo.so %{_libdir}/cmake/gismo/ %files examples %{_bindir}/*_example %{_bindir}/fitting_mspline %{_bindir}/gsExpressions_test %{_bindir}/patches_from_mesh %{_bindir}/constrained_fitting %{_bindir}/gsInterpolateMap %{_bindir}/gsMakeMultiPatch %{_bindir}/gsPatchFromBoundary %{_bindir}/gsView %{_datadir}/gismodata/ %if %{with openmpi} %files openmpi %license COPYRIGHT.txt %doc README.md %{_libdir}/openmpi/lib/libgismo.so.%{sover}* %files openmpi-devel %{_includedir}/openmpi-%{_arch}/gismo/ %{_libdir}/openmpi/lib/cmake/gismo/ %{_libdir}/openmpi/lib/libgismo.so %endif %if %{with mpich} %files mpich %license COPYRIGHT.txt %doc README.md %{_libdir}/mpich/lib/libgismo.so.%{sover} %files mpich-devel %{_includedir}/mpich-%{_arch}/gismo/ %{_libdir}/mpich/lib/cmake/gismo/ %{_libdir}/mpich/lib/libgismo.so %endif %changelog %autochangelog