davidsch / rpms / bout++

Forked from rpms/bout++ 2 years ago
Clone
David Schwörer 86b481b
Name:           bout++
David 7f55e43
Version:        4.3.2
David 7f55e43
Release:        1%{?dist}
David Schwörer 86b481b
Summary:        Library for the BOUndary Turbulence simulation framework
David Schwörer 86b481b
David Schwörer 86b481b
# BOUT++ itself is LGPL, but we are linking with GPLed code, so the distributed library is GPL
David Schwörer 86b481b
License:        GPLv3+
David Schwörer 86b481b
URL:            https://boutproject.github.io/
David Schwörer 86b481b
Source0:        https://github.com/boutproject/BOUT-dev/releases/download/v%{version}/BOUT++-v%{version}.tar.gz
David Schwörer 86b481b
David Schwörer 46d2cd6
%if 0%{?fedora} >= 33
36095c3
%bcond_without flexiblas
David Schwörer 7aabb6f
%else
David Schwörer 7aabb6f
%bcond_with flexiblas
David Schwörer 46d2cd6
%endif
David Schwörer 46d2cd6
David Schwörer 86b481b
# Disable tests and manual on epel < 8
David Schwörer 86b481b
%if 0%{?rhel} && 0%{?rhel} < 8
David Schwörer 86b481b
%bcond_with manual
David Schwörer 86b481b
%bcond_with test
David Schwörer 46d2cd6
%bcond_with sundials
David Schwörer 46d2cd6
%bcond_with petsc
David Schwörer 86b481b
%else
David Schwörer 86b481b
%bcond_without manual
David Schwörer 86b481b
%bcond_without test
David Schwörer 46d2cd6
%bcond_without sundials
David Schwörer 46d2cd6
%bcond_without petsc
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer ac269ff
# Enable both mpi every where
David Schwörer 86b481b
%bcond_without mpich
David Schwörer 86b481b
%bcond_without openmpi
David Schwörer ac269ff
David Schwörer 86b481b
# Enable weak dependencies
David Schwörer 86b481b
%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} > 7 )
David Schwörer 86b481b
%bcond_without recommend
David Schwörer 86b481b
%else
David Schwörer 86b481b
%bcond_with recommend
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} > 7 )
David Schwörer 86b481b
# Use system mpark
David Schwörer 86b481b
%bcond_without system_mpark
David Schwörer 86b481b
%else
David Schwörer 86b481b
%bcond_with system_mpark
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
#
David Schwörer 86b481b
#           DEPENDENCIES
David Schwörer 86b481b
#
David Schwörer 86b481b
David Schwörer 86b481b
BuildRequires:  m4
David Schwörer 86b481b
BuildRequires:  zlib-devel
David Schwörer 86b481b
BuildRequires:  autoconf
David Schwörer 86b481b
BuildRequires:  autoconf-archive
David Schwörer 86b481b
BuildRequires:  gettext-devel
David Schwörer 86b481b
BuildRequires:  automake
David Schwörer 86b481b
BuildRequires:  environment-modules
David Schwörer 86b481b
BuildRequires:  netcdf-devel
David Schwörer 86b481b
BuildRequires:  netcdf-cxx%{?fedora:4}-devel
David Schwörer 86b481b
BuildRequires:  hdf5-devel
David Schwörer 86b481b
BuildRequires:  fftw-devel
David Schwörer 86b481b
BuildRequires:  make
David Schwörer 86b481b
BuildRequires:  python%{python3_pkgversion}
David Schwörer 86b481b
BuildRequires:  python%{python3_pkgversion}-numpy
David Schwörer 86b481b
BuildRequires:  python%{python3_pkgversion}-Cython
David Schwörer 86b481b
BuildRequires:  python%{python3_pkgversion}-netcdf4
David Schwörer 86b481b
BuildRequires:  python%{python3_pkgversion}-scipy
36095c3
%if %{with flexiblas}
36095c3
BuildRequires:  flexiblas-devel
36095c3
%else
David Schwörer 7aabb6f
BuildRequires:  blas-devel
David Schwörer 7aabb6f
BuildRequires:  lapack-devel
36095c3
%endif
David Schwörer 86b481b
BuildRequires:  gcc-c++
David Schwörer 86b481b
%if %{with system_mpark}
David Schwörer 86b481b
BuildRequires:  mpark-variant-devel
David Schwörer 86b481b
%endif
David Schwörer 86b481b
# cxx generation
David Schwörer 86b481b
BuildRequires:  python%{python3_pkgversion}-jinja2
David Schwörer 86b481b
# Documentation
David Schwörer 86b481b
%if %{with manual}
David Schwörer 86b481b
BuildRequires:  doxygen
David Schwörer 86b481b
BuildRequires:  python3-sphinx
David Schwörer 86b481b
%endif
David Schwörer 46d2cd6
%if %{with petsc} && %{with mpich}
David Schwörer 46d2cd6
BuildRequires: petsc-mpich-devel
David Schwörer 46d2cd6
BuildRequires: hdf5-mpich-devel
David Schwörer 46d2cd6
%endif
David Schwörer 46d2cd6
%if %{with petsc} && %{with openmpi}
David Schwörer 46d2cd6
BuildRequires: petsc-openmpi-devel
David Schwörer 46d2cd6
BuildRequires: hdf5-openmpi-devel
David Schwörer 46d2cd6
%endif
David Schwörer 46d2cd6
%if %{with sundials} && %{with mpich}
David Schwörer 46d2cd6
BuildRequires: sundials-mpich-devel
David Schwörer 46d2cd6
# https://bugzilla.redhat.com/show_bug.cgi?id=1839131
David Schwörer 46d2cd6
BuildRequires: sundials-devel
David Schwörer 46d2cd6
%endif
David Schwörer 46d2cd6
%if %{with sundials} && %{with openmpi}
David Schwörer 46d2cd6
BuildRequires: sundials-openmpi-devel
David Schwörer 46d2cd6
# https://bugzilla.redhat.com/show_bug.cgi?id=1839131
David Schwörer 46d2cd6
BuildRequires: sundials-devel
David Schwörer 46d2cd6
%endif
David Schwörer 86b481b
David Schwörer 86b481b
#
David Schwörer 86b481b
#           DESCRIPTIONS
David Schwörer 86b481b
#
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with mpich}
David Schwörer 86b481b
BuildRequires:  mpich-devel
David Schwörer 86b481b
%global mpi_list mpich
David Schwörer 86b481b
%endif
David Schwörer 86b481b
%if %{with openmpi}
David Schwörer 86b481b
BuildRequires:  openmpi-devel
David Schwörer 86b481b
%global mpi_list %{?mpi_list} openmpi
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
%description
David Schwörer 86b481b
BOUT++ is a framework for writing fluid and plasma simulations in
David Schwörer 86b481b
curvilinear geometry. It is intended to be quite modular, with a
David Schwörer 86b481b
variety of numerical methods and time-integration solvers available.
David Schwörer 86b481b
BOUT++ is primarily designed and tested with reduced plasma fluid
David Schwörer 86b481b
models in mind, but it can evolve any number of equations, with
David Schwörer 86b481b
equations appearing in a readable form.
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with mpich}
David Schwörer 86b481b
%package mpich
David Schwörer 86b481b
Summary: BOUT++ mpich libraries
David Schwörer 86b481b
Requires: %{name}-common = %{version}-%{release}
David Schwörer 86b481b
# Use bundled version, to reproduce upstream results
David Schwörer 86b481b
Provides: bundled(libpvode)
David Schwörer 86b481b
%if %{with recommend}
David Schwörer 86b481b
Recommends: environment-modules
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
%package mpich-devel
David Schwörer 86b481b
Summary: BOUT++ mpich libraries
David 7f55e43
Requires:  %{name}-mpich = %{version}-%{release}
David 7f55e43
Recommends:  gcc-c++
David 7f55e43
Recommends:  make
David 7f55e43
Recommends:  mpich-devel
David 7f55e43
Recommends:  zlib-devel
David 7f55e43
Recommends:  gettext-devel
David 7f55e43
Recommends:  netcdf-devel
David 7f55e43
Recommends:  netcdf-cxx%{?fedora:4}-devel
David 7f55e43
Recommends:  hdf5-devel
David 7f55e43
Recommends:  fftw-devel
David 7f55e43
%if %{with flexiblas}
David 7f55e43
Recommends:  flexiblas-devel
David 7f55e43
%else
David 7f55e43
Recommends:  blas-devel
David 7f55e43
Recommends:  lapack-devel
David 7f55e43
%endif
David 7f55e43
%if %{with system_mpark}
David 7f55e43
Recommends:  mpark-variant-devel
David 7f55e43
%endif
David 7f55e43
%if %{with petsc}
David 7f55e43
Recommends:  petsc-mpich-devel
David 7f55e43
Recommends:  hdf5-mpich-devel
David 7f55e43
%endif
David 7f55e43
%if %{with sundials}
David 7f55e43
Recommends:  sundials-mpich-devel
David 7f55e43
# https://bugzilla.redhat.com/show_bug.cgi?id=1839131
David 7f55e43
Recommends:  sundials-devel
David 7f55e43
%endif
David 7f55e43
David Schwörer 86b481b
David Schwörer 86b481b
%description mpich-devel
David Schwörer 86b481b
BOUT++ is a framework for writing fluid and plasma simulations in
David Schwörer 86b481b
curvilinear geometry. It is intended to be quite modular, with a
David Schwörer 86b481b
variety of numerical methods and time-integration solvers available.
David Schwörer 86b481b
BOUT++ is primarily designed and tested with reduced plasma fluid
David Schwörer 86b481b
models in mind, but it can evolve any number of equations, with
David Schwörer 86b481b
equations appearing in a readable form.
David Schwörer 86b481b
David Schwörer 86b481b
This BOUT++ library is build for mpich.
David Schwörer 86b481b
David Schwörer 86b481b
%description mpich
David Schwörer 86b481b
BOUT++ is a framework for writing fluid and plasma simulations in
David Schwörer 86b481b
curvilinear geometry. It is intended to be quite modular, with a
David Schwörer 86b481b
variety of numerical methods and time-integration solvers available.
David Schwörer 86b481b
BOUT++ is primarily designed and tested with reduced plasma fluid
David Schwörer 86b481b
models in mind, but it can evolve any number of equations, with
David Schwörer 86b481b
equations appearing in a readable form.
David Schwörer 86b481b
David Schwörer 86b481b
This BOUT++ library is build for mpich.
David Schwörer 86b481b
David Schwörer 86b481b
%package -n python%{python3_pkgversion}-%{name}-mpich
David Schwörer 86b481b
Summary:  BOUT++ mpich library for python%{python3_pkgversion}
David Schwörer 86b481b
Requires: %{name}-mpich
David Schwörer 86b481b
Requires: python%{python3_pkgversion}-%{name}
David Schwörer 86b481b
BuildRequires: python%{python3_pkgversion}-devel
David Schwörer 86b481b
Requires: mpich
David Schwörer 86b481b
Requires: python%{python3_pkgversion}-mpich
David Schwörer 86b481b
Requires: python%{python3_pkgversion}-numpy
David Schwörer 86b481b
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-mpich}
David Schwörer 86b481b
%description  -n python%{python3_pkgversion}-%{name}-mpich
David Schwörer 86b481b
This is the BOUT++ library python%{python3_pkgversion} with mpich.
David Schwörer 86b481b
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with openmpi}
David Schwörer 86b481b
%package openmpi
David Schwörer 86b481b
Summary: BOUT++ openmpi libraries
David Schwörer 86b481b
# Use bundled version, to reproduce upstream results
David Schwörer 86b481b
Provides: bundled(libpvode)
David Schwörer 86b481b
Requires: %{name}-common = %{version}-%{release}
David Schwörer 86b481b
%if %{with recommend}
David Schwörer 86b481b
Recommends: environment-modules
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
%package openmpi-devel
David Schwörer 86b481b
Summary: BOUT++ openmpi libraries
David Schwörer 86b481b
Requires: %{name}-openmpi = %{version}-%{release}
David 7f55e43
Recommends:  gcc-c++
David 7f55e43
Recommends:  make
David 7f55e43
Recommends:  openmpi-devel
David 7f55e43
Recommends:  zlib-devel
David 7f55e43
Recommends:  gettext-devel
David 7f55e43
Recommends:  netcdf-devel
David 7f55e43
Recommends:  netcdf-cxx%{?fedora:4}-devel
David 7f55e43
Recommends:  hdf5-devel
David 7f55e43
Recommends:  fftw-devel
David 7f55e43
%if %{with flexiblas}
David 7f55e43
Recommends:  flexiblas-devel
David 7f55e43
%else
David 7f55e43
Recommends:  blas-devel
David 7f55e43
Recommends:  lapack-devel
David 7f55e43
%endif
David 7f55e43
%if %{with system_mpark}
David 7f55e43
Recommends:  mpark-variant-devel
David 7f55e43
%endif
David 7f55e43
%if %{with petsc}
David 7f55e43
Recommends:  petsc-openmpi-devel
David 7f55e43
Recommends:  hdf5-openmpi-devel
David 7f55e43
%endif
David 7f55e43
%if %{with sundials}
David 7f55e43
Recommends:  sundials-openmpi-devel
David 7f55e43
# https://bugzilla.redhat.com/show_bug.cgi?id=1839131
David 7f55e43
Recommends:  sundials-devel
David 7f55e43
%endif
David 7f55e43
David 7f55e43
David Schwörer 86b481b
David Schwörer 86b481b
%description openmpi-devel
David Schwörer 86b481b
BOUT++ is a framework for writing fluid and plasma simulations in
David Schwörer 86b481b
curvilinear geometry. It is intended to be quite modular, with a
David Schwörer 86b481b
variety of numerical methods and time-integration solvers available.
David Schwörer 86b481b
BOUT++ is primarily designed and tested with reduced plasma fluid
David Schwörer 86b481b
models in mind, but it can evolve any number of equations, with
David Schwörer 86b481b
equations appearing in a readable form.
David Schwörer 86b481b
David Schwörer 86b481b
This BOUT++ library is build for openmpi and provides the required
David Schwörer 86b481b
header files.
David Schwörer 86b481b
David Schwörer 86b481b
%description openmpi
David Schwörer 86b481b
BOUT++ is a framework for writing fluid and plasma simulations in
David Schwörer 86b481b
curvilinear geometry. It is intended to be quite modular, with a
David Schwörer 86b481b
variety of numerical methods and time-integration solvers available.
David Schwörer 86b481b
BOUT++ is primarily designed and tested with reduced plasma fluid
David Schwörer 86b481b
models in mind, but it can evolve any number of equations, with
David Schwörer 86b481b
equations appearing in a readable form.
David Schwörer 86b481b
David Schwörer 86b481b
This BOUT++ library is build for openmpi.
David Schwörer 86b481b
David Schwörer 86b481b
%package -n python%{python3_pkgversion}-%{name}-openmpi
David Schwörer 86b481b
Summary:  BOUT++ openmpi library for python%{python3_pkgversion}
David Schwörer 86b481b
Requires: %{name}-openmpi
David Schwörer 86b481b
Requires: python%{python3_pkgversion}-%{name}
David Schwörer 86b481b
BuildRequires: python%{python3_pkgversion}-devel
David Schwörer 86b481b
Requires: openmpi
David Schwörer 86b481b
Requires: python%{python3_pkgversion}-openmpi
David Schwörer 86b481b
Requires: python%{python3_pkgversion}-numpy
David Schwörer 86b481b
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-openmpi}
David Schwörer 86b481b
David Schwörer 86b481b
%description  -n python%{python3_pkgversion}-%{name}-openmpi
David Schwörer 86b481b
This is the BOUT++ library python%{python3_pkgversion} with openmpi.
David Schwörer 86b481b
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
%package common
David Schwörer 86b481b
Summary: Common files for BOUT++
David Schwörer 86b481b
%description common
David Schwörer 86b481b
MPI-independent files for BOUT++, namely localisation files.
David Schwörer 86b481b
David Schwörer 86b481b
%package -n python%{python3_pkgversion}-%{name}
David Schwörer 86b481b
Summary: BOUT++ python library
David Schwörer 86b481b
Requires: netcdf4-python%{python3_pkgversion}
David Schwörer 86b481b
Requires: python%{python3_pkgversion}-numpy
David Schwörer 86b481b
%if %{with recommend}
David Schwörer 86b481b
Recommends: python%{python3_pkgversion}-scipy
David Schwörer 86b481b
Recommends: python%{python3_pkgversion}-matplotlib
David Schwörer 86b481b
%endif
David Schwörer 86b481b
BuildArch: noarch
David Schwörer 86b481b
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
David 7f55e43
Provides:  python%{python3_pkgversion}-boututils
David 7f55e43
Provides:  python%{python3_pkgversion}-boutdata
David 7f55e43
Provides:  python%{python3_pkgversion}-bout_runners
David 7f55e43
Provides:  python%{python3_pkgversion}-zoidberg
David 7f55e43
%{?python_provide:%python_provide python%{python3_pkgversion}-bout_runners}
David 7f55e43
%{?python_provide:%python_provide python%{python3_pkgversion}-boututils}
David 7f55e43
%{?python_provide:%python_provide python%{python3_pkgversion}-boutdata}
David 7f55e43
%{?python_provide:%python_provide python%{python3_pkgversion}-zoidberg}
David Schwörer 86b481b
David Schwörer 86b481b
%description -n python%{python3_pkgversion}-%{name}
David Schwörer 86b481b
Python%{python3_pkgversion} library for pre and post processing of BOUT++ data
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with manual}
David Schwörer 86b481b
%package -n %{name}-doc
David Schwörer 86b481b
Summary: BOUT++ Documentation
David Schwörer 86b481b
BuildArch: noarch
David Schwörer 86b481b
David Schwörer 86b481b
%description -n %{name}-doc
David Schwörer 86b481b
BOUT++ is a framework for writing fluid and plasma simulations in
David Schwörer 86b481b
curvilinear geometry. It is intended to be quite modular, with a
David Schwörer 86b481b
variety of numerical methods and time-integration solvers available.
David Schwörer 86b481b
BOUT++ is primarily designed and tested with reduced plasma fluid
David Schwörer 86b481b
models in mind, but it can evolve any number of equations, with
David Schwörer 86b481b
equations appearing in a readable form.
David Schwörer 86b481b
David Schwörer 86b481b
This package contains the documentation.
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
#
David Schwörer 86b481b
#           PREP
David Schwörer 86b481b
#
David Schwörer 86b481b
David Schwörer 86b481b
%prep
David Schwörer 86b481b
%setup -q -n BOUT++-v%{version}
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with system_mpark}
David Schwörer 86b481b
# use mpark provided by fedora
David Schwörer 86b481b
rm -rf externalpackages/mpark.variant/
David Schwörer 86b481b
mkdir -p externalpackages/mpark.variant/include/
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
# Remove shebang
David Schwörer 86b481b
for f in $(find -L tools/pylib/ -type f | grep -v _boutcore_build )
David Schwörer 86b481b
do
David Schwörer 86b481b
    sed -i '/^#!\//d' $f
