Ask help for PETSc

Satish Balay balay at
Mon Sep 15 14:30:02 CDT 2008

On Mon, 15 Sep 2008, Chen, Changjun wrote:

> Hi Sir,

> My name is Changjun Chen. I am a postdoc in Michigan State
> University. Recently I use your perfect software PETSc. It is very
> good. But I still have one problem. I need your help.

> It is about the size of final executable. When I compile it, it is
> over 60 MB. This is too large. Maybe it have all the linear equation
> solvers.  but among them, I only need one method, for example JACOBI
> method, I do not need others.  So how could I compile the codes that
> only contains this method?  Thanks

You might have to replace the code in PCRegisterAll() to include only
1 PC type to do this. [similar change to other register routines.]

However the whole goal of PETSc is to provide easy experimentation of
various solvers at runtime.

The primary reason the executable is huge is probably due to debug
symbols. To verify - you can run 'strip' on the executable.

Another thing you can do is build with the option
'--with-shared=1'. This would leave most of the PETSc compiled in
shared libraries - thus keeping the application executable very small.


More information about the petsc-users mailing list