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