David Schwörer 86b481b
done
David Schwörer 86b481b
David Schwörer 86b481b
autoreconf
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
#
David Schwörer 86b481b
#           BUILD
David Schwörer 86b481b
#
David Schwörer 86b481b
David Schwörer 86b481b
%build
David Schwörer 86b481b
David Schwörer 86b481b
# MPI builds
David Schwörer 86b481b
export CC=mpicc
David Schwörer 86b481b
export CXX=mpicxx
David Schwörer 86b481b
David Schwörer 86b481b
for mpi in %{mpi_list}
David Schwörer 86b481b
do
David Schwörer 86b481b
  mkdir build_$mpi
David Schwörer 86b481b
  cp -al [^b]* build-aux bin build_$mpi
David Schwörer 86b481b
done
David Schwörer 86b481b
for mpi in %{mpi_list}
David Schwörer 86b481b
do
David Schwörer 86b481b
  pushd build_$mpi
David Schwörer 86b481b
  if [ $mpi = mpich ] ; then
David Schwörer 86b481b
      %_mpich_load
David Schwörer 86b481b
  elif [ $mpi = openmpi ] ; then
David Schwörer 86b481b
      %_openmpi_load
David Schwörer 86b481b
  else
David Schwörer 86b481b
      echo "unknown mpi" &> /dev/stderr
