integrating petsc code into non petsc code
Matt Funk
matze999 at gmx.net
Tue Apr 21 11:03:08 CDT 2009
If i am missing the question please ignore this email,
but i think you are using your own make files (i.e. NOT petsc make system?).
If so, i am doing the same. Here is what you need during compilation:
PETSC_INC_DIR= -I$(PETSC_DIR)/include -I$(PETSC_DIR)/bmake/$(PETSC_ARCHITECTURE)
PETSC_LIB_DIR= -L$(PETSC_DIR)/lib/$(PETSC_ARCHITECTURE)
PETSC_LIBS= -lpetsccontrib -lpetscts -lpetscsnes -lpetscdm -lpetscksp -lpetscmat -lpetscvec -lpetsc
Petsc make does this automatically for you i believe.
Again, if i missed the question please ignore.
matt
ps: i am on petsc-2.3.3-p15
On Tuesday 21 April 2009, Pierre-Yves Aquilanti wrote:
> Hello everyone,
>
> i'm trying to integrate petsc code into one big software. petsc would act
> as a solver for the program.
> The t i try toway tha 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
More information about the petsc-users
mailing list