[petsc-dev] ensuring consistency with f2py, fortran/petsc4py interoperability

Satish Balay balay at mcs.anl.gov
Sun May 15 10:17:03 CDT 2011


can't you get cc,cflags also from python distutils?

satish

On Sun, 15 May 2011, Aron Ahmadia wrote:

> 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
> 




More information about the petsc-dev mailing list