David Schwörer 86b481b
      exit 1
David Schwörer 86b481b
  fi
David Schwörer 86b481b
David Schwörer 46d2cd6
  %configure \
David Schwörer 46d2cd6
	     --with-netcdf \
David Schwörer 46d2cd6
             --with-hdf5 \
David Schwörer 46d2cd6
             --enable-shared \
David 7f55e43
	     --with-system-mpark \
David Schwörer 86b481b
    --libdir=%{_libdir}/$mpi/lib \
David Schwörer 86b481b
    --bindir=%{_libdir}/$mpi/bin \
David Schwörer 86b481b
    --sbindir=%{_libdir}/$mpi/sbin \
David Schwörer 86b481b
    --includedir=%{_includedir}/$mpi-%{_arch} \
David Schwörer 46d2cd6
    --datarootdir=%{_datadir} \
David Schwörer 46d2cd6
%if %{with petsc}
David Schwörer 46d2cd6
           --with-petsc \
David Schwörer 46d2cd6
%endif
David Schwörer 46d2cd6
%if %{with sundials}
David Schwörer 46d2cd6
           --with-sundials \
David Schwörer 46d2cd6
%endif
David Schwörer 46d2cd6
David Schwörer 46d2cd6
  sed -e "s| -L%{_libdir} | |g" \
