| tFix petsc4py build - petsc-git-PKGBUILD - build template for non-complex PETSC… | |
| git clone git://src.adamsgaard.dk/petsc-git-PKGBUILD | |
| Log | |
| Files | |
| Refs | |
| --- | |
| commit e87f7eb14461b0f0ebda9a18ac29d34040b4a8c4 | |
| parent 9e588e9dcb2f1284e64a72619878342e58951ff1 | |
| Author: Lucas Heitzmann Gabrielli <[email protected]> | |
| Date: Wed, 3 Feb 2021 17:03:02 -0300 | |
| Fix petsc4py build | |
| Diffstat: | |
| M .SRCINFO | 4 +++- | |
| M PKGBUILD | 63 +++++++++++++++++------------… | |
| A petsc4py.patch | 11 +++++++++++ | |
| 3 files changed, 49 insertions(+), 29 deletions(-) | |
| --- | |
| diff --git a/.SRCINFO b/.SRCINFO | |
| t@@ -1,7 +1,7 @@ | |
| pkgbase = petsc-git | |
| pkgdesc = Portable, extensible toolkit for scientific computation (ext… | |
| pkgver = 20210203 | |
| - pkgrel = 1 | |
| + pkgrel = 2 | |
| url = https://gitlab.com/petsc/petsc | |
| install = petsc.install | |
| arch = i686 | |
| t@@ -34,7 +34,9 @@ pkgbase = petsc-git | |
| provides = petsc | |
| conflicts = petsc | |
| source = petsc::git+https://gitlab.com/petsc/petsc.git#branch=release | |
| + source = petsc4py.patch | |
| sha256sums = SKIP | |
| + sha256sums = b0f4a9d33e9c3ba3f51b81808f04ec66091b0a29cf99cac6392e97232… | |
| pkgname = petsc-git | |
| diff --git a/PKGBUILD b/PKGBUILD | |
| t@@ -2,7 +2,7 @@ | |
| pkgname=petsc-git | |
| pkgver=20210203 | |
| -pkgrel=1 | |
| +pkgrel=2 | |
| _config=linux-c-opt | |
| pkgdesc="Portable, extensible toolkit for scientific computation (external dow… | |
| provides=(petsc) | |
| t@@ -19,10 +19,14 @@ optdepends=("opencl: GPU computing" | |
| "libyaml: YAML configuration support" | |
| "libx11: GUI tools") | |
| install=petsc.install | |
| -source=(petsc::git+https://gitlab.com/petsc/petsc.git#branch=release) | |
| -sha256sums=('SKIP') | |
| +source=(petsc::git+https://gitlab.com/petsc/petsc.git#branch=release | |
| + petsc4py.patch) | |
| +sha256sums=('SKIP' | |
| + 'b0f4a9d33e9c3ba3f51b81808f04ec66091b0a29cf99cac6392e97232edec768') | |
| _petsc_arch="arch-${_config}" | |
| +_petsc_dir='/usr/local/petsc' | |
| +_install_dir="${_petsc_dir}/${_config}" | |
| generic_flags="-fPIC -fopenmp -O3 -march=x86-64 -mtune=generic" | |
| # generic_flags="-fPIC -fopenmp -O3 -march=amdfam10 -mtune=generic" | |
| t@@ -48,6 +52,7 @@ pkgver() { | |
| prepare() { | |
| cd "${srcdir}/petsc" | |
| sed -i 's-\(self.publicInstall[^=]*=[[:space:]]\)[^#]*-\10 -g' config/Buil… | |
| + patch -p1 < ../petsc4py.patch | |
| } | |
| t@@ -126,13 +131,11 @@ build() { | |
| # "linux-c-debug" for some things, so _config should be changed to "linux-… | |
| #CONFOPTS="${CONFOPTS} --with-debugging=1" | |
| - dirpkg=${srcdir}/petsc/${_petsc_arch}/externalpackages/ | |
| - | |
| export PETSC_DIR="${srcdir}/petsc" | |
| export PETSC_ARCH="${_petsc_arch}" | |
| python ./configure LDFLAGS="$LDFLAGS" \ | |
| - --prefix=/usr/petsc/${_config} \ | |
| + --prefix="${_petsc_dir}/${_config}" \ | |
| --MAKEFLAGS="$MAKEFLAGS" \ | |
| $(for (( i=1; i<=${#CONFOPTS[@]}; i++)); do echo "${CONFOPTS[$i]}";… | |
| make clean | |
| t@@ -143,13 +146,15 @@ package() { | |
| cd petsc | |
| _build_dir="${srcdir}/petsc" | |
| - _install_dir=/usr/petsc/${_config} | |
| export PETSC_DIR=${_build_dir} | |
| export PETSC_ARCH="${_petsc_arch}" | |
| make DESTDIR="${pkgdir}" install | |
| + # Fix petsc4py runpath | |
| + chrpath -r "${_install_dir}/lib:/usr/lib/openmpi" ${_build_dir}/${_petsc_a… | |
| + | |
| # install license | |
| install -Dm 644 ${_build_dir}/LICENSE ${pkgdir}/usr/share/licenses/${pkgna… | |
| t@@ -169,28 +174,30 @@ package() { | |
| sed -i "s#${_rem_dir}#${_install_dir}#g" "${pkgdir}${_install_dir}/lib/pet… | |
| sed -i "s#${_rem_dir}#${_install_dir}#g" "${pkgdir}${_install_dir}/lib/pet… | |
| sed -i "s#${_rem_dir}#${_install_dir}#g" "${pkgdir}${_install_dir}/lib/pet… | |
| + sed -i "s#${_rem_dir}#${_install_dir}#g" "${pkgdir}${_install_dir}/lib/pet… | |
| + sed -i "s#${_build_dir}#${_petsc_dir}#g" "${_rem_dir}/lib/petsc4py/lib/pet… | |
| # install petsc4py | |
| _python_package="${pkgdir}/usr/lib/python3.9/site-packages" | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/PKG-INFO" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/SOURCES.tx… | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/dependency… | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/not-zip-sa… | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/requires.t… | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/top_level.… | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/__init__.py" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/__main__.py" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/PETSc.pxd" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/PETSc.py" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/__init__.pxd" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/__init__.pyx" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/numpy.h" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.h" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.i" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.PETSc_… | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.PETSc.… | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/PETSc.pxd" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/lib/__init__.py" … | |
| - install -Dm 644 "${_rem_dir}/lib/petsc4py/lib/petsc.cfg" … | |
| - install -Dm 755 "${_rem_dir}/lib/petsc4py/lib/PETSc.cpython-39-x86_64-linu… | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/PKG-INFO" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/SOURCES.tx… | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/dependency… | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/not-zip-sa… | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/requires.t… | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py-3.14.1-py3.9.egg-info/top_level.… | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/__init__.py" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/__main__.py" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/PETSc.pxd" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/PETSc.py" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/__init__.pxd" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/__init__.pyx" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/numpy.h" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.h" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.i" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.PETSc_… | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/petsc4py.PETSc.… | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/include/petsc4py/PETSc.pxd" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/lib/__init__.py" … | |
| + install -Dm 644 "${_rem_dir}/lib/petsc4py/lib/petsc.cfg" … | |
| + install -Dm 755 "${_rem_dir}/lib/petsc4py/lib/${_petsc_arch}/PETSc.cpython… | |
| } | |
| diff --git a/petsc4py.patch b/petsc4py.patch | |
| t@@ -0,0 +1,11 @@ | |
| +--- a/config/BuildSystem/config/packages/petsc4py.py | |
| ++++ b/config/BuildSystem/config/packages/petsc4py.py | |
| +@@ -46,7 +46,7 @@ | |
| + | |
| + # if installing prefix location then need to set new value for PETSC_DIR/… | |
| + if self.argDB['prefix'] and not 'package-prefix-hash' in self.argDB: | |
| +- newdir = 'PETSC_DIR='+os.path.abspath(os.path.expanduser(self.argDB['p… | |
| ++ newdir = 'MPICC=${PCC} ' | |
| + else: | |
| + newdir = 'MPICC=${PCC} ' | |
| + |