123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- # Maintainer: Martin Diehl <aur@martin-diehl.net>
- # Contributor: Andreas Bilke <abilke at cosy dot sbg dot ac dot at>
- # Contributor: Myles English <myles at rockhead dot biz>
- # Contributor: Lucas H. Gabrielli <heitzmann at gmail dot com>
- pkgver=3.19.5
- pkgrel=1
- pkgname=petsc
- _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://petsc.org"
- license=('BSD')
- options=(staticlibs)
- depends=('python-numpy' 'openmpi' 'boost' 'lapack')
- makedepends=('gcc' 'gcc-fortran' 'cmake' 'cython')
- provides=('petsc4py')
- optdepends=('trilinos: support for trilinos'
- 'fftw: support for the FFTW'
- 'hdf5: support for the HDF5'
- 'hypre: support for the HYPRE'
- 'metis: support for METIS'
- 'mumps: support for MUMPS'
- 'parmetis: support for ParMETIS'
- 'scalapack: support for ScaLAPACK'
- 'scotch: support for Scotch'
- 'suitesparse: support for SuiteSparse'
- 'superlu: support for SuperLU'
- 'superlu_dist: support for SuperLU_DIST',
- 'triangle: support for Triangle'
- 'trilinos: support for the ML package from Trilinos'
- )
- install=petsc.install
- source=("${pkgname}::git+https://gitlab.com/petsc/${pkgname}.git#tag=v${pkgver}"
- test_optdepends.sh)
- sha512sums=('SKIP'
- '88baf173373a19bfca53363013439a388b72587b0585777576d4de97049d7e05480ab941e2a608b2b2fba12fc39e102ecb12ba97ba8daeea26a8e0670e173c9d')
- _install_dir=/opt/petsc/${_config}
- _petsc_arch=arch-${_config}
- prepare(){
- ln -sr "${pkgname}" "${pkgname}"-"${pkgver}"
- }
- build() {
- _build_dir=${srcdir}/${pkgname}-${pkgver}
- cd ${_build_dir}
- export PETSC_ARCH=${_petsc_arch}
- export PETSC_DIR=${_build_dir}
- OPTFLAGS='-O3 -march=native'
- CONFOPTS=(
- --silent --enable-silent-rules
- --ignoreWarnings=1
- --CFLAGS="${generic_flags}"
- --CXXFLAGS="$generic_flags"
- --CPPFLAGS="$generic_flags"
- --FCFLAGS="$generic_flags"
- --F90FLAGS="$generic_flags"
- --FFLAGS="$generic_flags"
- --MAKEFLAGS=${MAKEFLAGS}
- --LDFLAGS=${LDFLAGS}
- --COPTFLAGS=${OPTFLAGS}
- --CXXOPTFLAGS=${OPTFLAGS}
- --FOPTFLAGS=${OPTFLAGS}
- --with-environment-variables=1
- --with-cxx-dialect=auto
- --with-mpi=1
- --with-pic=1
- --with-shared-libraries=1
- --with-zlib=1
- --with-petsc4py=1
- --with-mpi-f90module-visibility=0
- $(sh ${srcdir}/test_optdepends.sh))
- echo ${CONFOPTS[@]}
- python ./configure --prefix=${_install_dir} ${CONFOPTS[@]}
- make -s ${MAKEFLAGS} all
- make DESTDIR=${srcdir}/tmp install
- }
- check() {
- cd ${srcdir}/${pkgname}-${pkgver}
- if [ -z "$(ldconfig -p | grep libcuda.so.1)" ]; then
- export OMPI_MCA_opal_warn_on_missing_libcuda=0
- fi
- export OMPI_MCA_plm_rsh_agent=sh
- PYTHONPATH=${srcdir}/tmp/${_install_dir}/lib:${PYTHONPATH} make check
- }
- package() {
- _build_dir=${srcdir}/${pkgname}-${pkgver}
- mkdir -p ${pkgdir}/${_install_dir}
- cp -Hr ${srcdir}/tmp/* ${pkgdir}
- # 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
- echo export PYTHONPATH=${_install_dir}/lib:'${PYTHONPATH}' >> ${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
- }
|