The tests fail to build:
*******************Error detected during compile or link!*******************
See https://petsc.org/release/faq/
/build/petsc/src/petsc-3.21.0/src/snes/tutorials ex19
*********************************************************************************
/usr/bin/mpicc -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/petsc/src=/usr/src/debug/petsc -flto=auto -fPIC -I/build/petsc/src/petsc-3.21.0/include -I/build/petsc/src/petsc-3.21.0/arch-linux-c-opt/include -I/usr/include/hypre -I/usr/include/suitesparse -I/usr/include/superlu -I/usr/include/superlu_dist -I/usr/include -Wl,-export-dynamic ex19.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/13.2.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1 -lpetsc /usr/lib/libHYPRE.so -lamd -lbtf -lcamd -lccolamd -lcholmod -lcolamd -lcxsparse -lgraphblas -lklu -lklu_cholmod -llagraph -llagraphx -lldl -lparu -lrbio -lspex -lspqr -lsuitesparse_mongoose -lsuitesparseconfig -lumfpack -ldmumps -lmumps_common -lpord -lpthread -lscalapack -lsuperlu -lsuperlu_dist -lml -lfftw3_mpi -lfftw3 -lkokkoscontainers -lkokkoscore -lkokkossimd -llapack -lblas -lzfp -lzoltan -lptesmumps -lptscotchparmetisv3 -lptscotch -lptscotcherr -lesmumps -lscotch -lscotcherr -lparmetis -lmetis -lnetcdf -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -ltriangle -lm -lz -lgsl -lgslcblas -ljpeg -lyaml -lX11 -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -o ex19
/usr/bin/ld: cannot find -lpetsc: No such file or directory
collect2: error: ld returned 1 exit status
make[4]: *** [<builtin>: ex19] Error 1
It uses -L/opt/petsc/linux-c-opt/lib
but of course the package is not installed there yet.
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.