1e68ebbecSBarry Smith#!/usr/bin/env python 2e68ebbecSBarry Smith 3e68ebbecSBarry Smith""" 4e68ebbecSBarry Smith Make PETSc appear to be a Python package; so it can be depended on by petsc4py 5e68ebbecSBarry Smith""" 6e68ebbecSBarry Smith 7*12c1d45bSMatthew G Knepleydef setup(): 8e68ebbecSBarry Smith import os,sys 9e68ebbecSBarry Smith os.environ['PETSC_DIR'] = os.path.abspath(os.getcwd()) 10e68ebbecSBarry Smith os.environ['PETSC_ARCH'] = 'arch-python-test' 11e68ebbecSBarry Smith os.chdir(os.environ['PETSC_DIR']) 12e68ebbecSBarry Smith sys.path.insert(0,os.path.join(os.environ['PETSC_DIR'],'config')) 13*12c1d45bSMatthew G Knepley return 14*12c1d45bSMatthew G Knepley 15*12c1d45bSMatthew G Knepleydef configure(prefix): 16e68ebbecSBarry Smith import configure 174dfc5b15SBarry Smith configure.petsc_configure(['--with-fc=0','--with-mpi=0','--with-shared-libraries']) 18*12c1d45bSMatthew G Knepley # force save of configure information, or build will fail to load it 19e68ebbecSBarry Smith 20e68ebbecSBarry Smith # work around bug in logger.Logger that when log file is closed Logger.defaultLog still points to something 21e68ebbecSBarry Smith import logger 22e68ebbecSBarry Smith logger.Logger.defaultLog = None 23*12c1d45bSMatthew G Knepley return 24*12c1d45bSMatthew G Knepley 25*12c1d45bSMatthew G Knepleydef build(): 26e68ebbecSBarry Smith import builder 27e68ebbecSBarry Smith builder.PETScMaker().run() 28*12c1d45bSMatthew G Knepley return 29e68ebbecSBarry Smith 30e68ebbecSBarry Smithif __name__ == '__main__': 31*12c1d45bSMatthew G Knepley setup() 32e68ebbecSBarry Smith configure("dummy") 33e68ebbecSBarry Smith build() 34e68ebbecSBarry Smith 35e68ebbecSBarry Smith# ----------------------------------------------------------------------------- 36