demo make fails on poisson3d: undefined reference to del2apply_

Issue #111 resolved
Drew Parsons created an issue

I'm trying to build and run petsc4py demos for Debian configuration integration testing. Using

cd demo
make PETSC_DIR=/usr/lib/petsc

the demos build successfully up to poisson3d, which gives

make -C poisson3d
make[1]: Entering directory '/home/projects/petsc/build/petsc4py/demo/poisson3d'
python poisson3d.py
make -f makefile.petsc \
        PETSC_DIR=/usr/lib/petsc PETSC_ARCH=
make[2]: Entering directory '/home/projects/petsc/build/petsc4py/demo/poisson3d'
mpif90 -c -g -O2 -fstack-protector-strong -fPIC -ffree-line-length-0   -Wdate-time -D_FORTIFY_SOURCE=2  -I/usr/lib/petscdir/petsc3.9/x86_64-linux-gnu-real/include -I/usr/lib/petscdir/petsc3.9/x86_64-linux-gnu-real/include -I/usr/include/suitesparse -I/usr/include/superlu -I/usr/include/superlu-dist -I/usr/include/hypre -I/usr/include/hdf5/openmpi -I/usr/include/scotch  -Wdate-time -D_FORTIFY_SOURCE=2   del2lib.f90
mpicxx -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC      -Wdate-time -D_FORTIFY_SOURCE=2  -I/usr/lib/petscdir/petsc3.9/x86_64-linux-gnu-real/include -I/usr/lib/petscdir/petsc3.9/x86_64-linux-gnu-real/include -I/usr/include/suitesparse -I/usr/include/superlu -I/usr/include/superlu-dist -I/usr/include/hypre -I/usr/include/hdf5/openmpi -I/usr/include/scotch  -Wdate-time -D_FORTIFY_SOURCE=2   `pwd`/poisson3d.c
mpicxx -Wl,-z,relro -fPIC -Wl,--no-as-needed -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC   -o poisson3d.exe -L/usr/lib/petscdir/petsc3.9/x86_64-linux-gnu-real/lib -L/usr/lib/petscdir/petsc3.9/x86_64-linux-gnu-real/lib -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi -L/usr/lib/openmpi/lib -L/usr/lib/x86_64-linux-gnu/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/8 -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -lpetsc_real -ldmumps -lzmumps -lsmumps -lcmumps -lmumps_common -lpord -lscalapack-openmpi -lumfpack -lamd -lcholmod -lklu -lsuperlu -lsuperlu_dist -lHYPRE_IJ_mv -lHYPRE_parcsr_ls -lHYPRE_sstruct_ls -lHYPRE_sstruct_mv -lHYPRE_struct_ls -lHYPRE_struct_mv -lHYPRE_utilities -lfftw3 -lfftw3_mpi -llapack -lblas -lhdf5 -lmpi -lptesmumps -lptscotch -lptscotcherr -lm -lstdc++ -ldl -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lpthread -lstdc++ -ldl poisson3d.o del2lib.o
/usr/bin/ld: poisson3d.o: in function `Del2Mat_mult(_p_Mat*, _p_Vec*, _p_Vec*)':
/home/projects/petsc/build/petsc4py/demo/poisson3d/del2mat.h:35: undefined reference to `del2apply_(int*, double*, double const*, double*)'
collect2: error: ld returned 1 exit status
make[2]: *** [makefile.petsc:18: poisson3d.exe] Error 1
make[2]: Leaving directory '/home/projects/petsc/build/petsc4py/demo/poisson3d'
make[1]: *** [makefile:32: poisson3d.exe] Error 2
make[1]: Leaving directory '/home/projects/petsc/build/petsc4py/demo/poisson3d'

The symbol del2apply_ should be defined in del2lib.so (from del2lib.f90).

Does it mean the makefile needs to be adjusted?

Comments (4)

  1. Log in to comment