David 7f55e43
      -e "s| -Wl,--as-needed | |g" \
David Schwörer 46d2cd6
      -i make.config
David Schwörer 7aabb6f
David 7f55e43
  # Debug linking issues:
David 7f55e43
  # -e 's|@$(LD)|$(LD)|'  \
David 7f55e43
David Schwörer 7aabb6f
  %if %{with flexiblas}
David Schwörer 7aabb6f
  sed -e 's|-lblas|-lflexiblas|g' \
David Schwörer 7aabb6f
      -e 's|-llapack|-lflexiblas|g' \
David Schwörer 7aabb6f
      -i make.config
David Schwörer 7aabb6f
  %endif
David Schwörer 46d2cd6
  cat make.config
David Schwörer 86b481b
David Schwörer 86b481b
  make %{?_smp_mflags} shared python
David Schwörer 86b481b
  export LD_LIBRARY_PATH=$(pwd)/lib
David Schwörer 86b481b
  %if %{with manual}
David Schwörer 86b481b
  make %{?_smp_mflags} -C manual html
David Schwörer 86b481b
  %endif
David Schwörer 86b481b
  if [ $mpi = mpich ] ; then
David Schwörer 86b481b
      %_mpich_unload
David Schwörer 86b481b
  elif [ $mpi = openmpi ] ; then
