diff options
author | myles | 2015-08-31 01:27:49 +0100 |
---|---|---|
committer | myles | 2015-08-31 01:31:47 +0100 |
commit | 92b68217aba1e7690bfb7fccbc5020676390ec22 (patch) | |
tree | d85d3c6e23134134324085b1cc93e6eacfe5ddcb | |
parent | da156fa933ffaa5448c75620154d47d4414c19d1 (diff) | |
download | aur-92b68217aba1e7690bfb7fccbc5020676390ec22.tar.gz |
Updated to 3.6.1
thanks to getzze
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 89 | ||||
-rw-r--r-- | test_optdepends.sh | 83 |
3 files changed, 152 insertions, 36 deletions
@@ -1,6 +1,6 @@ pkgbase = petsc pkgdesc = Portable, extensible toolkit for scientific computation - pkgver = 3.6.0 + pkgver = 3.6.1 pkgrel = 1 url = http://www.mcs.anl.gov/petsc/petsc-as install = petsc.install @@ -14,9 +14,19 @@ pkgbase = petsc depends = openmpi depends = boost depends = lapack + optdepends = trilinos: support for trilinos + optdepends = ptscotch: support for ptscotch parallel graph partitioning library + optdepends = parmetis: support for parmetis parallel graph partitioning library + optdepends = metis: support for metis graph partitioning library + optdepends = pastix: support for the pastix solver + optdepends = superlu: support for the superlu sparse solver + optdepends = hdf5: support for the parallel version of hdf5 + optdepends = mumps: support for the mumps sparse solver options = staticlibs - source = http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.6.0.tar.gz - md5sums = f0dcbf25a8dd7f3069c1f094338c5263 + source = http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.6.1.tar.gz + source = test_optdepends.sh + md5sums = 28f842697159e16e2978732480571147 + md5sums = 4a82df77c43713f4bc698532db7ae02a pkgname = petsc @@ -1,11 +1,11 @@ # Maintainer: Myles English <myles at rockhead dot biz> pkgname=petsc -pkgver=3.6.0 +pkgver=3.6.1 pkgrel=1 -_config=arch-linux2-cxx-opt +_config=linux-c-opt # if --with-debugging=yes is set then PETSC_ARCH is automatically set to -#"arch-linux2-cxx-debug" for some things, so the _config should be changed too -#_config=arch-linux2-cxx-debug +#"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="http://www.mcs.anl.gov/petsc/petsc-as" @@ -13,62 +13,85 @@ license=('MIT compatible') options=(staticlibs) depends=('python2' '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' + 'hdf5: support for the parallel version of hdf5' + 'mumps: support for the mumps sparse solver' + ) install=petsc.install -source=(http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${pkgname}-${pkgver/_/-}.tar.gz) -md5sums=('f0dcbf25a8dd7f3069c1f094338c5263') +source=(http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${pkgname}-${pkgver/_/-}.tar.gz test_optdepends.sh) +md5sums=('28f842697159e16e2978732480571147' + '4a82df77c43713f4bc698532db7ae02a') _install_dir=/opt/petsc/${_config} +petsc_arch="arch-${_config}" # to avoid: "make[2]: *** No rule to make target `libptesmumps.a', needed by `main_esmumps'. Stop." export MAKEFLAGS="-j1" +prepare() { + _build_dir="${srcdir}/${pkgname}-${pkgver/_/-}" + + # force using python2 + find ${srcdir} -name "*" -type f -exec \ + sed -i 's#\(/usr/bin/env \|/usr/bin/\)python[2-3]*#\1python2#' {} \; + + # install external libraries in _build_dir instead of the prefix + sed -i 's/self.publicInstall = 1/self.publicInstall = 0/' ${_build_dir}/config/BuildSystem/config/package.py +} + build() { _build_dir="${srcdir}/${pkgname}-${pkgver/_/-}" cd ${_build_dir} - #patch -Np1 -i ${startdir}/patch_debug.diff unset PETSC_ARCH export PETSC_DIR=${_build_dir} - find ${srcdir} -name "*" -type f -exec \ - sed -i 's#\(/usr/bin/env \|/usr/bin/\)python[2-3]*#\1python2#' {} \; - - CONFOPTS="--with-shared-libraries=1 --with-clanguage=C++ --COPTFLAGS=-O2 --CXXOPTFLAGS=-O2" + CONFOPTS="--with-shared-libraries=1 --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3" - # External downloads - for external_pkg in ptscotch scalapack metis parmetis superlu mumps pastix hypre suitesparse; do - CONFOPTS="${CONFOPTS} --download-${external_pkg}=yes" - done + # test for the optional dependencies for petsc + CONFOPTS="${CONFOPTS} $(sh ${srcdir}/test_optdepends.sh)" - if [ "${TRILINOS_DIR}" ]; then - CONFOPTS="${CONFOPTS} --with-ml=1 --with-ml-lib=${TRILINOS_DIR}/lib/libml.so --with-ml-include=${TRILINOS_DIR}/include" - fi + # to enable use of type() + #CONFOPTS="${CONFOPTS} --with-fortran-datatypes --FOPTFLAGS=-O2" - # Arch specific - CONFOPTS="${CONFOPTS} --with-boost=1 --with-boost-dir=/usr" + echo ${CONFOPTS} + python2 ./configure \ + --prefix=${_install_dir} \ + --PETSC_ARCH=${petsc_arch} \ + ${CONFOPTS} - # to enable use of type() - CONFOPTS="${CONFOPTS} --with-fortran-datatypes --FOPTFLAGS=-O2" + make ${MAKEFLAGS} PETSC_DIR=${_build_dir} PETSC_ARCH=${petsc_arch} all +} - python2 ./configure --prefix=${_install_dir} ${CONFOPTS} +check() { + _build_dir="${srcdir}/${pkgname}-${pkgver/_/-}" + cd ${_build_dir} - make + make test } package() { _build_dir="${srcdir}/${pkgname}-${pkgver/_/-}" + _dest_dir="${pkgdir}${_install_dir}" + cd ${_build_dir} + echo "make ${MAKEFLAGS} PETSC_DIR=${_build_dir} DESTDIR=${_dest_dir} install" export PETSC_DIR=${_build_dir} - make install DESTDIR=${pkgdir}${_install_dir} # > /dev/null - - sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/lib/pkgconfig/PETSc.pc" - sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/conf/variables" - sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/conf/petscvariables" - sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/conf/rules" - sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/include/petscconf.h" - sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/include/petscconfiginfo.h" - sed -i 's#'"${pkgdir}"'##g' "${pkgdir}${_install_dir}/conf/petscrules" + make ${MAKEFLAGS} PETSC_DIR=${_build_dir} DESTDIR=${_dest_dir} install # > /dev/null + + sed -i 's#'"${_build_dir}"'#'"${_install_dir}"'#g' "${_dest_dir}/lib/pkgconfig/PETSc.pc" + sed -i 's#'"${_build_dir}"'#'"${_install_dir}"'#g' "${_dest_dir}/lib/petsc/conf/variables" + sed -i 's#'"${_build_dir}"'#'"${_install_dir}"'#g' "${_dest_dir}/lib/petsc/conf/petscvariables" + sed -i 's#'"${_build_dir}"'#'"${_install_dir}"'#g' "${_dest_dir}/lib/petsc/conf/rules" + sed -i 's#'"${_build_dir}"'#'"${_install_dir}"'#g' "${_dest_dir}/include/petscconf.h" + sed -i 's#'"${_build_dir}"'#'"${_install_dir}"'#g' "${_dest_dir}/include/petscconfiginfo.h" + sed -i 's#'"${_build_dir}"'#'"${_install_dir}"'#g' "${_dest_dir}/lib/petsc/conf/petscrules" export PETSC_DIR=${_install_dir} diff --git a/test_optdepends.sh b/test_optdepends.sh new file mode 100644 index 000000000000..6e964dedaa49 --- /dev/null +++ b/test_optdepends.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +# Test if external packages for PETSC are installed + +CONFOPTS="" + +## External downloads +#for external_pkg in hypre; do + #CONFOPTS="${CONFOPTS} --download-${external_pkg}=1" +#done + +# Add hypre support +if [ -f "/usr/lib/libHYPRE.so" ]; then + CONFOPTS="${CONFOPTS} --with-hypre=1" +fi + +# Add mumps support +if [ -f "/usr/lib/libmumps_common.so" ]; then + CONFOPTS="${CONFOPTS} --with-mumps=1" +fi + +# Add hdf5 support +if [[ "$(h5stat -V)" ]]; then + CONFOPTS="${CONFOPTS} --with-hdf5=1" +fi + +# Add scalapack support +if [ -f "/usr/lib/pkgconfig/scalapack.pc" ]; then + CONFOPTS="${CONFOPTS} --with-scalapack=1" +fi + +# Add suitesparse support +if [ -f "/usr/include/SuiteSparse_config.h" ]; then + CONFOPTS="${CONFOPTS} --with-suitesparse=1" +fi + +# Add metis support +if [ -f "/usr/include/metis.h" ]; then + CONFOPTS="${CONFOPTS} --with-metis=1" + # Add parmetis support + if [ -f "/usr/include/parmetis.h" ]; then + CONFOPTS="${CONFOPTS} --with-parmetis=1" + fi +fi + +# Add scotch support +SCOTCH_DIR="/usr/include/scotch" +if [ -d "${SCOTCH_DIR}" ]; then + SCOTCH_LIBS="libesmumps.so,libptscotch.so,libptscotcherr.so,libscotch.so,libscotcherr.so" + # Include bzip2 if scotch was build with bzip2 support + if [ -f /usr/include/bzlib.h ];then + SCOTCH_LIBS="${SCOTCH_LIBS},libbz2.so" + fi + SCOTCH_LIBS="[${SCOTCH_LIBS}]" + CONFOPTS="${CONFOPTS} --with-ptscotch=1 --with-ptscotch-lib=${SCOTCH_LIBS} --with-ptscotch-include=${SCOTCH_DIR}" +fi + +# Add superlu support +SUPERLU_DIR="/usr/include/superlu" +if [ -d "${SUPERLU_DIR}" ]; then + CONFOPTS="${CONFOPTS} --with-superlu=1 --with-superlu-lib=-lsuperlu --with-superlu-include=${SUPERLU_DIR}" +fi + +# Add pastix support +PASTIX_CONF=$(which pastix-conf) +if [ -f "${PASTIX_CONF}" ]; then + PASTIX_DIR="$($PASTIX_CONF --incs | sed 's/-I//')" + if [ ! -d ${PASTIX_DIR} ]; then + PASTIX_DIR="[]" + fi + #PASTIX_LIBS="$($PASTIX_CONF --libs)" + PASTIX_LIBS="[libpastix.a,librt.so,libhwloc.so,libpthread.a]" + CONFOPTS="${CONFOPTS} --with-pastix=1 --with-pastix-lib=${PASTIX_LIBS} --with-pastix-include=${PASTIX_DIR}" +fi + +# Add trilinos support +if [ "${TRILINOS_DIR}" ]; then + CONFOPTS="${CONFOPTS} --with-ml=1" + # Add boost support (may be useful for trilinos) + #CONFOPTS="${CONFOPTS} --with-boost=1" +fi + +echo "${CONFOPTS}" |