@MartinDiehl The only changes is using --enable-cxx=1
to make sure that python packages linking works fine and I move --with-bison=1
to test_optdepends.sh file to make scotch dependency works.
Note that petsc use c to compile and its python implementation need C++ that why I add --enable-cxx=1
Search Criteria
Package Details: petsc 3.22.3-1
Package Actions
Git Clone URL: | https://aur.archlinux.org/petsc.git (read-only, click to copy) |
---|---|
Package Base: | petsc |
Description: | Portable, extensible toolkit for scientific computation |
Upstream URL: | https://petsc.org |
Keywords: | computing scientific |
Licenses: | BSD-2-Clause |
Provides: | petsc4py |
Submitter: | heitzmann |
Maintainer: | MartinDiehl |
Last Packager: | MartinDiehl |
Votes: | 20 |
Popularity: | 0.96 |
First Submitted: | 2018-02-24 11:36 (UTC) |
Last Updated: | 2025-02-05 08:49 (UTC) |
Dependencies (29)
- fftw-openmpi
- gsl (gsl-gitAUR)
- hdf5-openmpi
- lapack (aocl-libflame-aoccAUR, lapack-gitAUR, atlas-lapackAUR, blas-aocl-gccAUR, blas-aocl-aoccAUR, blas-mklAUR, aocl-libflameAUR, openblas-lapackAUR, blas-openblas)
- libjpeg-turbo (mozjpeg-gitAUR, libjpeg-turbo-gitAUR, mozjpegAUR)
- libyaml (libyaml-gitAUR)
- netcdf-openmpi
- openmpi (openmpi-gitAUR)
- python-mpi4py (python-mpi4py-intelAUR)
- python-numpy (python-numpy-gitAUR, python-numpy1AUR, python-numpy-mkl-binAUR, python-numpy-mkl-tbbAUR, python-numpy-mklAUR)
- suitesparse
- superlu
- zfp
- zlib (zlib-ng-compat-gitAUR, zlib-gitAUR, zlib-ng-compat)
- cmake (cmake-gitAUR, cmake3AUR) (make)
- cython (cython-gitAUR) (make)
- gcc (gcc-gitAUR, gccrs-gitAUR, gcc11AUR, gcc-snapshotAUR) (make)
- gcc-fortran (gcc-fortran-gitAUR, gcc11-fortranAUR, gcc-fortran-snapshotAUR) (make)
- python-setuptools (make)
- hypreAUR (optional) – support for HYPRE
- kokkosAUR (trilinosAUR) (optional) – support Kokkos
- metisAUR (metis-gitAUR) (optional) – support for METIS
- mumpsAUR (mumps-cmakeAUR, mumps-parAUR, mumps-seqAUR) (optional) – support for MUMPS
- parmetisAUR (parmetis-gitAUR) (optional) – support for ParMETIS
- scalapackAUR (optional) – support for ScaLAPACK
- scotchAUR (scotch-gitAUR) (optional) – support for Scotch
- superlu_distAUR (optional) – support for SuperLU_DIST
- triangleAUR (optional) – support for Triangle
- zoltanAUR (trilinosAUR) (optional) – support for zoltan
Required by (26)
- coolfluid-svn
- damask (make)
- damask-grid
- damask-grid (make)
- damask-mesh
- damask-mesh (make)
- deal-ii (optional)
- dolfin
- dolfin-hpc
- dolfinx
- dolfinx-git
- fenics-basix-git
- freefem (optional)
- libmesh-petsc
- petsc4foam
- pism
- precice
- precice-git
- python-basix-git
- python-clawpack (optional)
- Show 6 more...
Sources (2)
medaminezghal commented on 2025-04-15 10:09 (UTC)
medaminezghal commented on 2025-04-15 10:06 (UTC)
@MartinDiehl This is an updating test_optdepends.sh file:
#!/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
# Kokkos
if [ -f "/usr/lib/libkokkoscore.so" ]; then
CONFOPTS="${CONFOPTS} --with-kokkos=1"
fi
# HYPRE
if [ -f "/usr/lib/libHYPRE.so" ]; then
CONFOPTS="${CONFOPTS} --with-hypre-lib=/usr/lib/libHYPRE.so --with-hypre-include=/usr/include/hypre"
fi
# (Par)METIS
if [ -f "/usr/include/metis.h" ]; then
CONFOPTS="${CONFOPTS} --with-metis=1"
if [ -f "/usr/include/parmetis.h" ]; then
CONFOPTS="${CONFOPTS} --with-parmetis=1"
fi
fi
# MUMPS
if [ -f "/usr/lib/libmumps_common.so" ]; then
CONFOPTS="${CONFOPTS} --with-mumps=1"
fi
# PaStiX https://gitlab.com/petsc/petsc/-/issues/1259
#if [ -f "/usr/lib/pkgconfig/pastic.pc" ]; then
# CONFOPTS="${CONFOPTS} --with-pastix=1"
#fi
# ScaLAPACK
if [ -f "/usr/lib/pkgconfig/scalapack.pc" ]; then
CONFOPTS="${CONFOPTS} --with-scalapack=1"
fi
# Scotch
if [ -f /usr/include/scotch.h ]; 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-bison=1"
fi
# SuperLU_DIST
if [ -f "/usr/lib/pkgconfig/superlu_dist.pc" ]; then
CONFOPTS="${CONFOPTS} --with-superlu_dist-lib=-lsuperlu_dist --with-superlu_dist-include=/usr/include/superlu_dist"
fi
# Triangle
if [ -f "/usr/lib/libtriangle.so" ]; then
CONFOPTS="${CONFOPTS} --with-triangle=1"
fi
# Zoltan
if [ -f "/usr/lib/libzoltan.so" ]; then
CONFOPTS="${CONFOPTS} --with-zoltan=1"
fi
echo "${CONFOPTS}"
medaminezghal commented on 2025-04-15 10:05 (UTC)
@MartinDiehl This is a working PKGBUILD file for petsc 3.23.0:
# 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.23.0
pkgrel=1
pkgname=petsc
pkgdesc="Portable, extensible toolkit for scientific computation"
arch=('i686' 'x86_64')
url="https://petsc.org"
license=('BSD-2-Clause')
options=(staticlibs)
# note: zlib is not really needed by PETSc, but netcdf requires an HDF5 version with zlib
depends=('openmpi' 'lapack' 'hdf5-openmpi' 'fftw-openmpi' 'superlu' 'suitesparse' 'libyaml' 'gsl' 'libjpeg-turbo' 'netcdf-openmpi' 'zfp' 'zlib'
'python-numpy' 'python-mpi4py')
makedepends=('gcc' 'gcc-fortran' 'cmake' 'cython' 'python-setuptools')
provides=('petsc4py')
optdepends=(
'hypre: support for HYPRE'
'kokkos: support Kokkos'
'metis: support for METIS'
'mumps: support for MUMPS'
'parmetis: support for ParMETIS'
'scalapack: support for ScaLAPACK'
'scotch: support for Scotch'
'superlu_dist: support for SuperLU_DIST'
'triangle: support for Triangle'
'zoltan: support for zoltan'
)
install=petsc.install
source=(http://web.cels.anl.gov/projects/petsc/download/release-snapshots/${pkgname}-${pkgver}.tar.gz
test_optdepends.sh)
sha512sums=('e5cd7649451277ff5c9dedac4948be12cd1465261f872319a8f1c42842a51a817cb36f4a36f02ccb1d8c13e4cfb6fd4bb36c297f74b22129d288001769a6d66b'
'809e956a60be3604db08d523faba0de26f97d63e9ceb174e06202ca6f742df917670821246349974662d8e98f7a166c107d2f1627a6aa256a4b69efd1576b891')
PETSC_ARCH=linux-c-opt
_install_dir=/opt/petsc/${PETSC_ARCH}
build() {
cd ${pkgname}-${pkgver}
export PETSC_DIR=${PWD}
export PETSC_ARCH=${PETSC_ARCH}
CONFOPTS="--enable-cxx=1 \
--with-shared-libraries=1 \
--with-petsc4py=1 \
--with-mpi-f90module-visibility=0 \
--with-cmake=0 \
--with-mpi-dir=/usr \
--with-zfp=1 \
--with-netcdf=1 \
--with-libjpeg=1 \
--with-yaml=1 \
--with-fftw=1 \
--with-gsl=1 \
--with-zlib=1 \
--with-superlu-lib=-lsuperlu --with-superlu-include=/usr/include/superlu \
--with-suitesparse=1 \
--with-hdf5=1 --with-hdf5-fortran-bindings=1 \
$(sh ${srcdir}/test_optdepends.sh)"
echo './configure' ${CONFOPTS}
echo 'CFLAGS='${CFLAGS}
echo 'CXXFLAGS='${CXXFLAGS}
echo 'FFLAGS='${FFLAGS}
echo 'LDFLAGS='${LDFLAGS}
echo 'MAKEFLAGS='${MAKEFLAGS}
./configure --prefix=${_install_dir} ${CONFOPTS} \
"CFLAGS=$CFLAGS" \
"CXXFLAGS=$CXXFLAGS" \
"FFLAGS=$FFLAGS" \
"LDFLAGS=$LDFLAGS" \
"MAKEFLAGS=$MAKEFLAGS"
make all
}
package() {
cd ${pkgname}-${pkgver}
export PETSC_DIR=${PWD}
export PETSC_ARCH=${PETSC_ARCH}
make DESTDIR=${pkgdir} install
install -Dm 644 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 ${PETSC_ARCH}/lib/pkgconfig/PETSc.pc ${pkgdir}/usr/share/pkgconfig/PETSc.pc
}
MartinDiehl commented on 2025-04-04 11:00 (UTC)
@ilovekiruna: Did you recompile PETSc?
ilovekiruna commented on 2025-04-04 10:57 (UTC)
It looks like the latest package still depends on libsuperlu in version 6. However, in the extra repo, the latest package is version 7. Therefore an ldd on libpetsc ldd /opt/petsc/linux-c-opt/lib/libpetsc.so.3.22
gives libsuperlu.so.6 => not found
.
medaminezghal commented on 2025-02-05 14:04 (UTC)
@MartinDiehl Could you send me your /etc/makepkg.conf file in the email? Because even after the update the same problem happens again and I need the same fix. Maybe it is related to this file in my computer.
MartinDiehl commented on 2025-01-03 13:54 (UTC)
@medaminezghal
thanks. Good to see that you fixed it. I can't reproduce the error here and will try on other setups later.
medaminezghal commented on 2025-01-03 07:35 (UTC)
@MartinDiehl I found a fix
./configure --prefix=${_install_dir} ${CONFOPTS} \
"CFLAGS=$CFLAGS" \
"CXXFLAGS=$CXXFLAGS" \
"FFLAGS=$FFLAGS" \
"LDFLAGS=$LDFLAGS -lstdc++" \
"MAKEFLAGS=$MAKEFLAGS"
Just add the -lstdc++
to the LDFLAGS
medaminezghal commented on 2025-01-02 17:53 (UTC)
@MartinDiehl I’ve already done the rebuild for all packages in my system to python 3.13 but this module has an issue when I import it. I found it by accident when I try to install donfinx. For that, I tried to test an example using the library in python and found this error.
MartinDiehl commented on 2025-01-02 16:12 (UTC)
@medaminezghal: maybe you need to rebuild for Python 3.13
Pinned Comments
MartinDiehl commented on 2022-10-06 10:26 (UTC)
@jrohwer
When building PETSc (more specifically, petsc4py), one test (ex100 from ksp) will fail if a previous (major) version is installed. I could not figure out why this happens. The solution would be to build in a clean root (which is a little bit complicated due to dependency on other AUR packages) or simply uninstall the old version before.
Any help to solve this issue is welcomed.