David Schwörer 86b481b
      %_openmpi_unload
David Schwörer 86b481b
  fi
David Schwörer 86b481b
  popd
David Schwörer 86b481b
done
David Schwörer 86b481b
David Schwörer 86b481b
#
David Schwörer 86b481b
#           INSTALL
David Schwörer 86b481b
#
David Schwörer 86b481b
David Schwörer 86b481b
%install
David Schwörer 86b481b
David Schwörer 86b481b
for mpi in %{mpi_list}
David Schwörer 86b481b
do
David Schwörer 86b481b
  pushd build_$mpi
David Schwörer 86b481b
  if [ $mpi = mpich ] ; then
David Schwörer 86b481b
      %_mpich_load
David Schwörer 86b481b
  else
David Schwörer 86b481b
      %_openmpi_load
David Schwörer 86b481b
  fi
David Schwörer 86b481b
  make install DESTDIR=${RPM_BUILD_ROOT}
David Schwörer 86b481b
David Schwörer 86b481b
  # mark this as a released version, to disable compiling the library
David 7f55e43
  sed -i '27 i RELEASED                 = %{version}-%{release}' ${RPM_BUILD_ROOT}/%{_includedir}/${mpi}-%{_arch}/bout++/make.config
David Schwörer 86b481b
David Schwörer 86b481b
  rm -rf  ${RPM_BUILD_ROOT}/usr/share/bout++
