petsc/petsc.spec

1308 lines
40 KiB
RPMSpec
Raw Normal View History

2016-10-24 17:59:33 +00:00
# default harden flags breaks gfortran work
%undefine _hardened_build
# Testing ?
%bcond_without check
2016-10-25 13:05:57 +00:00
## Debug builds ?
%bcond_with debug
2016-10-24 17:59:33 +00:00
#
# Define _pkgdocdir macro on epel
%{?el6:%global _pkgdocdir %{_docdir}/%{name}}
%{?el7:%global _pkgdocdir %{_docdir}/%{name}}
#
# No MPICH support on these arches
2017-10-01 12:29:45 +00:00
%if 0%{?rhel} && 0%{?rhel} < 7
2016-10-24 17:59:33 +00:00
%ifarch %{power64}
%bcond_with mpich
%endif
%endif
2017-10-01 12:29:45 +00:00
%if 0%{?rhel} && 0%{?rhel} < 7
2016-10-24 17:59:33 +00:00
%ifnarch %{power64}
%bcond_without mpich
%endif
%endif
2018-03-31 18:18:33 +00:00
%if 0%{?fedora} < 28
2017-10-01 12:29:45 +00:00
## Exclude MPI builds on s390x
2016-10-25 13:05:57 +00:00
%ifarch s390x
2017-10-01 12:29:45 +00:00
%bcond_with mpich
2016-10-25 13:05:57 +00:00
%bcond_with openmpi
2018-03-31 18:18:33 +00:00
%endif
%endif
%if 0%{?fedora} > 28
## Exclude MPI builds on s390x
%ifarch s390x
2017-10-01 12:29:45 +00:00
%bcond_without mpich
2018-03-31 18:18:33 +00:00
%bcond_with openmpi
2017-10-01 12:29:45 +00:00
%endif
%endif
%if 0%{?rhel} && 0%{?rhel} >= 7
%bcond_without mpich
2016-10-26 16:58:59 +00:00
%bcond_without openmpi
2016-10-25 13:05:57 +00:00
%endif
2016-10-24 17:59:33 +00:00
## BLAS
# openblas available on these architectures.
%if 0%{?fedora} && 0%{?fedora} > 26
%{!?openblas_arches:%global openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64 s390x}
%else
%{!?openblas_arches:%global openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64}
%endif
%if 0%{?rhel}
%{!?openblas_arches:%global openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64}
%endif
2016-10-24 17:59:33 +00:00
%bcond_without blas
##
2017-04-09 09:07:59 +00:00
2016-10-24 17:59:33 +00:00
#
## PETSC looks incompatible with serial MUMPS
%bcond_with mumps_serial
#
2018-02-04 14:31:55 +00:00
## Sundials needs mpi
%bcond_with sundials_serial
#
2016-10-24 17:59:33 +00:00
%bcond_without superlu
#
2017-08-13 13:02:16 +00:00
## SuperLUDIST needs parmetis
%bcond_with superludist
%bcond_with superlumt
#
2016-10-24 17:59:33 +00:00
# hdf5' is required by 'cgns'
# hdf5 needs MPI
%if 0%{?fedora} || 0%{?rhel} >= 7
2018-02-04 14:31:55 +00:00
%bcond_without cgns
%bcond_without hdf5
2016-10-24 17:59:33 +00:00
%else
%bcond_with cgns
%bcond_with hdf5
%endif
# With suitesparse support ?
%{!?el6:%global with_suitesparse 1}
#
# 'scalapack' is required by 'mumps'
%if %{with openmpi}
%bcond_without mpi
2018-03-31 18:18:33 +00:00
# PETSC-3.8.* is incompatible with Sundials 3.*
2017-11-09 16:40:45 +00:00
%bcond_with sundials
2016-10-24 17:59:33 +00:00
%bcond_without scalapack
%bcond_without mumps
2016-10-25 13:05:57 +00:00
%bcond_without ptscotch
2016-10-24 17:59:33 +00:00
%bcond_without hypre
%endif
%if %{with mpich}
%bcond_without mpi
2018-03-31 18:18:33 +00:00
# PETSC-3.8.* is incompatible with Sundials 3.*
2017-11-09 16:40:45 +00:00
%bcond_with sundials
2016-10-24 17:59:33 +00:00
%bcond_without scalapack
%bcond_without mumps
2016-10-25 13:05:57 +00:00
%bcond_without ptscotch
2016-10-24 17:59:33 +00:00
%bcond_without hypre
%endif
%if %{?__isa_bits:%{__isa_bits}}%{!?__isa_bits:32} == 64
%if 0%{?el6}
2018-01-28 21:38:08 +00:00
%bcond_with arch64
2016-10-24 17:59:33 +00:00
%else
%bcond_without arch64
2016-10-24 17:59:33 +00:00
%endif
%else
%bcond_with arch64
%endif
%if 0%{?el6}
%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro}
%endif
%if %{with arch64}
%bcond_without blas64
%endif
2018-04-24 19:14:06 +00:00
%global releasever 3.9
2017-11-09 18:31:48 +00:00
2016-10-24 17:59:33 +00:00
Name: petsc
Summary: Portable Extensible Toolkit for Scientific Computation
2018-04-24 19:14:06 +00:00
Version: %{releasever}.0
2018-03-31 18:18:33 +00:00
Release: 1%{?dist}
2016-10-24 17:59:33 +00:00
License: BSD
URL: https://www.mcs.anl.gov/petsc
Source0: http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-%{version}.tar.gz
## Remove rpath flags
2017-11-09 18:31:48 +00:00
Patch0: %{name}-%{releasever}-no-rpath.patch
2016-10-24 17:59:33 +00:00
## Rename library name for 64-bit integer package
Patch1: %{name}-lib64.patch
2017-11-22 11:52:18 +00:00
# Disable checkopts and petscnagupgrade.py
2016-10-24 17:59:33 +00:00
Patch3: %{name}-disable_petscnagupgrade.patch
%if %{with superlu}
BuildRequires: SuperLU-devel >= 5.2.0
2016-10-24 17:59:33 +00:00
%endif
2017-08-13 13:02:16 +00:00
%if %{with superlumt}
BuildRequires: SuperLUMT-devel
%endif
2016-10-24 17:59:33 +00:00
%if %{with mumps_serial}
BuildRequires: MUMPS-devel
%endif
2017-11-22 11:52:18 +00:00
%if %{with sundials_serial}
BuildRequires: sundials-devel
%endif
2016-10-24 17:59:33 +00:00
%if 0%{?with_suitesparse}
BuildRequires: suitesparse-devel
%endif
%if %{with blas}
%ifarch %{openblas_arches}
BuildRequires: openblas-devel, openblas-srpm-macros
%else
2016-10-24 17:59:33 +00:00
BuildRequires: blas-devel
BuildRequires: lapack-devel
%endif
%endif
2018-04-24 19:14:06 +00:00
BuildRequires: gcc, gcc-c++
2016-10-24 17:59:33 +00:00
BuildRequires: gcc-gfortran
BuildRequires: libX11-devel
BuildRequires: python2-devel
BuildRequires: pcre-devel
BuildRequires: pkgconfig
BuildRequires: valgrind-devel
BuildRequires: tcsh
2018-01-28 21:38:08 +00:00
Requires: gcc-gfortran%{?_isa}
2016-10-24 17:59:33 +00:00
%description
PETSc, pronounced PET-see (the S is silent), is a suite of data structures
and routines for the scalable (parallel) solution of scientific applications
modeled by partial differential equations.
%package devel
Summary: Portable Extensible Toolkit for Scientific Computation (developer files)
Requires: %{name}%{?_isa} = %{version}-%{release}
2018-02-06 18:12:15 +00:00
%if 0%{?rhel}
Requires: pkgconfig
%else
Requires: pkgconf
%endif
2016-10-24 17:59:33 +00:00
%description devel
Portable Extensible Toolkit for Scientific Computation (developer files).
%package doc
Summary: Portable Extensible Toolkit for Scientific Computation (documentation files)
BuildArch: noarch
%description doc
Portable Extensible Toolkit for Scientific Computation.
PDF and HTML documentation files.
%if %{with arch64}
%package -n petsc64
Summary: Portable Extensible Toolkit for Scientific Computation (64bit INTEGER)
%ifarch %{openblas_arches}
2016-10-24 17:59:33 +00:00
BuildRequires: openblas-serial64 >= 0.2.19-1
BuildRequires: openblas-devel >= 0.2.19-1
%else
BuildRequires: blas64-devel
BuildRequires: lapack64-devel
2016-10-24 17:59:33 +00:00
%endif
2018-01-28 21:38:08 +00:00
Requires: gcc-gfortran%{?_isa}
2016-10-24 17:59:33 +00:00
%description -n petsc64
PETSc, pronounced PET-see (the S is silent), is a suite of data structures
and routines for the scalable (parallel) solution of scientific applications
modeled by partial differential equations (64bit INTEGER).
%package -n petsc64-devel
Requires: %{name}64%{?_isa} = %{version}-%{release}
Requires: gcc-gfortran%{?_isa}
2018-02-06 18:12:15 +00:00
%if 0%{?rhel}
Requires: pkgconfig
%else
Requires: pkgconf
%endif
2016-10-24 17:59:33 +00:00
Summary: Portable Extensible Toolkit for Scientific Computation (64bit INTEGER)
%description -n petsc64-devel
Portable Extensible Toolkit for Scientific Computation (developer files)
(64bit INTEGER).
%endif
#############################################################################
#########
%if %{with openmpi}
%package openmpi
Summary: Portable Extensible Toolkit for Scientific Computation (OpenMPI)
BuildRequires: openmpi-devel
%if %{with hdf5}
BuildRequires: hdf5-openmpi-devel
%endif
%if %{with cgns}
BuildRequires: cgnslib-devel
BuildRequires: hdf5-devel
%endif
%if %{with ptscotch}
BuildRequires: ptscotch-openmpi-devel
%endif
%if %{with scalapack}
BuildRequires: scalapack-openmpi-devel
BuildRequires: blacs-openmpi-devel
%endif
%if %{with mumps}
BuildRequires: MUMPS-openmpi-devel
%endif
%if %{with sundials}
BuildRequires: sundials-openmpi-devel
%endif
2017-08-13 13:02:16 +00:00
%if %{with superludist}
BuildRequires: superlu_dist-openmpi-devel
%endif
2016-10-24 17:59:33 +00:00
%if %{with fftw}
BuildRequires: fftw-devel
BuildRequires: fftw-openmpi-devel
%endif
%if %{with hypre}
BuildRequires: hypre-openmpi-devel
%endif
%if %{with blas}
%ifarch %{openblas_arches}
BuildRequires: openblas-devel, openblas-srpm-macros
%else
2016-10-24 17:59:33 +00:00
BuildRequires: blas-devel
BuildRequires: lapack-devel
%endif
%endif
2018-01-28 21:38:08 +00:00
Requires: gcc-gfortran%{?_isa}
2016-10-24 17:59:33 +00:00
%description openmpi
PETSc, pronounced PET-see (the S is silent), is a suite of data structures
and routines for the scalable (parallel) solution of scientific applications
modeled by partial differential equations.
%package openmpi-devel
Summary: Portable Extensible Toolkit for Scientific Computation (OpenMPI)
Requires: %{name}-openmpi%{?_isa} = %{version}-%{release}
Requires: openmpi-devel%{?_isa}
%description openmpi-devel
Portable Extensible Toolkit for Scientific Computation (developer files).
%endif
######
###############################################################################
######
%if %{with mpich}
%package mpich
Summary: Portable Extensible Toolkit for Scientific Computation (MPICH)
BuildRequires: mpich-devel
%if %{with hdf5}
BuildRequires: hdf5-mpich-devel
%endif
%if %{with cgns}
BuildRequires: cgnslib-devel
BuildRequires: hdf5-devel
%endif
%if %{with ptscotch}
BuildRequires: ptscotch-mpich-devel
%endif
%if %{with scalapack}
BuildRequires: scalapack-mpich-devel
BuildRequires: blacs-mpich-devel
%endif
%if %{with mumps}
BuildRequires: MUMPS-mpich-devel
%endif
%if %{with sundials}
BuildRequires: sundials-mpich-devel
%endif
2017-08-13 13:02:16 +00:00
%if %{with superludist}
BuildRequires: superlu_dist-mpich-devel
%endif
2016-10-24 17:59:33 +00:00
%if %{with hypre}
BuildRequires: hypre-mpich-devel
%endif
%if %{with fftw}
BuildRequires: fftw-devel
BuildRequires: fftw-mpich-devel
%endif
%if %{with blas}
%ifarch %{openblas_arches}
BuildRequires: openblas-devel, openblas-srpm-macros
%else
2016-10-24 17:59:33 +00:00
BuildRequires: blas-devel
BuildRequires: lapack-devel
%endif
%endif
2018-01-28 21:38:08 +00:00
Requires: gcc-gfortran%{?_isa}
2016-10-24 17:59:33 +00:00
%if 0%{?el6}
Requires: mpich%{?_isa}
%endif
%description mpich
PETSc, pronounced PET-see (the S is silent), is a suite of data structures
and routines for the scalable (parallel) solution of scientific applications
modeled by partial differential equations.
%package mpich-devel
Summary: Portable Extensible Toolkit for Scientific Computation (MPICH)
Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
2017-01-04 11:24:38 +00:00
%if 0%{?el7}
# https://bugzilla.redhat.com/show_bug.cgi?id=1397192
Requires: mpich-devel
%else
Requires: mpich-devel%{?_isa}
%endif
2016-10-24 17:59:33 +00:00
%description mpich-devel
Portable Extensible Toolkit for Scientific Computation (developer files).
%endif
######
#############################################################################
%prep
%setup -q -c
pushd %{name}-%{version}
%patch3 -p0
popd
%if %{with arch64}
cp -a %{name}-%{version} build64
pushd build64
%patch1 -p0
popd
%endif
pushd %{name}-%{version}
find . -name 'setup.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
find . -name 'configure' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
find config -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
find src/benchmarks/streams -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|'
%patch0 -p0
popd
%if %{with openmpi}
cp -a %{name}-%{version} buildopenmpi_dir
%endif
%if %{with mpich}
cp -a %{name}-%{version} buildmpich_dir
%endif
%build
pushd %{name}-%{version}
2017-10-01 14:55:11 +00:00
%configure \
%if %{with debug}
CFLAGS="-O0 -g -Wl,-z,now" CXXFLAGS="-O0 -g -Wl,-z,now" FFLAGS="-O0 -g -Wl,-z,now -I%{_libdir}/gfortran/modules" COPTFLAGS="-O0 -g -Wl,-z,now" \
CXXOPTFLAGS="-O0 -g -Wl,-z,now" FOPTFLAGS="-O0 -g -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
2017-10-01 14:55:11 +00:00
%else
2017-11-09 16:40:45 +00:00
CFLAGS="$CFLAGS -O3 -Wl,-z,now" CXXFLAGS="$CXXFLAGS -O3" FFLAGS="$FFLAGS -O3 -Wl,-z,now -I%{_libdir}/gfortran/modules" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
COPTFLAGS="$COPTFLAGS" CXXOPTFLAGS="$CXXOPTFLAGS" FOPTFLAGS="$FOPTFLAGS -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules" \
2017-10-01 14:55:11 +00:00
%endif
2018-01-28 21:38:08 +00:00
--CC_LINKER_FLAGS="$LDFLAGS -Wl,-z,now -fPIC -lgfortran" \
--FC_LINKER_FLAGS="$LDFLAGS -Wl,-z,now -fPIC -lgfortran" \
2016-10-24 17:59:33 +00:00
--with-default-arch=0 --with-make=1 \
--with-single-library=1 \
--with-precision=double \
--with-petsc-arch=%{_arch} \
--with-clanguage=C \
--with-shared-libraries=1 \
--with-64-bit-indices=0 \
--with-fortran-interfaces=1 \
--with-windows-graphics=0 \
--CC=gcc \
--FC=gfortran \
--CXX=g++ \
--with-shared-ld=ld \
--with-pic=1 \
--with-clib-autodetect=0 \
--with-fortranlib-autodetect=0 \
--with-threadsafety=0 --with-log=1 \
%if 0%{?fedora}
--with-cxxlib-autodetect=0 \
%endif
%if %{with debug}
--with-debugging=1 \
%else
--with-debugging=0 \
%endif
%if %{with blas}
%ifnarch %{openblas_arches}
2016-10-24 17:59:33 +00:00
--with-blas-lib=-lblas \
--with-lapack-lib=-llapack \
--known-64-bit-blas-indices=0 \
%else
--with-blas-lapack-lib=-lopenblas \
--known-64-bit-blas-indices=0 \
%endif
%endif
%if %{with superlu}
--with-superlu=1 \
--with-superlu-include=%{_includedir}/SuperLU \
--with-superlu-lib=-lsuperlu \
%endif
%if %{with mumps_serial}
--with-mumps-serial=1 \
--with-mumps-include=%{_includedir}/MUMPS \
2017-11-09 16:40:45 +00:00
--with-mumps-lib=-ldmumps \
2016-10-24 17:59:33 +00:00
%endif
--with-mpi=0 \
--with-x=1 \
--with-openmp=0 \
--with-metis=0 \
--with-hwloc=0 \
--with-ssl=0 \
%if 0%{?with_suitesparse}
--with-suitesparse=1 \
--with-suitesparse-include=%{_includedir}/suitesparse \
--with-suitesparse-lib="-lumfpack -lklu -lcholmod -lamd" \
%endif
2017-11-22 11:52:18 +00:00
%if %{with sundials_serial}
--with-sundials=1 \
--with-sundials-include= \
--with-sundials-lib="-lsundials_nvecserial -lsundials_cvode" \
%endif
2016-10-24 17:59:33 +00:00
%if %{with superlu}
--with-superlu=1 \
--with-superlu-include=%{_includedir}/SuperLU \
--with-superlu-lib=-lsuperlu \
%endif
--with-pthread=1 \
--with-valgrind=1
RPM_BUILD_NCPUS="`%{_bindir}/getconf _NPROCESSORS_ONLN`"
make \
V=1 MAKE_NP=$RPM_BUILD_NCPUS PETSC_DIR=%{_builddir}/%{name}-%{version}/%{name}-%{version} PETSC_ARCH=%{_arch} all
popd
%if %{with arch64}
pushd build64
2017-10-01 14:55:11 +00:00
%configure \
%if %{with debug}
CFLAGS="-O0 -g -Wl,-z,now" CXXFLAGS="-O0 -g -Wl,-z,now" FFLAGS="-O0 -g -Wl,-z,now -I%{_libdir}/gfortran/modules" COPTFLAGS="-O0 -g -Wl,-z,now" \
CXXOPTFLAGS="-O0 -g -Wl,-z,now" FOPTFLAGS="-O0 -g -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
2017-10-01 14:55:11 +00:00
%else
2017-11-09 16:40:45 +00:00
CFLAGS="$CFLAGS -O3 -Wl,-z,now" CXXFLAGS="$CXXFLAGS -O3" FFLAGS="$FFLAGS -O3 -Wl,-z,now -I%{_libdir}/gfortran/modules" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
COPTFLAGS="$COPTFLAGS" CXXOPTFLAGS="$CXXOPTFLAGS" FOPTFLAGS="$FOPTFLAGS -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules" \
2017-10-01 14:55:11 +00:00
%endif
2018-01-28 21:38:08 +00:00
--CC_LINKER_FLAGS="$LDFLAGS -Wl,-z,now -fPIC -lgfortran" \
--FC_LINKER_FLAGS="$LDFLAGS -Wl,-z,now -fPIC -lgfortran" \
2016-10-24 17:59:33 +00:00
--with-default-arch=0 --with-make=1 \
--with-single-library=1 \
--with-precision=double \
--with-petsc-arch=%{_arch} \
--with-clanguage=C \
--with-shared-libraries=1 \
--with-64-bit-indices=1 \
--with-fortran-interfaces=1 \
--with-windows-graphics=0 \
--CC=gcc \
--FC=gfortran \
--CXX=g++ \
--with-shared-ld=ld \
--with-pic=1 \
--with-clib-autodetect=0 \
--with-fortranlib-autodetect=0 \
%if 0%{?fedora}
--with-cxxlib-autodetect=0 \
%endif
--with-mpi=0 \
--with-threadsafety=0 --with-log=1 \
%if %{with debug}
--with-debugging=1 \
%else
--with-debugging=0 \
%endif
%if %{with blas64}
%ifnarch %{openblas_arches}
--with-blas-lib="-lblas64_" \
--with-lapack-lib="-llapack64_" \
2016-10-24 17:59:33 +00:00
--known-64-bit-blas-indices=1 \
%else
--with-blas-lapack-lib="-lopenblas64" \
--known-64-bit-blas-indices=1 \
%endif
%endif
--with-x=1 \
--with-openmp=0 \
--with-metis=0 \
--with-hwloc=0 \
--with-ssl=0 \
--with-pthread=1 \
--with-valgrind=1
RPM_BUILD_NCPUS="`%{_bindir}/getconf _NPROCESSORS_ONLN`"
make \
V=1 MAKE_NP=$RPM_BUILD_NCPUS PETSC_DIR=%{_builddir}/%{name}-%{version}/build64 PETSC_ARCH=%{_arch} all
popd
%endif
%if %{with openmpi}
pushd buildopenmpi_dir
%{_openmpi_load}
2017-10-01 14:55:11 +00:00
%configure \
%if %{with debug}
CFLAGS="-O0 -g -Wl,-z,now" CXXFLAGS="-O0 -g -Wl,-z,now" FFLAGS="-O0 -g -Wl,-z,now -I%{_libdir}/gfortran/modules" COPTFLAGS="-O0 -g -Wl,-z,now" \
CXXOPTFLAGS="-O0 -g -Wl,-z,now" FOPTFLAGS="-O0 -g -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
2017-10-01 14:55:11 +00:00
%else
2017-11-09 16:40:45 +00:00
CFLAGS="$CFLAGS -O3 -Wl,-z,now" CXXFLAGS="$CXXFLAGS -O3" FFLAGS="$FFLAGS -O3 -Wl,-z,now -I%{_libdir}/gfortran/modules" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
COPTFLAGS="$COPTFLAGS" CXXOPTFLAGS="$CXXOPTFLAGS" FOPTFLAGS="$FOPTFLAGS -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules" \
2017-10-01 14:55:11 +00:00
%endif
2018-01-28 21:38:08 +00:00
--CC_LINKER_FLAGS="$LDFLAGS -Wl,-z,now -fPIC -lgfortran -L$MPI_LIB -lmpi_mpifh" \
--FC_LINKER_FLAGS=" -lgfortran" \
2016-10-24 17:59:33 +00:00
--with-default-arch=0 --with-make=1 \
--with-single-library=1 \
--with-precision=double \
--with-petsc-arch=%{_arch} \
--with-clanguage=C \
--with-shared-libraries=1 \
--with-64-bit-indices=0 \
--with-fortran-interfaces=1 \
--with-windows-graphics=0 \
2018-01-28 21:38:08 +00:00
--with-cc=mpicc \
--with-cxx=mpicxx \
--with-fc=mpif77 \
2016-10-24 17:59:33 +00:00
--with-shared-ld=ld \
--with-pic=1 \
--with-clib-autodetect=0 \
--with-fortranlib-autodetect=0 \
%if 0%{?fedora}
--with-cxxlib-autodetect=0 \
%endif
--with-threadsafety=0 --with-log=1 \
%if %{with debug}
--with-debugging=1 \
%else
--with-debugging=0 \
%endif
%if %{with blas}
%ifnarch %{openblas_arches}
2016-10-24 17:59:33 +00:00
--with-blas-lib="-lblas" \
--with-lapack-lib="-llapack" \
--known-64-bit-blas-indices=0 \
%else
--with-blas-lapack-lib="-lopenblas" \
--known-64-bit-blas-indices=0 \
%endif
%endif
%if %{with scalapack}
--with-scalapack=1 \
2017-08-13 13:02:16 +00:00
--with-scalapack-lib="-L$MPI_LIB -lscalapack" \
2016-10-24 17:59:33 +00:00
--with-scalapck-include="" \
%endif
%if %{with mpi}
--with-mpi=1 \
%endif
%if %{with cgns}
--with-cgns=1 \
2017-11-09 16:40:45 +00:00
--with-cgns-include= \
2017-08-13 13:02:16 +00:00
--with-cgns-lib="-L$MPI_LIB -lhdf5 -lcgns" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with hdf5}
--with-hdf5=1 \
2017-11-09 16:40:45 +00:00
--with-hdf5-include= \
2017-08-13 13:02:16 +00:00
--with-hdf5-lib="-L$MPI_LIB -lhdf5" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with ptscotch}
--with-ptscotch=1 \
2017-11-09 16:40:45 +00:00
--with-ptscotch-include= \
2017-08-13 13:02:16 +00:00
--with-ptscotch-lib="-L$MPI_LIB -lptscotch -lscotch -lptscotcherr -lscotcherr" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with mumps}
--with-mumps=1 \
2017-11-09 16:40:45 +00:00
--with-mumps-include=$MPI_INCLUDE \
--with-mumps-lib="-L$MPI_LIB -ldmumps" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with sundials}
--with-sundials=1 \
2017-11-22 11:52:18 +00:00
--with-sundials-include=$MPI_INCLUDE \
--with-sundials-lib="-L$MPI_LIB -lsundials_nvecparallel" \
2017-08-13 13:02:16 +00:00
%endif
%if %{with superludist}
--with-superlu_dist=1 \
--with-superlu_dist-include=$MPI_INCLUDE/superlu_dist \
--with-superlu_dist-lib=-lsuperlu_dist \
2016-10-24 17:59:33 +00:00
%endif
--with-x=1 \
--with-openmp=0 \
--with-metis=0 \
--with-hwloc=0 \
--with-ssl=0 \
%if %{with hypre}
--with-hypre=1 \
2017-08-13 13:02:16 +00:00
--with-hypre-include=$MPI_INCLUDE/hypre \
--with-hypre-lib="-L$MPI_LIB -lHYPRE" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with fftw}
--with-fftw=1 \
2017-11-09 16:40:45 +00:00
--with-fftw-include= \
2017-08-13 13:02:16 +00:00
--with-fftw-lib="-L$MPI_LIB -lfftw3_mpi -lfftw3" \
2016-10-24 17:59:33 +00:00
%endif
--with-pthread=1 \
--with-valgrind=1
2018-01-28 21:38:08 +00:00
#cat config.log
#exit 1
2016-10-24 17:59:33 +00:00
RPM_BUILD_NCPUS="`%{_bindir}/getconf _NPROCESSORS_ONLN`"
make \
V=1 MAKE_NP=$RPM_BUILD_NCPUS PETSC_DIR=%{_builddir}/%{name}-%{version}/buildopenmpi_dir PETSC_ARCH=%{_arch} all
%{_openmpi_unload}
popd
%endif
%if %{with mpich}
pushd buildmpich_dir
%{_mpich_load}
2017-10-01 14:55:11 +00:00
%configure \
%if %{with debug}
CFLAGS="-O0 -g -Wl,-z,now" CXXFLAGS="-O0 -g -Wl,-z,now" FFLAGS="-O0 -g -Wl,-z,now -I%{_libdir}/gfortran/modules" COPTFLAGS="-O0 -g -Wl,-z,now" \
CXXOPTFLAGS="-O0 -g -Wl,-z,now" FOPTFLAGS="-O0 -g -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
2017-10-01 14:55:11 +00:00
%else
CFLAGS="$CFLAGS -O3 -Wl,-z,now" CXXFLAGS="$CXXFLAGS -O3" FFLAGS="$FFLAGS -O3 -Wl,-z,now" LDFLAGS="$LDFLAGS -Wl,-z,now -fPIC" \
2017-11-09 16:40:45 +00:00
COPTFLAGS="$COPTFLAGS" CXXOPTFLAGS="$CXXOPTFLAGS" FOPTFLAGS="$FOPTFLAGS -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules" \
2017-10-01 14:55:11 +00:00
%endif
2018-01-28 21:38:08 +00:00
--CC_LINKER_FLAGS="$LDFLAGS -Wl,-z,now -fPIC -lgfortran -L$MPI_LIB -lmpichf90" \
--FC_LINKER_FLAGS=" -lgfortran" \
2016-10-24 17:59:33 +00:00
--with-default-arch=0 --with-make=1 \
--with-single-library=1 \
--with-precision=double \
--with-petsc-arch=%{_arch} \
--with-clanguage=C \
--with-shared-libraries=1 \
--with-64-bit-indices=0 \
--with-fortran-interfaces=1 \
--with-windows-graphics=0 \
2018-01-28 21:38:08 +00:00
--with-cc=mpicc \
--with-cxx=mpicxx \
--with-fc=mpif77 \
2016-10-24 17:59:33 +00:00
--with-shared-ld=ld \
--with-pic=1 \
--with-clib-autodetect=0 \
--with-fortranlib-autodetect=0 \
%if 0%{?fedora}
--with-cxxlib-autodetect=0 \
%endif
--with-threadsafety=0 --with-log=1 \
%if %{with debug}
--with-debugging=1 \
%else
--with-debugging=0 \
%endif
%if %{with blas}
%ifnarch %{openblas_arches}
2016-10-24 17:59:33 +00:00
--with-blas-lib=-lblas \
--with-lapack-lib=-llapack \
--known-64-bit-blas-indices=0 \
%else
--with-blas-lapack-lib=-lopenblas \
--known-64-bit-blas-indices=0 \
%endif
%endif
%if %{with scalapack}
--with-scalapack=1 \
2017-08-13 13:02:16 +00:00
--with-scalapack-lib="-L$MPI_LIB -lscalapack" \
2016-10-24 17:59:33 +00:00
--with-scalapck-include="" \
%endif
%if %{with mpi}
--with-mpi=1 \
%endif
%if %{with cgns}
--with-cgns=1 \
2017-11-09 16:40:45 +00:00
--with-cgns-include= \
2017-08-13 13:02:16 +00:00
--with-cgns-lib="-L$MPI_LIB -lhdf5 -lcgns" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with hdf5}
--with-hdf5=1 \
2017-11-09 16:40:45 +00:00
--with-hdf5-include= \
2017-08-13 13:02:16 +00:00
--with-hdf5-lib="-L$MPI_LIB -lhdf5" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with ptscotch}
--with-ptscotch=1 \
--with-ptscotch-include="" \
2017-08-13 13:02:16 +00:00
--with-ptscotch-lib="-L$MPI_LIB -lptscotch -lscotch -lptscotcherr -lscotcherr" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with mumps}
--with-mumps=1 \
2017-11-09 16:40:45 +00:00
--with-mumps-include=$MPI_INCLUDE \
--with-mumps-lib="-L$MPI_LIB -ldmumps" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with sundials}
--with-sundials=1 \
2017-11-22 11:52:18 +00:00
--with-sundials-include=$MPI_INCLUDE \
--with-sundials-lib="-L$MPI_LIB -lsundials_nvecparallel" \
2017-08-13 13:02:16 +00:00
%endif
%if %{with superludist}
--with-superlu_dist=1 \
--with-superlu_dist-include=$MPI_INCLUDE/superlu_dist \
--with-superlu_dist-lib=-lsuperlu_dist \
2016-10-24 17:59:33 +00:00
%endif
--with-x=1 \
--with-openmp=0 \
--with-metis=0 \
--with-hwloc=0 \
--with-ssl=0 \
%if %{with hypre}
--with-hypre=1 \
2017-08-13 13:02:16 +00:00
--with-hypre-include=$MPI_INCLUDE/hypre \
--with-hypre-lib="-L$MPI_LIB -lHYPRE" \
2016-10-24 17:59:33 +00:00
%endif
%if %{with fftw}
--with-fftw=1 \
2017-11-09 16:40:45 +00:00
--with-fftw-include= \
2017-08-13 13:02:16 +00:00
--with-fftw-lib="-L$MPI_LIB -lfftw3_mpi -lfftw3" \
2016-10-24 17:59:33 +00:00
%endif
--with-pthread=1 \
--with-valgrind=1
2018-01-28 21:38:08 +00:00
#cat config.log
#exit 1
2016-10-24 17:59:33 +00:00
RPM_BUILD_NCPUS="`%{_bindir}/getconf _NPROCESSORS_ONLN`"
make \
V=1 MAKE_NP=$RPM_BUILD_NCPUS PETSC_DIR=%{_builddir}/%{name}-%{version}/buildmpich_dir PETSC_ARCH=%{_arch} all
%{_mpich_unload}
popd
%endif
%install
pushd %{name}-%{version}
mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}/%{name}
2017-11-13 19:20:47 +00:00
mkdir -p $RPM_BUILD_ROOT%{_fmoddir}/%{name}
2017-09-27 18:32:30 +00:00
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf
2016-10-24 17:59:33 +00:00
install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT%{_libdir}
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libpetsc.so
2017-11-09 18:31:48 +00:00
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libpetsc.so.%{releasever}
2016-10-24 17:59:33 +00:00
2017-11-13 19:20:47 +00:00
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}/
install -pm 644 %{_arch}/include/*.mod $RPM_BUILD_ROOT%{_fmoddir}/%{name}/
cp -a include/* $RPM_BUILD_ROOT%{_includedir}/%{name}/
2017-09-27 18:32:30 +00:00
install -pm 644 %{_arch}/lib/petsc/conf/petscrules $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/
install -pm 644 %{_arch}/lib/petsc/conf/petscvariables $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/
install -pm 644 lib/petsc/conf/rules $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/
install -pm 644 lib/petsc/conf/variables $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/
sed -e 's|%{_builddir}/%{name}-%{version}/%{name}-%{version}|%{_prefix}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/petscvariables
sed -e 's|%{_builddir}/%{name}-%{version}/%{name}-%{version}/%{_arch}/|%{_prefix}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/petscvariables
sed -e 's|-L%{_prefix}/%{_arch}/lib|-L%{_libdir}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/petscvariables
sed -e 's|-I%{_prefix}/%{_arch}/include|-I%{_includedir}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/petscvariables
2018-01-29 13:01:29 +00:00
sed -e 's|${PETSC_DIR}/${PETSC_ARCH}/lib|${PETSC_DIR}/%{_lib}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/variables
2016-10-24 17:59:33 +00:00
popd
##Make a .pc file
mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
cat > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/%{name}.pc <<EOF
prefix=%{_prefix}
exec_prefix=%{_prefix}
includedir=%{_prefix}/include
libdir=%{_prefix}/%{lib}
ccompiler=gcc
fcompiler=gfortran
blaslapacklibs=-lopenblas64
Name: PETSc
Description: Library to solve ODEs and algebraic equations
Version: %{version}
Cflags: -I%{_includedir} -I%{_includedir}/SuperLU -I%{_includedir}/suitesparse -I%{_includedir}/petsc/petsc/mpiuni
Libs: -L%{_libdir} -lpetsc
%ifarch x86_64 %{ix86} armv7hl %{power64} aarch64
Libs.private: -lsuperlu -lumfpack -lklu -lcholmod -lamd -lopenblas -lX11 -lpthread -lm -ldl
%else
Libs.private: -lsuperlu -lumfpack -lklu -lcholmod -lamd -lblas -llapack -lX11 -lpthread -lm -ldl
%endif
EOF
2016-10-24 17:59:33 +00:00
%if %{with arch64}
pushd build64
mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}/%{name}64
2017-11-13 19:20:47 +00:00
mkdir -p $RPM_BUILD_ROOT%{_fmoddir}/%{name}64
2017-09-27 18:32:30 +00:00
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf
2016-10-24 17:59:33 +00:00
install -pm 755 %{_arch}/lib/libpetsc64.* $RPM_BUILD_ROOT%{_libdir}
ln -sf libpetsc64.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libpetsc64.so
2017-11-09 18:31:48 +00:00
ln -sf libpetsc64.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libpetsc64.so.%{releasever}
2016-10-24 17:59:33 +00:00
2017-11-13 19:20:47 +00:00
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}64/
install -pm 644 %{_arch}/include/*.mod $RPM_BUILD_ROOT%{_fmoddir}/%{name}64/
cp -a include/* $RPM_BUILD_ROOT%{_includedir}/%{name}64/
2017-09-27 18:32:30 +00:00
install -pm 644 %{_arch}/lib/petsc/conf/petscrules $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf/
install -pm 644 %{_arch}/lib/petsc/conf/petscvariables $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf/
install -pm 644 lib/petsc/conf/rules $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf/
install -pm 644 lib/petsc/conf/variables $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf/
sed -e 's|%{_builddir}/%{name}-%{version}/build64|%{_prefix}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf/petscvariables
sed -e 's|%{_builddir}/%{name}-%{version}/build64/%{_arch}/|%{_prefix}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf/petscvariables
sed -e 's|-L%{_prefix}/%{_arch}/lib|-L%{_libdir}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf/petscvariables
sed -e 's|-I%{_prefix}/%{_arch}/include/|-I%{_includedir}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}64-%{version}/conf/petscvariables
2018-01-29 13:01:29 +00:00
sed -e 's|${PETSC_DIR}/${PETSC_ARCH}/lib|${PETSC_DIR}/%{_lib}|g' -i $RPM_BUILD_ROOT%{_libdir}/%{name}-%{version}/conf/variables
2016-10-24 17:59:33 +00:00
popd
##Make a .pc file
mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
cat > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/%{name}64.pc <<EOF
prefix=%{_prefix}
exec_prefix=%{_prefix}
includedir=%{_prefix}/include
libdir=%{_prefix}/%{lib}
ccompiler=gcc
fcompiler=gfortran
blaslapacklibs=-lopenblas64
Name: PETSc
Description: Library to solve ODEs and algebraic equations (64bit interger)
Version: %{version}
Cflags: -I%{_includedir} -I%{_includedir}/petsc/petsc/mpiuni
Libs: -L%{_libdir} -lpetsc64
%ifarch x86_64 %{ix86} armv7hl %{power64} aarch64
Libs.private: -lopenblas64 -lX11 -lpthread -lm -ldl
%else
Libs.private: -llapack64_ -lblas64_ -lX11 -lpthread -lm -ldl
%endif
EOF
2016-10-24 17:59:33 +00:00
%endif
%if %{with openmpi}
pushd buildopenmpi_dir
2017-08-13 13:02:16 +00:00
%{_openmpi_load}
mkdir -p $RPM_BUILD_ROOT$MPI_LIB $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}
2017-11-13 19:20:47 +00:00
mkdir -p $RPM_BUILD_ROOT$MPI_FORTRAN_MOD_DIR/%{name}
2017-09-27 18:32:30 +00:00
mkdir -p $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf
2016-10-24 17:59:33 +00:00
2017-08-13 13:02:16 +00:00
install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT$MPI_LIB
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT$MPI_LIB/libpetsc.so
2017-11-09 18:31:48 +00:00
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT$MPI_LIB/libpetsc.so.%{releasever}
2016-10-24 17:59:33 +00:00
2017-11-13 19:20:47 +00:00
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}/
install -pm 644 %{_arch}/include/*.mod $RPM_BUILD_ROOT$MPI_FORTRAN_MOD_DIR/%{name}/
cp -a include/* $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}/
2017-09-27 18:32:30 +00:00
install -pm 644 %{_arch}/lib/petsc/conf/petscrules $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/
install -pm 644 %{_arch}/lib/petsc/conf/petscvariables $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/
install -pm 644 lib/petsc/conf/rules $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/
install -pm 644 lib/petsc/conf/variables $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/
sed -e 's|%{_builddir}/%{name}-%{version}/buildopenmpi_dir|%{_prefix}|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/petscvariables
sed -e 's|%{_builddir}/%{name}-%{version}/buildopenmpi_dir/%{_arch}/|%{_prefix}|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/petscvariables
sed -e 's|-L%{_prefix}/%{_arch}/lib|-L%{_libdir}/openmpi/lib|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/petscvariables
sed -e 's|-I%{_prefix}/%{_arch}/include|-I%{_includedir}/openmpi-%{_arch}/%{name}|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/petscvariables
2018-01-29 13:01:29 +00:00
sed -e 's|${PETSC_DIR}/${PETSC_ARCH}/lib|${PETSC_DIR}/%{_lib}/openmpi/lib|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/variables
2017-08-13 13:02:16 +00:00
%{_openmpi_unload}
2016-10-24 17:59:33 +00:00
popd
%endif
%if %{with mpich}
pushd buildmpich_dir
2017-08-13 13:02:16 +00:00
%{_mpich_load}
mkdir -p $RPM_BUILD_ROOT$MPI_LIB $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}
2017-11-13 19:20:47 +00:00
mkdir -p $RPM_BUILD_ROOT$MPI_FORTRAN_MOD_DIR/%{name}
2017-09-27 18:32:30 +00:00
mkdir -p $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf
2016-10-24 17:59:33 +00:00
2017-08-13 13:02:16 +00:00
install -pm 755 %{_arch}/lib/libpetsc.* $RPM_BUILD_ROOT$MPI_LIB
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT$MPI_LIB/libpetsc.so
2017-11-09 18:31:48 +00:00
ln -sf libpetsc.so.%{version} $RPM_BUILD_ROOT$MPI_LIB/libpetsc.so.%{releasever}
2016-10-24 17:59:33 +00:00
2017-11-13 19:20:47 +00:00
install -pm 644 %{_arch}/include/*.h $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}/
install -pm 644 %{_arch}/include/*.mod $RPM_BUILD_ROOT$MPI_FORTRAN_MOD_DIR/%{name}/
cp -a include/* $RPM_BUILD_ROOT$MPI_INCLUDE/%{name}/
2017-09-27 18:32:30 +00:00
install -pm 644 %{_arch}/lib/petsc/conf/petscrules $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/
install -pm 644 %{_arch}/lib/petsc/conf/petscvariables $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/
install -pm 644 lib/petsc/conf/rules $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/
install -pm 644 lib/petsc/conf/variables $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/
sed -e 's|%{_builddir}/%{name}-%{version}/buildmpich_dir|%{_prefix}|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/petscvariables
sed -e 's|%{_builddir}/%{name}-%{version}/buildmpich_dir/%{_arch}/|%{_prefix}|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/petscvariables
sed -e 's|-L%{_prefix}/%{_arch}/lib|-L%{_libdir}/mpich/lib|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/petscvariables
sed -e 's|-I%{_prefix}/%{_arch}/include|-I%{_includedir}/mpich-%{_arch}/%{name}|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/petscvariables
2018-01-29 13:01:29 +00:00
sed -e 's|${PETSC_DIR}/${PETSC_ARCH}/lib|${PETSC_DIR}/%{_lib}/mpich/lib|g' -i $RPM_BUILD_ROOT$MPI_LIB/%{name}-%{version}/conf/variables
2017-08-13 13:02:16 +00:00
%{_mpich_unload}
2016-10-24 17:59:33 +00:00
popd
%endif
# Move html documentation in _pkgdocdir
pushd $RPM_BUILD_ROOT%{_includedir}
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/headers
for i in `find . -name "*.h.html" -type f -print`; do
mv $i $RPM_BUILD_ROOT%{_pkgdocdir}/headers
done
for i in `find . -name "*.html" -type f -print`; do
mv $i $RPM_BUILD_ROOT%{_pkgdocdir}/headers
done
find . -name "Makefile" -type f -print | xargs /bin/rm -f
popd
cp -a %{name}-%{version}/docs/* $RPM_BUILD_ROOT%{_pkgdocdir}
#
2018-02-02 11:33:30 +00:00
%ldconfig_scriptlets
2016-10-24 17:59:33 +00:00
%if %{with arch64}
2018-02-02 11:33:30 +00:00
%ldconfig_scriptlets -n petsc64
2016-10-24 17:59:33 +00:00
%endif
%if %{with check}
%check
export LD_LIBRARY_PATH=%{_libdir}:%{_builddir}/%{name}-%{version}/%{name}-%{version}/%{_arch}/lib
export PETSC_DIR=%{_builddir}/%{name}-%{version}/%{name}-%{version}
export PETSC_ARCH=%{_arch}
%if %{with debug}
export PETSCVALGRIND_OPTIONS=" --tool=memcheck --leak-check=yes --track-origins=yes"
make -C %{name}-%{version} test MPIEXEC='%{_builddir}/%{name}-%{version}/%{name}-%{version}/bin/petscmpiexec -valgrind'
%else
export CFLAGS="-O0 -g -Wl,-z,now -fPIC"
export CXXFLAGS="-O0 -g -Wl,-z,now -fPIC"
export FFLAGS="-O0 -g -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules"
2016-10-24 17:59:33 +00:00
make -C %{name}-%{version} test
%endif
%if %{with arch64}
export LD_LIBRARY_PATH=%{_libdir}:%{_builddir}/%{name}-%{version}/build64/%{_arch}/lib
export PETSC_DIR=%{_builddir}/%{name}-%{version}/build64
export PETSC_ARCH=%{_arch}
## 'make test' needs to link against -lpetsc
## Not elegant fix
ln -s %{_builddir}/%{name}-%{version}/build64/%{_arch}/lib/libpetsc64.so %{_builddir}/%{name}-%{version}/build64/%{_arch}/lib/libpetsc.so
%if %{with debug}
export PETSCVALGRIND_OPTIONS=" --tool=memcheck --leak-check=yes --track-origins=yes"
make -C build64 test MPIEXEC='%{_builddir}/%{name}-%{version}/build64/bin/petscmpiexec -valgrind'
%else
export CFLAGS="-O0 -g -Wl,-z,now -fPIC"
export CXXFLAGS="-O0 -g -Wl,-z,now -fPIC"
export FFLAGS="-O0 -g -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules"
2016-10-24 17:59:33 +00:00
make -C build64 test
%endif
%endif
%if %{with openmpi}
%{_openmpi_load}
2017-08-13 13:02:16 +00:00
export LD_LIBRARY_PATH=$MPI_LIB:%{_libdir}:%{_builddir}/%{name}-%{version}/buildopenmpi_dir/%{_arch}/lib
2016-10-24 17:59:33 +00:00
export PETSC_DIR=%{_builddir}/%{name}-%{version}/buildopenmpi_dir
export PETSC_ARCH=%{_arch}
export MPI_INTERFACE_HOSTNAME=localhost
export CFLAGS="-O0 -g -Wl,-z,now -fPIC"
export CXXFLAGS="-O0 -g -Wl,-z,now -fPIC"
export FFLAGS="-O0 -g -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules"
2016-10-24 17:59:33 +00:00
make -C buildopenmpi_dir test
%{_openmpi_unload}
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
%if %{with mpich}
%{_mpich_load}
2017-08-13 13:02:16 +00:00
export LD_LIBRARY_PATH=$MPI_LIB:%{_libdir}:%{_builddir}/%{name}-%{version}/buildmpich_dir/%{_arch}/lib
2016-10-24 17:59:33 +00:00
export PETSC_DIR=%{_builddir}/%{name}-%{version}/buildmpich_dir
export PETSC_ARCH=%{_arch}
export MPI_INTERFACE_HOSTNAME=localhost
export CFLAGS="-O0 -g -Wl,-z,now -fPIC"
export CXXFLAGS="-O0 -g -Wl,-z,now -fPIC"
export FFLAGS="-O0 -g -Wl,-z,now -fPIC -I%{_libdir}/gfortran/modules"
2016-10-24 17:59:33 +00:00
make -C buildmpich_dir test
%{_mpich_unload}
%endif
%endif
%endif
%files
%license %{name}-%{version}/LICENSE
%{_libdir}/libpetsc.so.*
%files devel
%{_libdir}/pkgconfig/%{name}.pc
2017-09-27 18:32:30 +00:00
%{_libdir}/%{name}-%{version}/
2016-10-24 17:59:33 +00:00
%{_libdir}/libpetsc.so
%{_includedir}/%{name}/
2017-11-13 19:20:47 +00:00
%{_fmoddir}/%{name}/
2016-10-24 17:59:33 +00:00
%files doc
%license %{name}-%{version}/LICENSE
%{_pkgdocdir}/
%if %{with arch64}
%files -n petsc64
%license build64/LICENSE
%{_libdir}/libpetsc64.so.*
%files -n petsc64-devel
%{_libdir}/pkgconfig/%{name}64.pc
2017-09-27 18:32:30 +00:00
%{_libdir}/%{name}64-%{version}/
2016-10-24 17:59:33 +00:00
%{_libdir}/libpetsc64.so
%{_includedir}/%{name}64/
2017-11-13 19:20:47 +00:00
%{_fmoddir}/%{name}64/
2016-10-24 17:59:33 +00:00
%endif
%if %{with openmpi}
%files openmpi
%license buildopenmpi_dir/LICENSE
2017-08-13 17:28:37 +00:00
%{_libdir}/openmpi/lib/libpetsc.so.*
2016-10-24 17:59:33 +00:00
%files openmpi-devel
2017-08-13 17:28:37 +00:00
%{_libdir}/openmpi/lib/libpetsc.so
2017-09-27 18:32:30 +00:00
%{_libdir}/openmpi/lib/%{name}-%{version}/
2017-08-13 17:28:37 +00:00
%{_includedir}/openmpi-%{_arch}/%{name}/
2017-12-03 15:55:36 +00:00
%if 0%{?rhel}
%{_fmoddir}/openmpi-%{_arch}/%{name}/
%else
2017-11-13 19:20:47 +00:00
%{_fmoddir}/openmpi/%{name}/
2016-10-24 17:59:33 +00:00
%endif
2017-12-03 15:55:36 +00:00
%endif
2016-10-24 17:59:33 +00:00
%if %{with mpich}
%files mpich
%license buildmpich_dir/LICENSE
2017-08-13 17:28:37 +00:00
%{_libdir}/mpich/lib/libpetsc.so.*
2016-10-24 17:59:33 +00:00
%files mpich-devel
2017-08-13 17:28:37 +00:00
%{_libdir}/mpich/lib/libpetsc.so
2017-09-27 18:32:30 +00:00
%{_libdir}/mpich/lib/%{name}-%{version}/
2017-08-13 17:28:37 +00:00
%{_includedir}/mpich-%{_arch}/%{name}/
2017-12-03 15:55:36 +00:00
%if 0%{?rhel}
%{_fmoddir}/mpich-%{_arch}/%{name}/
%else
2017-11-13 19:20:47 +00:00
%{_fmoddir}/mpich/%{name}/
2016-10-24 17:59:33 +00:00
%endif
2017-12-03 15:55:36 +00:00
%endif
2016-10-24 17:59:33 +00:00
%changelog
2018-04-24 19:14:06 +00:00
* Wed Apr 11 2018 Antonio Trande <sagitter@fedoraproject.org> - 3.9.0-1
- Update to 3.9.0
2018-03-31 18:18:33 +00:00
* Fri Mar 30 2018 Antonio Trande <sagitter@fedoraproject.org> - 3.8.4-1
- Update to 3.8.4
- Exclude MPI builds on s390 archirectures if fedora < 28 only
- Patched for using Hypre-2.14.0
2018-02-06 18:12:15 +00:00
* Tue Feb 06 2018 Antonio Trande <sagitter@fedoraproject.org> - 3.8.3-4
- Fix pkgconfig request on rhel
2018-02-04 14:31:55 +00:00
* Sun Feb 04 2018 Antonio Trande <sagitter@fedoraproject.org> - 3.8.3-3
- cgns/hdf5 support enabled (bz#1541616)
* Sat Feb 03 2018 Antonio Trande <sagitter@fedoraproject.org> - 3.8.3-2
2018-01-29 13:01:29 +00:00
- Fix PETSC_LIB_DIR variables
2018-02-04 14:31:55 +00:00
- cgns/hdf5 support temporarily disabled (bz#1541616)
2018-01-29 13:01:29 +00:00
2018-01-28 21:38:08 +00:00
* Sun Jan 28 2018 Antonio Trande <sagitter@fedoraproject.org> - 3.8.3-1
- Update to 3.8.3
- Rebuild for sundials-3.1.0
* Thu Dec 14 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.1-4
- Not build 64-bit integer libraries on epel6
* Sun Dec 03 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.1-3
- Build 64-bit integer libraries on epel7
2017-12-03 15:55:36 +00:00
* Sun Dec 03 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.1-2
- Fix Fortran MPI library path on epel
2017-11-22 11:52:18 +00:00
* Wed Nov 22 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.1-1
- Update to 3.8.1
- Disable Sundials
- Enable MUMPS on serial build
2017-11-13 19:20:47 +00:00
* Mon Nov 13 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.0-5
- Install .mod files (bz#1212557)
2017-11-09 18:31:48 +00:00
* Thu Nov 09 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.0-4
- Fix soname version
2017-11-08 21:50:44 +00:00
* Wed Nov 08 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.0-3
- Rebuild for hypre-2.13.0
2017-11-09 16:40:45 +00:00
- Disable sundials on MPI builds
2017-11-08 21:50:44 +00:00
* Sun Oct 29 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.0-2
- Define openblas arches
2017-10-22 15:06:36 +00:00
* Tue Oct 03 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.8.0-1
- Update to 3.8.0
- with-mpiuni-fortran-binding option deprecated
- Remove obsolete patch2
* Mon Oct 02 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.7-5
- Disable debugging
- Unset default compiler flags when tests are built
2017-10-01 14:55:11 +00:00
* Sun Oct 01 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.7-4
- Rebuild for debugging
2017-10-01 12:29:45 +00:00
* Sun Oct 01 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.7-3
- Exclude MPI builds on s390x
* Sat Sep 30 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.7-2
- Enable mpiuni-fortran-binding on MPI builds
2017-09-27 18:32:30 +00:00
* Tue Sep 26 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.7-1
- Update to 3.7.7
- Move petscvariables/petscrules under a private directory of libdir
* Wed Aug 16 2017 Antonio Trande <sagitterATfedoraproject.org> - 3.7.6-9
- Rebuild for lapack 3.7.1 (moved to 64_ suffix)
* Sun Aug 13 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.6-8
- Option for Fedora < 25 definitively removed
2017-08-13 13:02:16 +00:00
* Sun Aug 13 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.6-7
- Superlu_dist needs parmetis
- Use MPI variables
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2017-05-17 17:03:23 +00:00
* Wed May 17 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.6-4
- Fix Requires packages
* Mon May 15 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.6-3
- Move petscvariables/petscrules under private directory of /usr/share
* Fri May 12 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.6-2
- Move petscvariables/petscrules under private directory of /usr/lib
* Fri May 05 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.6-1
- Update to 3.7.6
- Install petscvariables/petscrules
- Install pkgconfig files
2017-04-09 09:07:59 +00:00
* Sun Apr 09 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.5-4
- Exclude aarch64 on fedora < 25
2017-03-25 13:49:59 +00:00
* Sat Mar 25 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.5-3
- Rebuild for MUMPS-5.1.1
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2017-01-04 11:24:38 +00:00
* Wed Jan 04 2017 Antonio Trande <sagitter@fedoraproject.org> - 3.7.5-1
- Update to 3.7.5
* Fri Dec 02 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-14
- Conditionalize mpich-devel%%{?_isa} (bz#1397192)
2016-11-01 12:59:52 +00:00
* Tue Nov 01 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-13
- New architectures
* Wed Oct 26 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-12
2016-10-26 16:58:59 +00:00
- Fix OpenMPI builds
2016-10-26 16:39:56 +00:00
* Tue Oct 25 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-11
- Fix s390x builds again
2016-10-25 13:05:57 +00:00
* Tue Oct 25 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-10
2016-10-26 16:38:07 +00:00
- Fix s390x builds
2016-10-25 13:05:57 +00:00
2016-10-24 19:12:44 +00:00
* Mon Oct 24 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-9
- Build 64bit-int libs (bz#1382916)
2016-10-24 17:59:33 +00:00
* Sat Oct 22 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-8
- Build 64bit-int libs (bz#1382916)
* Fri Oct 21 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-7
- Install missing header files
* Wed Oct 19 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-6
- Add the -O3 to restore vectorization over the RPM defaults
- Remove gmp support
* Thu Oct 13 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-5
- 64bit-int libs not built (bz#1382916)
- Enable gmp and suitesparse support
* Thu Oct 13 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-4
- superlu and fftw enabled
- Fixed settings of compiler flags
- Disable flags for "hardened" builds
* Mon Oct 10 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-3
- Enabled fftw-mpi support (Fedora > 24)
- Omitted PAPI (obsolete)
- Omitted tetgen support (used with C++)
* Sun Oct 09 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-2
- Default optimization level (-O2)
* Sun Oct 09 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.4-1
- Update to 3.7.4
- PAPI support disabled (upstream advice)
* Sat Oct 08 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-8
- Add tcsh as BR package
- Patched for disabling petscnagupgrade.py check
* Fri Oct 07 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-7
- Use Make for testing
* Thu Oct 06 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-6
- Remove linkage to mpiblacs
- Tests enabled
* Thu Oct 06 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-5
- hwloc/metis (needs parmetis) disabled (upstream advice)
- X support enabled
- Libraries detection disabled
* Wed Oct 05 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-4
- Fix library paths
* Wed Oct 05 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-3
- Fix PTScotch
* Wed Oct 05 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-2
- Disabled fftw support
* Wed Sep 28 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.3-1
- Update to 3.7.3
- Remove module files
* Tue Sep 13 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-12
- Fix MAKE_NP option
- Remove --known-endian option
- Use architecture condition for openblas
- Fix unused-direct-shlib-dependency warnings
* Fri Aug 26 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-11
- Use SuperLU on >=f25 only
* Thu Aug 25 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-10
- Some fixes for epel6 builds
- Add -O3 flag
- Headers installed under a private directory
- Use %%{_modulesdir} macro
- Use 'openblas' instead of 'blas'
* Wed Aug 10 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-9
- Fortran modules moved into devel sub-packages
- Some fixes of SPEC file's lines
- Set compiler/linker flags against PAPI-5.1.1 on epel6
* Thu Jul 28 2016 Dave Love <loveshack@fedoraproject.org> - 3.7.2-8
- Support el6
- Add cgnslib support
* Sat Jul 23 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-7
- Rebuild with Hypre support
* Sun Jul 10 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-6
- Packed additional header files
- Tests performed on EPEL7
* Mon Jun 27 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-5
- Perform tests one-by-one
- Packaged all documentation files
* Mon Jun 27 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-4
- Build OpenMPI/MPICH libraries
- Fix known-endian option
* Mon Jun 27 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-3
- Disable additional libraries
- Build a minimal PETSC
* Fri Jun 24 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-2
- Perform test
* Sun Jun 19 2016 Antonio Trande <sagitter@fedoraproject.org> - 3.7.2-1
- New package