Hello for compiled problem
Satish Balay
balay at mcs.anl.gov
Tue Mar 10 16:53:46 CDT 2009
On Tue, 10 Mar 2009, Wei-Dong Lian wrote:
> Now I also found a problem for my computer about using petsc.
> In my computer, petsc can be compiled successfully without any problem. So I
> use the *.so library to link into my programme, it worked very well. But
> today I just have a try to link *.a library into my programme and it can not
> be compiled successfully.
Why do you want to do this? [When shared libraries exist - the
compiler prefers then - instead of static. So you should just stick
with the compiler default behavior. And if build PETSc with
--with-dynamic - then the .a files are useless anyway.]
So the shared vs static usage should be chosen at PETSc configure step.
[--with-shared=1/0, and do not use --with-dyanmic]
So you should just use:
ADDLIB := $(ADDLIB) -L$(PETSC_LIBDIR) -Wl,-rpath,$(PETSC_LIBDIR)
-lpetsccontrib -lpetscts -lpetscsnes -lpetscksp -lpetscdm
-lpetscmat -lpetscvec -lpetsc
Satish
More information about the petsc-users
mailing list