<html><head></head><body><div class="ydpeff4be63yahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 10px;"><span>Hello,<br><br>I am trying to initialize petsc from within application code but I keep getting the following error.<br><br>symbol lookup error: /home/klaus/OpenFOAM/klaus-5.0/platforms/linux64GccDPInt32Opt/lib/libmyPCG2.so: undefined symbol: PetscInitialize<br><br>The code is just:<br><br> PetscInitialize(0,0,PETSC_NULL,PETSC_NULL);<br> //PetscPrintf(PETSC_COMM_WORLD,"Hello World\n");<br> PetscFinalize();<br><br>includes are:<br><br>#include <petsc.h><br>#include <petscksp.h><br><br>There are no compile errors.<br><br>.bashrc petsc related content is:<br>export PETSC_DIR=/home/klaus/OpenFOAM/ThirdParty-5.0/petsc-3.9.3<br>export PETSC_ARCH=/arch-linux2-c-debug<br>export PETSC_LIBDIR=$PETSC_DIR/arch-linux2-c-debug/lib<br><br><br>I am also linking:<br> -I$(PETSC_DIR)/include \<br> -I$(PETSC_DIR)/arch-linux2-c-debug/include<br>and<br> -L$(PETSC_LIBDIR) -lpetsc<br><br>I assume something else needs to be linked but can't work out what's missing.<br><br>Any idea?<br><br><br>Klaus</span></div></body></html>