[petsc-dev] Undefined symbols for _kspfgmresmodifypcksp_ and _kspfgmresmodifypcnochange_ when rebuilding

Patrick Sanan patrick.sanan at gmail.com
Wed Aug 22 04:04:34 CDT 2018


This happens fairly frequently when I try to switch/update branches of
PETSc (here invoked by building my own code, but the error message looks
the same with "make check"):

$ make
/Users/patrick/petsc-stagbl/arch-darwin-stagbl-double-extra-debug/bin/mpicc
-o runme.o -c -Wall -Wwrite-strings -Wno-strict-aliasing
-Wno-unknown-pragmas -fstack-protector -fvisibility=hidden -g3
-I/Users/patrick/petsc-stagbl/include
-I/Users/patrick/petsc-stagbl/arch-darwin-stagbl-double-extra-debug/include
-I/opt/X11/include    `pwd`/runme.c
/Users/patrick/petsc-stagbl/arch-darwin-stagbl-double-extra-debug/bin/mpicc
-Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress
-Wl,-commons,use_dylibs -Wl,-search_paths_first -Wl,-no_compact_unwind
-Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress
-Wl,-commons,use_dylibs -Wl,-search_paths_first -Wl,-no_compact_unwind
 -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas
-fstack-protector -fvisibility=hidden -g3  -o runme runme.o
-Wl,-rpath,/Users/patrick/petsc-stagbl/arch-darwin-stagbl-double-extra-debug/lib
-L/Users/patrick/petsc-stagbl/arch-darwin-stagbl-double-extra-debug/lib
-Wl,-rpath,/Users/patrick/petsc-stagbl/arch-darwin-stagbl-double-extra-debug/lib
-Wl,-rpath,/opt/X11/lib -L/opt/X11/lib
-Wl,-rpath,/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0
-L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0
-Wl,-rpath,/opt/local/lib/gcc7 -L/opt/local/lib/gcc7 -lpetsc -lcmumps
-ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lscalapack -lumfpack
-lklu -lcholmod -lbtf -lccolamd -lcolamd -lcamd -lamd -lsuitesparseconfig
-lsuperlu_dist -lHYPRE -lsundials_cvode -lsundials_nvecserial
-lsundials_nvecparallel -llapack -lblas -lparmetis -lmetis -lX11 -lyaml
-lstdc++ -ldl -lmpifort -lmpi -lpmpi -lgfortran -lquadmath -lm -lstdc++ -ldl
Undefined symbols for architecture x86_64:
  "_kspfgmresmodifypcksp_", referenced from:
      import-atom in libpetsc.dylib
  "_kspfgmresmodifypcnochange_", referenced from:
      import-atom in libpetsc.dylib
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

I don't know why this is, exactly. Maybe it's more obvious from the
perspective of someone more expert on the Fortran interface, and we could
save some time reconfiguring (if these two symbols are really the only
issue).

 For these two symbols, the corresponding functions are declared but not
defined in

    src/ksp/ksp/impls/gmres/fgmres/ftn-custom/zmodpcff.c

"make deletefortranstubs" by itself doesn't seem to solve the problem. My
sledgehammer workaround is to do everything short of blowing away my entire
$PETSC_ARCH directory:

    make deletefortranstubs && make allclean && make reconfigure && make &&
make check

but I'm sure that's suboptimal, and in particular I'd like to avoid the
reconfigure.

Any useful community knowledge on this point?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20180822/3b7ae61c/attachment.html>


More information about the petsc-dev mailing list