From 46d2cd6d1e48ef3c37402c622430a3f2a428fd82 Mon Sep 17 00:00:00 2001 From: David Schwörer Date: Aug 16 2020 16:34:56 +0000 Subject: Enable sundials and petsc and switch to flexiblas --- diff --git a/bout++.spec b/bout++.spec index f1782f0..f91d8e5 100644 --- a/bout++.spec +++ b/bout++.spec @@ -1,6 +1,6 @@ Name: bout++ Version: 4.3.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library for the BOUndary Turbulence simulation framework # BOUT++ itself is LGPL, but we are linking with GPLed code, so the distributed library is GPL @@ -11,13 +11,26 @@ Source0: https://github.com/boutproject/BOUT-dev/releases/download/v%{ver # Do not install mpark Patch0: remove-mpark.patch +%if 0%{?fedora} >= 33 +%global blaslib flexiblas +%global blasvar %{nil} +%else +%global blaslib openblas +%global blasvar p +%endif + + # Disable tests and manual on epel < 8 %if 0%{?rhel} && 0%{?rhel} < 8 %bcond_with manual %bcond_with test +%bcond_with sundials +%bcond_with petsc %else %bcond_without manual %bcond_without test +%bcond_without sundials +%bcond_without petsc %endif # Enable both mpi every where @@ -59,7 +72,7 @@ BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-Cython BuildRequires: python%{python3_pkgversion}-netcdf4 BuildRequires: python%{python3_pkgversion}-scipy -BuildRequires: blas-devel +BuildRequires: %{blaslib}-devel BuildRequires: lapack-devel BuildRequires: gcc-c++ %if %{with system_mpark} @@ -72,7 +85,24 @@ BuildRequires: python%{python3_pkgversion}-jinja2 BuildRequires: doxygen BuildRequires: python3-sphinx %endif - +%if %{with petsc} && %{with mpich} +BuildRequires: petsc-mpich-devel +BuildRequires: hdf5-mpich-devel +%endif +%if %{with petsc} && %{with openmpi} +BuildRequires: petsc-openmpi-devel +BuildRequires: hdf5-openmpi-devel +%endif +%if %{with sundials} && %{with mpich} +BuildRequires: sundials-mpich-devel +# https://bugzilla.redhat.com/show_bug.cgi?id=1839131 +BuildRequires: sundials-devel +%endif +%if %{with sundials} && %{with openmpi} +BuildRequires: sundials-openmpi-devel +# https://bugzilla.redhat.com/show_bug.cgi?id=1839131 +BuildRequires: sundials-devel +%endif # # DESCRIPTIONS @@ -276,12 +306,6 @@ autoreconf # %build -%global configure_opts \\\ - --with-netcdf \\\ - --with-hdf5 \\\ - --enable-shared - -%{nil} # MPI builds export CC=mpicc @@ -304,12 +328,27 @@ do exit 1 fi - %configure %{configure_opts} \ + %configure \ + --with-netcdf \ + --with-hdf5 \ + --enable-shared \ --libdir=%{_libdir}/$mpi/lib \ --bindir=%{_libdir}/$mpi/bin \ --sbindir=%{_libdir}/$mpi/sbin \ --includedir=%{_includedir}/$mpi-%{_arch} \ - --datarootdir=%{_datadir} + --datarootdir=%{_datadir} \ +%if %{with petsc} + --with-petsc \ +%endif +%if %{with sundials} + --with-sundials \ +%endif + + sed -e "s| -L%{_libdir} | |g" \ + -e 's|@$(LD)|$(LD)|' \ + -e 's| -lblas | -l%{blaslib} |g' \ + -i make.config + cat make.config make %{?_smp_mflags} shared python export LD_LIBRARY_PATH=$(pwd)/lib @@ -487,6 +526,10 @@ done # %changelog +* Sat Aug 15 2020 David Schwörer 4.3.1-6 +- Enable sundials and petsc +- Rebuild with flexiblas + * Sat Aug 08 2020 David Schwörer - 4.3.1-5 - Disable lto for s390x