The location of scotch headers changed and this needs to be updated in the PKGBUILD for petsc: --with-ptscotch-include=/usr/include/scotch
Search Criteria
Package Details: petsc 3.24.4-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.001347 |
| First Submitted: | 2018-02-24 11:36 (UTC) |
| Last Updated: | 2026-02-21 10:14 (UTC) |
Dependencies (31)
- bison (byacc-bisonAUR, bison-gitAUR)
- fftw-openmpi (fftw-amdAUR)
- gsl (gsl-gitAUR)
- hdf5-openmpi
- hwloc
- lapack (aocl-libflame-aoccAUR, atlas-lapackAUR, blas-aocl-gccAUR, blas-aocl-aoccAUR, blas-mklAUR, openblas-lapackAUR, blas-openblas-gitAUR, aocl-libflameAUR, lapack-gitAUR, blas-openblas)
- libjpeg-turbo (mozjpeg-gitAUR, mozjpegAUR, libjpeg-turbo-gitAUR)
- libyaml (libyaml-gitAUR)
- openmpi (openmpi-gitAUR)
- pastix
- python-mpi4py (python-mpi4py-intelAUR)
- python-numpy (python-numpy-gitAUR, python-numpy-mkl-binAUR, python-numpy1AUR, python-numpy-mkl-tbbAUR, python-numpy-mklAUR)
- scotch (scotch-gitAUR)
- suitesparse
- superlu
- superlu_dist
- zfp
- zlib (zlib-gitAUR, zlib-ng-compat-gitAUR, zlib-ng-compat)
- cmake (cmake3AUR, cmake-gitAUR) (make)
- cython (cython-gitAUR) (make)
- Show 11 more dependencies...
Required by (25)
- 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)
- python-damask (make)
- Show 5 more...
Sources (3)
lahwaacz commented on 2026-02-22 14:16 (UTC)
georgnix commented on 2025-12-29 18:24 (UTC) (edited on 2025-12-29 18:30 (UTC) by georgnix)
% python
Python 3.13.11 (main, Dec 7 2025, 13:01:45) [GCC 15.2.1 20251112] on linux
>>> from petsc4py import PETSc
[...]
ImportError: /opt/petsc/linux-c-opt/lib/libpetsc.so.3.24: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE
As described by https://aur.archlinux.org/packages/petsc?O=20#comment-1005041, linking against libstdc++ fixes this. Patch:
diff --git a/PKGBUILD b/PKGBUILD
index 47a09b7..9095977 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -59,6 +59,9 @@ build() {
--with-zfp=1 \
$(sh ${srcdir}/test_optdepends.sh)"
+ # Link against libstdc++. Fixes python import error undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE.
+ LDFLAGS="$LDFLAGS -lstdc++"
+
echo './configure' ${CONFOPTS}
echo 'CFLAGS='${CFLAGS}
echo 'CXXFLAGS='${CXXFLAGS}
MartinDiehl commented on 2025-11-12 12:03 (UTC)
@carlosal1015: According to the PKGBUILD, scotch-metis does not provide METIS because it's not 100% compatible. So it will probably not work.
I don't know what libesmumps.so from scotch does. Scotch is a dependency for MUMPS, so the current situation looks reasonable to me.
carlosal1015 commented on 2025-11-07 16:57 (UTC) (edited on 2025-11-07 17:12 (UTC) by carlosal1015)
I do not know if libptscotchparmetisv3.so.7.0 could or should works as replacement for /usr/lib/libparmetis.so from parmetis-git. If this is correct, should be nice.
Edited: Since libesmumps.so is provided by scotch. From now parmetis and mumps optional dependencies, it make sense since scotch is already a dependency?
lahwaacz commented on 2025-11-04 17:54 (UTC)
@MartinDiehl superlu_dist is also in extra ;)
lahwaacz commented on 2025-10-29 19:09 (UTC)
I had to do this to build petsc with ptscotch and kokkos:
diff --git a/test_optdepends.sh b/test_optdepends.sh
index 8f9090b..5b21607 100644
--- a/test_optdepends.sh
+++ b/test_optdepends.sh
@@ -11,7 +11,7 @@ CONFOPTS=""
# Kokkos
if [ -f "/usr/lib/libkokkoscore.so" ]; then
- CONFOPTS="${CONFOPTS} --with-kokkos=1"
+ CONFOPTS="${CONFOPTS} --with-kokkos=1 --with-kokkos-lib=libkokkoscore.so --with-kokkos-include=/usr/include/kokkos"
fi
# HYPRE
@@ -38,15 +38,15 @@ if [ -f "/usr/lib/pkgconfig/scalapack.pc" ]; then
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
+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 --with-ptscotch-lib=$SCOTCH_LIBS --with-ptscotch-include=/usr/include"
+fi
# SuperLU_DIST
if [ -f "/usr/lib/pkgconfig/superlu_dist.pc" ]; then
carlosal1015 commented on 2025-10-24 04:22 (UTC)
MartinDiehl commented on 2025-08-28 09:57 (UTC)
@Alad: Thanks. I can certainly fix the permissions. Did you try using the Kokkos package instead of Trilinos? It seems that file locations differ, so Trilinos is not a direct replacement for Kokkos
Alad commented on 2025-08-28 09:46 (UTC)
The linking error mentioned by @carlosal1015 also stops slepc from building:
Checking PETSc installation...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Checking link with code:
#include "petscsnes.h"
int main() {
PetscErrorCode ierr; Vec v; Mat m; KSP k;
ierr = PetscInitializeNoArguments();
ierr = VecCreate(PETSC_COMM_WORLD,&v);
ierr = MatCreate(PETSC_COMM_WORLD,&m);
ierr = KSPCreate(PETSC_COMM_WORLD,&k);
(void)ierr;
return 0;
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Running command:
cd /tmp/slepc-_acdm5dt;/usr/bin/make checklink LINKFLAGS=""
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Output:
/usr/bin/mpicxx -o checklink.o -c -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/home/custompkgs/hpc/petsc/src=/usr/src/debug/petsc -std=gnu++17 -fPIC -I/opt/petsc/linux-c-opt/include -I/usr/include/hypre -I/usr/include/suitesparse -I/usr/include -I/usr/include/superlu_dist -I/usr/include/superlu -I/usr/include/kokkos checklink.c
/usr/bin/mpicxx -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/home/custompkgs/hpc/petsc/src=/usr/src/debug/petsc -o checklink checklink.o -Wl,-rpath,/opt/petsc/linux-c-opt/lib -L/opt/petsc/linux-c-opt/lib -Wl,-rpath,/usr/lib/gcc/x86_64-pc-linux-gnu/15.1.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/15.1.1 -lpetsc /usr/lib/libHYPRE.so -lspqr -lumfpack -lklu -lcholmod -lamd -lsuperlu_dist -ldmumps -lmumps_common -lpord -lpthread -lscalapack -lsuperlu -lfftw3_mpi -lfftw3 /usr/lib/libkokkoscore.so -llapack -lblas -lzfp -lzoltan -lptesmumps -lptscotchparmetisv3 -lptscotch -lptscotcherr -lesmumps -lscotch -lscotcherr -lparmetis -lmetis -lnetcdf -lhdf5_hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -ltriangle -lgsl -lgslcblas -lm -lz -ljpeg -lyaml -lX11 -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++ -lquadmath
/usr/bin/ld: /opt/petsc/linux-c-opt/lib/libpetsc.so: undefined reference to `triangulate(char*, triangulateio*, triangulateio*, triangulateio*)'
collect2: error: ld returned 1 exit status
make: *** [makefile:2: checklink] Error 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ERROR: Unable to link with PETSc
Alad commented on 2025-08-27 23:19 (UTC) (edited on 2025-08-27 23:25 (UTC) by Alad)
Also the permissions on /etc/profile.d/petsc.sh are wrong on my machine:
% ls -ahl /etc/profile.d/petsc.sh
-rwxrwx--x 1 root root 99 28. Aug 00:45 /etc/profile.d/petsc.sh
Using chmod 644 instead of chmod +x avoids this issue -- any files in /etc/profile.d are sourced, not executed directly.
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.