xref: /petsc/setup.py (revision e68ebbec558186afea1acee85d6bbf705df42a1b)
1#!/usr/bin/env python
2
3"""
4     Make PETSc appear to be a Python package; so it can be depended on by petsc4py
5"""
6
7
8
9def configure(prefix):
10    import os,sys
11    os.environ['PETSC_DIR']  = os.path.abspath(os.getcwd())
12    os.environ['PETSC_ARCH'] = 'arch-python-test'
13    os.chdir(os.environ['PETSC_DIR'])
14    sys.path.insert(0,os.path.join(os.environ['PETSC_DIR'],'config'))
15    import configure
16    configure.petsc_configure(['--with-fc=0','--with-mpi=0','--with-shared'])
17
18def build():
19    import os,sys
20
21    # work around bug in logger.Logger that when log file is closed Logger.defaultLog still points to something
22    import logger
23    logger.Logger.defaultLog = None
24    import builder
25    builder.PETScMaker().run()
26
27
28if __name__ == '__main__':
29    configure("dummy")
30    build()
31
32# -----------------------------------------------------------------------------
33