% 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}
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.