@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
Search Criteria
Package Details: petsc 3.23.6-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.060351 |
First Submitted: | 2018-02-24 11:36 (UTC) |
Last Updated: | 2025-08-28 13:49 (UTC) |
Dependencies (29)
- fftw-openmpi (fftw-amdAUR)
- gsl (gsl-gitAUR)
- hdf5-openmpi
- lapack (aocl-libflame-aoccAUR, atlas-lapackAUR, blas-aocl-gccAUR, blas-aocl-aoccAUR, blas-mklAUR, aocl-libflameAUR, blas-openblas-gitAUR, openblas-lapackAUR, lapack-gitAUR, blas-openblas)
- libjpeg-turbo (mozjpeg-gitAUR, mozjpegAUR, libjpeg-turbo-gitAUR)
- libyaml (libyaml-gitAUR)
- netcdf-openmpi
- openmpi (openmpi-gitAUR)
- python-mpi4py (python-mpi4py-intelAUR)
- python-numpy (python-numpy-gitAUR, python-numpy1AUR, python-numpy-mklAUR, python-numpy-mkl-binAUR, python-numpy-mkl-tbbAUR)
- suitesparse
- superlu
- zfp
- zlib (zlib-gitAUR, zlib-ng-compat-gitAUR, zlib-ng-compat)
- cmake (cmake3AUR, cmake-gitAUR) (make)
- cython (cython-gitAUR) (make)
- gcc (gcc-gitAUR, gccrs-gitAUR, gcc-snapshotAUR) (make)
- gcc-fortran (gcc-fortran-gitAUR, gcc-fortran-snapshotAUR) (make)
- python-setuptools (make)
- hypreAUR (optional) – support for HYPRE
- Show 9 more dependencies...
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)
MartinDiehl commented on 2025-08-28 09:57 (UTC)
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.
Alad commented on 2025-08-27 22:40 (UTC) (edited on 2025-08-27 22:46 (UTC) by Alad)
Getting an error with trilinos
installed:
TESTING: checkInclude from config.headers(config/BuildSystem/config/headers.py:89)
*********************************************************************************************
UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):
---------------------------------------------------------------------------------------------
Unable to find kokkos in default locations!
Perhaps you can specify with --with-kokkos-dir=<directory>
If you do not want kokkos, then give --with-kokkos=0
You might also consider using --download-kokkos instead
*********************************************************************************************
==> ERROR: A failure occurred in build().
Aborting...
==> Removing installed dependencies...
Going by configure.log
the test searches for /usr/include/Kokkos_Macros.hpp
when the trilinos
package installs it to /usr/include/kokkos/Kokkos_Macros.hpp
. The fix is to use
if [ -f "/usr/lib/libkokkoscore.so" ]; then
CONFOPTS="${CONFOPTS} --with-kokkos=1 --with-kokkos-lib=/usr/lib/libkokkoscore.so --with-kokkos-include=/usr/include/kokkos"
fi
in test_optdepends.sh
.
carlosal1015 commented on 2025-08-10 23:55 (UTC)
I noticed that if I installed before triangle
and later petsc
, this test failed. But if only install petsc
in a clean environmnent only with base-devel
, no error arises.
$ source /etc/profile.d/petsc.sh
$ cp -R /opt/petsc/linux-c-opt/share/petsc/examples .
$ cd examples/src/dm/dt/dualspace/impls/lagrange/tests/
$ make ex1
/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 -I/opt/petsc/linux-c-opt/include -I/usr/include/suitesparse -I/usr/include -I/usr/include/superlu -Wl,-export-dynamic ex1.c -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 -lspqr -lumfpack -lklu -lcholmod -lamd -lsuperlu -lfftw3_mpi -lfftw3 -llapack -lblas -lzfp -lnetcdf -lhdf5_hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -ltriangle -lgsl -lgslcblas -lm -lz -ljpeg -lyaml -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++ -lquadmath -o ex1
/usr/sbin/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: *** [/opt/petsc/linux-c-opt/lib/petsc/conf/rules:217: ex1] Error 1
carlosal1015 commented on 2025-08-10 20:25 (UTC)
After namcap petsc-3.23.5-1-x86_64.pkg.tar.zst
, we have
petsc W: Referenced python module 'scipy.sparse' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/PetscBinaryIO.py'])
petsc W: Referenced python module 'lxml.objectify' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/xml2flamegraph.py'])
petsc W: Referenced python module 'configure' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/conf/reconfigure-linux-c-opt.py'])
petsc W: Referenced python module 'pandas' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/petsc_tas_analysis.py', 'opt/petsc/linux-c-opt/share/petsc/bin/dmnetwork_view.py'])
petsc W: Referenced python module 'scipy.io' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/PetscBinaryIO.py'])
petsc W: Referenced python module 'h5py' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/petsc_gen_xdmf.py'])
petsc W: Referenced python module 'matplotlib' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/share/petsc/bin/dmnetwork_view.py'])orials/ex100.py'])
petsc W: Referenced python module 'pyvista' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc4py/lib/_pytypes/viewer/petscpyvista.py'])
petsc W: Referenced python module 'matplotlib.pyplot' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/petsc_tas_analysis.py', 'opt/petsc/linux-c-opt/lib/petsc/bin/PetscBinaryIOTrajectory.py', 'opt/petsc/linux-c-opt/share/petsc/bin/dmnetwork_view.py'])
petsc W: Referenced python module 'matplotlib.collections.LineCollection' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/share/petsc/bin/dmnetwork_view.py'])
petsc W: Referenced python module 'scipy.sparse.csr_matrix' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/PetscBinaryIO.py'])
petsc W: Referenced python module 'matplotlib.collections.CircleCollection' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/share/petsc/bin/dmnetwork_view.py'])
petsc W: Referenced python module 'distutils.version.LooseVersion' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/petscnagupgrade.py'])
petsc W: Referenced python module 'requests' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/saws/SAWs.py'])
petsc W: Referenced python module 'urllib2.urlopen' is an uninstalled dependency (needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/petscnagupgrade.py'])
petsc E: Dependency python-packaging detected and not included (python modules ['packaging.version.Version'] needed in files ['opt/petsc/linux-c-opt/lib/petsc/bin/petscnagupgrade.py'])
From these scripts in opt/petsc/linux-c-opt/lib/petsc/bin/
, I think that if the import
statement is in a try: ... except
,
then the referenced python module should be an optional dependency in PKGBUILD. So (python-scipy, python-lxml, python-pandas python-matplotlib python-requests)
are optional and (python-h5py-openmpi python-pyvista)
are dependencies.
medaminezghal commented on 2025-04-26 12:29 (UTC)
@MartinDiehl I’ve tested both and it’s only works with enable_cxx. It’s not about importing petsc4py, It’s about importing PETSc from petsc4py.
MartinDiehl commented on 2025-04-26 12:22 (UTC)
@medaminezghal: when compiling with --enable-cxx=1
I get a warning that this is meant for development only. As far as I see, petsc4py
3.23.0 also works without it.
medaminezghal commented on 2025-04-15 10:09 (UTC)
@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
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}"
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.