Hello everyone,<br><br>i&#39;m trying to integrate petsc code into one big software. petsc would act as a solver for the program.<br>The way that i try to integrate my petsc code is like that:<br><br>########################<br>
program myoldnonpetsccode<br><br>use mymodule<br><br>implicit none<br><br>call process_petsc<br><br>end myoldnonpetsccode<br>########################<br>module mymodule<br>implicit none<br><br>
#include &quot;finclude/petsc.h&quot;<br><br>contains<br>subroutine process_petsc<br>call PetscInitialize(PETSC_NULL_CHARACTER,ierr)<br><br>call PetscFinalize(ierr)<br><br>end subroutine process_petsc<br>end module mymodule<br>
###############<br><br><br>The compiler used for petsc, mpich and the non-petsc code is the same (PGI). I&#39;m perfectly making my module file (.mod) for mymodule and object one (.o). This one is inserted into a library file (libtest.a).<br>
When i try to make my binary &quot;myoldnonpetsccode&quot; my compiler tells me during the linking process that there&#39;s two undefined reference for &#39;petscinitialize_&#39; and &#39;petscfinalize_&#39;. I verified that petsc libraries where included during linking process (with -L/mypathtopetsclib and -lpetsc).<br>
I don&#39;t find any answer to this on the internet and documentation.<br><br>Do you have any clue on what would be the problem ?<br><br>Thanks a lot<br><br>Best regards<br><br>PYA<br>