David Schwörer 86b481b
  rm -f ${RPM_BUILD_ROOT}/%{_libdir}/${mpi}/lib/*.a
David Schwörer 86b481b
David Schwörer 86b481b
  install lib/*.so.* ${RPM_BUILD_ROOT}/%{_libdir}/${mpi}/lib/
David Schwörer 86b481b
  pushd ${RPM_BUILD_ROOT}/%{_libdir}/${mpi}/lib/
David Schwörer 86b481b
  for f in *.so.*
David Schwörer 86b481b
  do
David Schwörer 86b481b
      ln -s $f ${f%%.so*}.so
David Schwörer 86b481b
  done
David Schwörer 86b481b
  popd
David Schwörer 86b481b
  popd
David 7f55e43
  mkdir -p ${RPM_BUILD_ROOT}/usr/share/modulefiles/bout++
David 7f55e43
  cat > ${RPM_BUILD_ROOT}/usr/share/modulefiles/bout++/$MPI_COMPILER <
David 7f55e43
#%Module 1.0
David 7f55e43
#
David 7f55e43
#  BOUT++ module for use with 'environment-modules' package
David 7f55e43
#  Created by bout-add-mod-path v0.9
David 7f55e43
# Only allow one bout++ module to be loaded at a time
David 7f55e43
conflict bout++
David 7f55e43
# Require mpi
David 7f55e43
prereq mpi/$MPI_COMPILER
David 7f55e43
David 7f55e43
setenv    BOUT_TOP   $MPI_INCLUDE/bout++/
David 7f55e43
EOF
David 7f55e43
David Schwörer 86b481b
  if [ $mpi = mpich ] ; then
David Schwörer 86b481b
      %_mpich_unload
David Schwörer 86b481b
  else
David Schwörer 86b481b
      %_openmpi_unload
David Schwörer 86b481b
  fi
David Schwörer 86b481b
done
David Schwörer 86b481b
David Schwörer 86b481b
# install python libraries
David Schwörer 86b481b
pushd tools/pylib
David 7f55e43
for d in boutdata bout_runners boututils zoidberg
David Schwörer 86b481b
do
David Schwörer 86b481b
    mkdir -p ${RPM_BUILD_ROOT}/%{python3_sitelib}/$d
David Schwörer 86b481b
    cp $d/*py ${RPM_BUILD_ROOT}/%{python3_sitelib}/$d/
David Schwörer 86b481b
done
David Schwörer 86b481b
popd
David Schwörer 86b481b
David Schwörer 86b481b
# install manual
David Schwörer 86b481b
%if %{with manual}
David Schwörer 86b481b
mandir=$(ls build_*/manual -d|head -n1)
David Schwörer 86b481b
mkdir -p ${RPM_BUILD_ROOT}/%{_defaultdocdir}/bout++/
David Schwörer 86b481b
rm -rf $mandir/html/.buildinfo
David Schwörer 86b481b
rm -rf $mandir/html/.doctrees
David Schwörer 86b481b
rm -rf $mandir/html/_sources
David Schwörer 86b481b
cp -r $mandir/html ${RPM_BUILD_ROOT}/%{_defaultdocdir}/bout++/
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
# install boutcore library
David Schwörer 86b481b
for mpi in %{mpi_list}
David Schwörer 86b481b
do
David Schwörer 86b481b
    mkdir -p ${RPM_BUILD_ROOT}/%{python3_sitearch}/${mpi}/
David Schwörer 86b481b
    install build_$mpi/tools/pylib/boutcore.*.so ${RPM_BUILD_ROOT}/%{python3_sitearch}/${mpi}/
David Schwörer 86b481b
done
David Schwörer 86b481b
David Schwörer 86b481b
%find_lang libbout
David Schwörer 86b481b
David Schwörer 86b481b
#
David Schwörer 86b481b
#           CHECK
David Schwörer 86b481b
#
David Schwörer 86b481b
David Schwörer 86b481b
%check
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with test}
David Schwörer 86b481b
for mpi in %{mpi_list}
David Schwörer 86b481b
do
David Schwörer 86b481b
    if [ $mpi = mpich ] ; then
