integrating petsc code into non petsc code
Waad Subber
w_subber at yahoo.com
Tue Apr 21 10:49:24 CDT 2009
I use the following and it works for me
master is a fortran code calls PETSc solver
Waad
--- On Tue, 4/21/09, Pierre-Yves Aquilanti <sperif at gmail.com> wrote:
From: Pierre-Yves Aquilanti <sperif at gmail.com>
Subject: integrating petsc code into non petsc code
To: petsc-users at mcs.anl.gov
Date: Tuesday, April 21, 2009, 11:27 AM
Hello everyone,
i'm trying to integrate petsc code into one big software. petsc would act as a solver for the program.
The way that i try to integrate my petsc code is like that:
########################
program myoldnonpetsccode
use mymodule
implicit none
call process_petsc
end myoldnonpetsccode
########################
module mymodule
implicit none
#include "finclude/petsc.h"
contains
subroutine process_petsc
call PetscInitialize(PETSC_NULL_CHARACTER,ierr)
call PetscFinalize(ierr)
end subroutine process_petsc
end module mymodule
###############
The compiler used for petsc, mpich and the non-petsc code is the same (PGI). I'm perfectly making my module file (.mod) for mymodule and object one (.o). This one is inserted into a library file (libtest.a).
When i try to make my binary "myoldnonpetsccode" my compiler tells me during the linking process that there's two undefined reference for 'petscinitialize_' and 'petscfinalize_'. I verified that petsc libraries where included during linking process (with -L/mypathtopetsclib and -lpetsc).
I don't find any answer to this on the internet and documentation.
Do you have any clue on what would be the problem ?
Thanks a lot
Best regards
PYA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090421/dcb1f2e0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: master.F
Type: text/x-fortran
Size: 810 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090421/dcb1f2e0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msolve.F
Type: text/x-fortran
Size: 999 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090421/dcb1f2e0/attachment-0001.bin>
More information about the petsc-users
mailing list