# Maintainer: Martin Diehl # Contributor: Andreas Bilke # Contributor: Myles English # Contributor: Lucas H. Gabrielli pkgname=petsc pkgver=3.13.0 pkgrel=1 _config=linux-c-opt # if --with-debugging=yes is set then PETSC_ARCH is automatically set to #"linux-c-debug" for some things, so the _config should be changed too #_config=linux-c-debug pkgdesc="Portable, extensible toolkit for scientific computation" arch=('i686' 'x86_64') url="https://www.mcs.anl.gov/petsc/" license=('BSD') options=(staticlibs) depends=('python' 'openmpi' 'boost' 'lapack') makedepends=('gcc' 'gcc-fortran' 'cmake') optdepends=('trilinos: support for trilinos' 'ptscotch: support for ptscotch parallel graph partitioning library' 'parmetis: support for parmetis parallel graph partitioning library' 'metis: support for metis graph partitioning library' 'pastix: support for the pastix solver' 'superlu: support for the superlu sparse solver' 'hypre: support for the hypre sparse system solver' 'hdf5: support for the parallel version of hdf5' 'mumps: support for the mumps sparse solver' 'fftw: support for the fftw fast Fourier transform' 'suitesparse: support for the suitesparse sparse matrix libraries' ) install=petsc.install source=(http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${pkgname}-lite-${pkgver/_/-}.tar.gz test_optdepends.sh) sha256sums=('f0ea543a54145c5d1387e25b121c3fd1b1ca834032c5a33f6f1d929e95bdf0e5' 'f127806175b681f4e9cb64aeba4f3fabd9eb92ef945f5542677b255cb3d85913') _install_dir=/opt/petsc/${_config} _petsc_arch="arch-${_config}" build() { _build_dir="${srcdir}/${pkgname}-${pkgver/_/-}" cd ${_build_dir} unset PETSC_ARCH export PETSC_DIR=${_build_dir} CONFOPTS="--with-shared-libraries=1 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --FOPTFLAGS=-O3" CONFOPTS="${CONFOPTS} $(sh ${srcdir}/test_optdepends.sh)" echo ${CONFOPTS} python ./configure \ --prefix=${_install_dir} \ --PETSC_ARCH=${_petsc_arch} \ ${CONFOPTS} make ${MAKEFLAGS} PETSC_DIR=${_build_dir} PETSC_ARCH=${_petsc_arch} all } check() { _build_dir="${srcdir}/${pkgname}-${pkgver/_/-}" cd ${_build_dir} make test } package() { _build_dir="${srcdir}/${pkgname}-${pkgver/_/-}" cd ${_build_dir} echo "make ${MAKEFLAGS} PETSC_DIR=${_build_dir} DESTDIR=${pkgdir} install" export PETSC_DIR=${_build_dir} make ${MAKEFLAGS} PETSC_DIR=${_build_dir} DESTDIR=${pkgdir} install export PETSC_DIR=${_install_dir} # install licence (even though there is no such word as licenses) install -Dm 644 ${_build_dir}/LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE mkdir -p ${pkgdir}/etc/profile.d echo "export PETSC_DIR=${_install_dir}" > ${pkgdir}/etc/profile.d/petsc.sh chmod +x ${pkgdir}/etc/profile.d/petsc.sh # show where the shared libraries are install -dm 755 "${pkgdir}"/etc/ld.so.conf.d/ echo "${_install_dir}/lib" > "${pkgdir}"/etc/ld.so.conf.d/petsc.conf # install pkgconfig settings install -Dm 644 "${_build_dir}/${_petsc_arch}"/lib/pkgconfig/PETSc.pc "${pkgdir}"/usr/share/pkgconfig/PETSc.pc }