David Schwörer 86b481b
        %_mpich_load
David Schwörer 86b481b
    else
David Schwörer 86b481b
        %_openmpi_load
David Schwörer 86b481b
    fi
David Schwörer 86b481b
    export OMPI_MCA_rmaps_base_oversubscribe=yes
David Schwörer 86b481b
    pushd build_$mpi
David Schwörer 86b481b
    make %{?_smp_mflags} build-check
David Schwörer 9550732
    SEGFAULT_SIGNALS="segv" LD_PRELOAD=%{_libdir}/libSegFault.so make check
David Schwörer 86b481b
    popd
David Schwörer 86b481b
    if [ $mpi = mpich ] ; then
David Schwörer 86b481b
        %_mpich_unload
David Schwörer 86b481b
    else
David Schwörer 86b481b
        %_openmpi_unload
David Schwörer 86b481b
    fi
David Schwörer 86b481b
done
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
#
David Schwörer 86b481b
#           FILES SECTION
David Schwörer 86b481b
#
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with mpich}
David Schwörer 86b481b
%files mpich
David Schwörer 42eb269
%{_libdir}/mpich/lib/libbout++.so.4.3.1
David Schwörer 86b481b
%{_libdir}/mpich/lib/*.so.1.0.0
David Schwörer 86b481b
%{_libdir}/mpich/bin/*
David Schwörer 86b481b
%doc README.md
David Schwörer 86b481b
%doc CITATION.bib
David Schwörer 86b481b
%doc CITATION.cff
David Schwörer 86b481b
%doc CHANGELOG.md
David Schwörer 86b481b
%doc CONTRIBUTING.md
David Schwörer 86b481b
%license LICENSE
David Schwörer 86b481b
%license LICENSE.GPL
David 7f55e43
/usr/share/modulefiles/bout++/mpich-*
David Schwörer 86b481b
David Schwörer 86b481b
%files mpich-devel
David Schwörer 86b481b
%{_includedir}/mpich-%{_arch}/bout++
David Schwörer 86b481b
%{_libdir}/mpich/lib/*.so
David Schwörer 86b481b
David Schwörer 86b481b
%files -n python%{python3_pkgversion}-%{name}-mpich
David Schwörer 86b481b
%{python3_sitearch}/mpich/*
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with openmpi}
David Schwörer 86b481b
%files openmpi
David Schwörer 42eb269
%{_libdir}/openmpi/lib/libbout++.so.4.3.1
David Schwörer 86b481b
%{_libdir}/openmpi/lib/*.so.1.0.0
David Schwörer 86b481b
%{_libdir}/openmpi/bin/*
David Schwörer 86b481b
%doc README.md
David Schwörer 86b481b
%doc CITATION.bib
David Schwörer 86b481b
%doc CITATION.cff
David Schwörer 86b481b
%doc CHANGELOG.md
David Schwörer 86b481b
%doc CONTRIBUTING.md
David Schwörer 86b481b
%license LICENSE
David Schwörer 86b481b
%license LICENSE.GPL
David 7f55e43
/usr/share/modulefiles/bout++/openmpi-*
David Schwörer 86b481b
David Schwörer 86b481b
%files openmpi-devel
David Schwörer 86b481b
%{_includedir}/openmpi-%{_arch}/bout++
David Schwörer 86b481b
%{_libdir}/openmpi/lib/*.so
David Schwörer 86b481b
David Schwörer 86b481b
%files -n python%{python3_pkgversion}-%{name}-openmpi
David Schwörer 86b481b
%{python3_sitearch}/openmpi/*
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
%files common -f libbout.lang
David 7f55e43
%dir /usr/share/modulefiles/bout++/
David Schwörer 86b481b
David Schwörer 86b481b
%files -n python%{python3_pkgversion}-%{name}
David Schwörer 86b481b
%{python3_sitelib}/*bout*
David Schwörer 86b481b
%{python3_sitelib}/zoidberg
David Schwörer 86b481b
%doc README.md
David Schwörer 86b481b
%doc CITATION.bib
David Schwörer 86b481b
%doc CITATION.cff
David Schwörer 86b481b
%doc CHANGELOG.md
David Schwörer 86b481b
%doc CONTRIBUTING.md
David Schwörer 86b481b
%license LICENSE
David Schwörer 86b481b
%license LICENSE.GPL
David Schwörer 86b481b
David Schwörer 86b481b
David Schwörer 86b481b
%if %{with manual}
David Schwörer 86b481b
%files -n %{name}-doc
David Schwörer 86b481b
%doc  %{_defaultdocdir}/bout++/
David Schwörer 86b481b
%endif
David Schwörer 86b481b
David Schwörer 86b481b
#
David Schwörer 86b481b
#           CHANGELOG
David Schwörer 86b481b
#
David Schwörer 86b481b
David Schwörer 86b481b
%changelog
David 7f55e43
* Wed Oct 21 2020 David Schwörer <davidsch@fedoraproject.org> 4.3.2-1
David 7f55e43
- Update to 4.3.2
David 7f55e43
- add python provides
David 7f55e43
- add recomands for devel packages
David 7f55e43
- add module files
David 7f55e43
c4e53a4
* Wed Oct  7 2020 Orion Poplawski <orion@nwra.com> - 4.3.1-8
c4e53a4
- Rebuild for sundials 5.4.0
c4e53a4
David 54c15ec
36095c3
* Thu Aug 20 2020 Iñaki Úcar <iucar@fedoraproject.org> - 4.3.1-7
36095c3
- https://fedoraproject.org/wiki/Changes/FlexiBLAS_as_BLAS/LAPACK_manager
36095c3
David Schwörer 46d2cd6
* Sat Aug 15 2020 David Schwörer <davidsch@fedoraproject.org> 4.3.1-6
David Schwörer 46d2cd6
- Enable sundials and petsc
David Schwörer 46d2cd6
- Rebuild with flexiblas
David Schwörer 46d2cd6
David Schwörer ac269ff
* Sat Aug 08 2020 David Schwörer <schword2mail.dcu.ie> - 4.3.1-5
David Schwörer ac269ff
- Disable lto for s390x
David Schwörer ac269ff
9da33fd
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.1-4
9da33fd
- Second attempt - Rebuilt for
9da33fd
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
9da33fd
482ba62
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.1-3
482ba62
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
482ba62
da1ad88
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 4.3.1-2
da1ad88
- Rebuilt for Python 3.9
da1ad88
David Schwörer 42eb269
* Fri Mar 27 2020 David Schwörer <schword2mail.dcu.ie> - 4.3.1-1
David Schwörer 42eb269
- Update to 4.3.1
David Schwörer 42eb269
ad92f3b
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.0-3
ad92f3b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
ad92f3b
David Schwörer 05b0fec
* Wed Dec 11 2019 David Schwörer <schword2mail.dcu.ie> - 4.3.0-2
David Schwörer 05b0fec
- update make.config during install
David Schwörer 05b0fec
David Schwörer 86b481b
* Thu Dec 05 2019 David Schwörer <schword2mail.dcu.ie> - 4.3.0-1
David Schwörer 86b481b
- update to 4.3.0
David Schwörer 86b481b
- add common subpackage for lang files
David Schwörer 86b481b
David Schwörer 86b481b
* Fri Aug 23 2019 David Schwörer <schword2mail.dcu.ie> - 4.2.2-1
David Schwörer 86b481b
- Remove ldconfig scriptlets
David Schwörer 86b481b
- Use mpi scriplets
David Schwörer 86b481b
- Ensure sitelib packages do not match arched mpi packages
David Schwörer 86b481b
- Move commons package to the base packages
David Schwörer 86b481b
- Specify so version
David Schwörer 86b481b
- Drop man page for library
David Schwörer 86b481b
David Schwörer 86b481b
* Fri Mar 01 2019 David Schwörer <schword2mail.dcu.ie> - 4.2.2-0
David Schwörer 86b481b
- Update to version 4.2.2
David Schwörer 86b481b
David Schwörer 86b481b
* Thu Feb 07 2019 David Schwörer <schword2mail.dcu.ie> - 4.2.1-0
David Schwörer 86b481b
- Fix license
David Schwörer 86b481b
- Bump to 4.2.1
David Schwörer 86b481b
- Use new release
David Schwörer 86b481b
- Release contains gtest, so we can run make check
David Schwörer 86b481b
David Schwörer 86b481b
* Tue Dec 04 2018 David Schwörer <schword2mail.dcu.ie> - 4.2.0-3
David Schwörer 86b481b
- Fix recommend
David Schwörer 86b481b
David Schwörer 86b481b
* Thu Oct 18 2018 David Schwörer <schword2mail.dcu.ie> - 4.2.0-2
David Schwörer 86b481b
- Update to 4.2.0
David Schwörer 86b481b
- Remove python2 support
David Schwörer 86b481b
- Add boutcore support
David Schwörer 86b481b
- Fix mangling of shebangs
David Schwörer 86b481b
David Schwörer 86b481b
* Tue Dec 12 2017 David Schwörer <schword2mail.dcu.ie> - 4.1.2-2
David Schwörer 86b481b
- Add missing python_provide macro
David Schwörer 86b481b
David Schwörer 86b481b
* Fri Dec 01 2017 David Schwörer <schword2mail.dcu.ie> - 4.1.2-1
David Schwörer 86b481b
- Update to new release, remove patch
David Schwörer 86b481b
David Schwörer 86b481b
* Tue May 02 2017 David Schwörer <schword2mail.dcu.ie> - 4.1.1-1
David Schwörer 86b481b
- Initial RPM release.