Here's a Python example that allows me to ensure that I'm passing the same flags to PETSc that numpy/f2py use on Python builds. This also ensures a consistent PyClaw build when it relies on the PETSc FC settings to build object code for modules:
import numpy.distutils.fcompiler fc_name = numpy.distutils.fcompiler.get_default_fcompiler() ignore1, fc_class, ignore2 = numpy.distutils.fcompiler.fcompiler_class[fc_name] fc_instance = fc_class() fc_instance.customize() fc = fc_instance.compiler_f90[0] fc_flags = fc_instance.compiler_f90[1:] configure_options = [ '--PETSC_ARCH=pyclaw', '--with-cc=gcc', '--with-fc=' + fc, '--with-fflags=' + ' '.join(fc_flags), '--with-cxx=g++', '--download-petsc4py=1', '--download-mpich=1', '--with-shared-libraries=1' ] A
