Compiler Optimization Override
Tim Stitt
timothy.stitt at ichec.ie
Wed Jun 27 08:32:40 CDT 2007
Perfect...thanks for the info.
On Wednesday 27 June 2007 14:21, Satish Balay wrote:
> On Wed, 27 Jun 2007, Tim Stitt wrote:
> > Hi PETSc Users/Developers,
> >
> > Could someone explain how I can override the default optimization level
> > that comes with my PETSc build (currently -O). I want to set a more
> > aggressive optimization level (e.g. -O3) for my compiler (PathScale).
>
> Rebuild a different variant of the libraires [with a different
> PETSC_ARCH] using COPTFLAGS=-O3 FOPTFLAGS=-O3
>
> > Ideally I would prefer a solution which doesn't involve rebuilding PETSc
> > each time I want to switch the optimization level.
>
> You just build both versions once, and switch between them by switching
> PETSC_ARCH
>
> make PETSC_ARCH=opt mybinary
> make PETSC_ARCH=opt-3 mybinary
>
> > I tried to add the switch to the petscrules file but it always
> > defaulted to the first (lower?) optimization switch that appeared
> > in the application compile command line which seems to be built into
> > PETSc.
>
> If you are chaning config files manually, then you'll have to change
> all occurances of -O in petscconf file [not petscrules]. Also - if
> you've used --download-mpich, then mpicc etc wrappers would need
> this modification aswell.
>
> So its best to build different variants of PETSc libraries with
> different PETSC_ARCH values.
>
> Satish
--
Dr. Timothy Stitt <timothy_dot_stitt_at_ichec.ie>
HPC Application Consultant - ICHEC (www.ichec.ie)
Dublin Institute for Advanced Studies
5 Merrion Square - Dublin 2 - Ireland
+353-1-6621333 (tel) / +353-1-6621477 (fax) / +353-874195427 (mobile)
More information about the petsc-users
mailing list