15d5a5a7bSMatthew Knepley#!/usr/bin/env python 22787667cSMatthew G Knepleyimport os, sys 34f8a5b45SBarry Smithimport commands 4a1eda5bfSSatish Balay# to load ~/.pythonrc.py before inserting correct BuildSystem to path 5a1eda5bfSSatish Balayimport user 67c9abfe7SSatish BalayextraLogs = [] 7b0b472b0SSatish Balaypetsc_arch = '' 84b8aa89bSBarry Smith 92787667cSMatthew G Knepleyimport urllib 102787667cSMatthew G Knepleyimport tarfile 112787667cSMatthew G Knepley 122787667cSMatthew G Knepleydef untar(tar, path = '.', leading = ''): 132787667cSMatthew G Knepley if leading: 142787667cSMatthew G Knepley entries = [t.name for t in tar.getmembers()] 152787667cSMatthew G Knepley prefix = os.path.commonprefix(entries) 162787667cSMatthew G Knepley if prefix: 172787667cSMatthew G Knepley for tarinfo in tar.getmembers(): 182787667cSMatthew G Knepley tail = tarinfo.name.split(prefix, 1)[1] 192787667cSMatthew G Knepley tarinfo.name = os.path.join(leading, tail) 202787667cSMatthew G Knepley for tarinfo in tar.getmembers(): 212787667cSMatthew G Knepley tar.extract(tarinfo, path) 222787667cSMatthew G Knepley return 232787667cSMatthew G Knepley 242787667cSMatthew G Knepleydef downloadPackage(url, filename, targetDirname): 252787667cSMatthew G Knepley '''Download the tarball for a package at url, save it as filename, and untar it into targetDirname''' 262787667cSMatthew G Knepley filename, headers = urllib.urlretrieve(url, filename) 272787667cSMatthew G Knepley tar = tarfile.open(filename, 'r:gz') 282787667cSMatthew G Knepley untar(tar, targetDirname, leading = filename.split('.')[0]) 292787667cSMatthew G Knepley return 302787667cSMatthew G Knepley 3144b0d7f9SSatish Balay# Use en_US as language so that BuildSystem parses compiler messages in english 329b436e4bSSatish Balayif 'LC_LOCAL' in os.environ and os.environ['LC_LOCAL'] != '' and os.environ['LC_LOCAL'] != 'en_US' and os.environ['LC_LOCAL']!= 'en_US.UTF-8': os.environ['LC_LOCAL'] = 'en_US.UTF-8' 339b436e4bSSatish Balayif 'LANG' in os.environ and os.environ['LANG'] != '' and os.environ['LANG'] != 'en_US' and os.environ['LANG'] != 'en_US.UTF-8': os.environ['LANG'] = 'en_US.UTF-8' 3444b0d7f9SSatish Balay 356b66766aSSatish Balayif not hasattr(sys, 'version_info') or not sys.version_info[0] == 2 or not sys.version_info[1] >= 3: 366b66766aSSatish Balay print '*** You must have Python2 version 2.3 or higher to run ./configure *****' 37495ffa62SBarry Smith print '* Python is easy to install for end users or sys-admin. *' 3832077d6dSBarry Smith print '* http://www.python.org/download/ *' 3932077d6dSBarry Smith print '* *' 40495ffa62SBarry Smith print '* You CANNOT configure PETSc without Python *' 41495ffa62SBarry Smith print '* http://www.mcs.anl.gov/petsc/petsc-as/documentation/installation.html *' 42a0022257SSatish Balay print '*******************************************************************************' 43b26a8723SBarry Smith sys.exit(4) 442fb34ac0SMatthew Knepley 454d18482cSSatish Balayif sys.platform == 'win32': 464d18482cSSatish Balay print '**** Windows python detected. ****' 474d18482cSSatish Balay print sys.version,'on',sys.platform 484d18482cSSatish Balay print '' 494d18482cSSatish Balay print '** You must use cygwin python, but not windows python with PETSc configure. ***' 504d18482cSSatish Balay sys.exit(4) 514d18482cSSatish Balay 52ccb279e1SMatthew Knepleydef check_for_option_mistakes(opts): 5345faeebdSBarry Smith for opt in opts[1:]: 54cda0060aSMatthew Knepley name = opt.split('=')[0] 55ccb279e1SMatthew Knepley if name.find('_') >= 0: 56ccb279e1SMatthew Knepley exception = False 57f3fbd535SBarry Smith for exc in ['superlu_dist', 'PETSC_ARCH', 'PETSC_DIR', 'CXX_CXXFLAGS', 'LD_SHARED', 'CC_LINKER_FLAGS', 'CXX_LINKER_FLAGS', 'FC_LINKER_FLAGS', 'AR_FLAGS', 'C_VERSION', 'CXX_VERSION', 'FC_VERSION', 'size_t', 'MPI_Comm','MPI_Fint']: 58ccb279e1SMatthew Knepley if name.find(exc) >= 0: 59ccb279e1SMatthew Knepley exception = True 60ccb279e1SMatthew Knepley if not exception: 61ccb279e1SMatthew Knepley raise ValueError('The option '+name+' should probably be '+name.replace('_', '-')); 62ab610953SSatish Balay if opt.find('=') >=0: 63ab610953SSatish Balay optval = opt.split('=')[1] 64ab610953SSatish Balay if optval == 'ifneeded': 65ab610953SSatish Balay raise ValueError('The option '+opt+' should probably be '+opt.replace('ifneeded', '1')); 66ccb279e1SMatthew Knepley return 67ccb279e1SMatthew Knepley 6859e9bfd6SSatish Balaydef check_petsc_arch(opts): 69c43ea0feSSatish Balay # If PETSC_ARCH not specified - use script name (if not configure.py) 70b0b472b0SSatish Balay global petsc_arch 71c43ea0feSSatish Balay found = 0 7259e9bfd6SSatish Balay for name in opts: 73c43ea0feSSatish Balay if name.find('PETSC_ARCH=') >= 0: 74b0b472b0SSatish Balay petsc_arch=name.split('=')[1] 75c43ea0feSSatish Balay found = 1 7659e9bfd6SSatish Balay break 7759e9bfd6SSatish Balay # If not yet specified - use the filename of script 78c43ea0feSSatish Balay if not found: 7959e9bfd6SSatish Balay filename = os.path.basename(sys.argv[0]) 80e68ebbecSBarry Smith if not filename.startswith('configure') and not filename.startswith('reconfigure') and not filename.startswith('setup'): 81b0b472b0SSatish Balay petsc_arch=os.path.splitext(os.path.basename(sys.argv[0]))[0] 82b0b472b0SSatish Balay useName = 'PETSC_ARCH='+petsc_arch 8359e9bfd6SSatish Balay opts.append(useName) 841937db7aSSatish Balay return 0 854b8aa89bSBarry Smith 861921852fSSatish Balaydef chkwinf90(): 876a8f6897SSatish Balay for arg in sys.argv: 881921852fSSatish Balay if (arg.find('win32fe') >= 0 and (arg.find('f90') >=0 or arg.find('ifort') >=0)): 896a8f6897SSatish Balay return 1 906a8f6897SSatish Balay return 0 916a8f6897SSatish Balay 926a8f6897SSatish Balaydef chkcygwinlink(): 931921852fSSatish Balay if os.path.exists('/usr/bin/cygcheck.exe') and os.path.exists('/usr/bin/link.exe') and chkwinf90(): 946a8f6897SSatish Balay if '--ignore-cygwin-link' in sys.argv: return 0 956a8f6897SSatish Balay print '===============================================================================' 961921852fSSatish Balay print ' *** Cygwin /usr/bin/link detected! Compiles with CVF/Intel f90 can break! **' 976a8f6897SSatish Balay print ' *** To workarround do: "mv /usr/bin/link.exe /usr/bin/link-cygwin.exe" **' 986a8f6897SSatish Balay print ' *** Or to ignore this check, use configure option: --ignore-cygwin-link **' 996a8f6897SSatish Balay print '===============================================================================' 1006a8f6897SSatish Balay sys.exit(3) 1016a8f6897SSatish Balay return 0 1026a8f6897SSatish Balay 10385ef4d1eSSatish Balaydef chkbrokencygwin(): 1049dabcff0SSatish Balay if os.path.exists('/usr/bin/cygcheck.exe'): 1059dabcff0SSatish Balay buf = os.popen('/usr/bin/cygcheck.exe -c cygwin').read() 1069dabcff0SSatish Balay if buf.find('1.5.11-1') > -1: 107a0022257SSatish Balay print '===============================================================================' 108e2e64c6bSBarry Smith print ' *** cygwin-1.5.11-1 detected. ./configure fails with this version ***' 1091937db7aSSatish Balay print ' *** Please upgrade to cygwin-1.5.12-1 or newer version. This can ***' 1101937db7aSSatish Balay print ' *** be done by running cygwin-setup, selecting "next" all the way.***' 111a0022257SSatish Balay print '===============================================================================' 1121937db7aSSatish Balay sys.exit(3) 1139dabcff0SSatish Balay return 0 1149dabcff0SSatish Balay 115*14f5c25cSSatish Balaydef chkcygwinpython(): 116*14f5c25cSSatish Balay if os.path.exists('/usr/bin/cygcheck.exe') and sys.platform == 'cygwin' : 1171937db7aSSatish Balay sys.argv.append('--useThreads=0') 1181937db7aSSatish Balay extraLogs.append('''\ 119a0022257SSatish Balay=============================================================================== 120*14f5c25cSSatish Balay** Cygwin-python detected. Threads do not work correctly. *** 121*14f5c25cSSatish Balay** Disabling thread usage for this run of ./configure ******* 122a0022257SSatish Balay===============================================================================''') 12371384062SSatish Balay return 0 12471384062SSatish Balay 1251937db7aSSatish Balaydef chkrhl9(): 1261937db7aSSatish Balay if os.path.exists('/etc/redhat-release'): 127836c2c52SSatish Balay try: 128594eb360SSatish Balay file = open('/etc/redhat-release','r') 129836c2c52SSatish Balay buf = file.read() 130836c2c52SSatish Balay file.close() 131836c2c52SSatish Balay except: 132836c2c52SSatish Balay # can't read file - assume dangerous RHL9 1331937db7aSSatish Balay buf = 'Shrike' 134836c2c52SSatish Balay if buf.find('Shrike') > -1: 1351937db7aSSatish Balay sys.argv.append('--useThreads=0') 1361937db7aSSatish Balay extraLogs.append('''\ 137a0022257SSatish Balay============================================================================== 1381937db7aSSatish Balay *** RHL9 detected. Threads do not work correctly with this distribution *** 139e2e64c6bSBarry Smith ****** Disabling thread usage for this run of ./configure ********* 140a0022257SSatish Balay===============================================================================''') 141836c2c52SSatish Balay return 0 142836c2c52SSatish Balay 143da58527dSSatish Balaydef check_broken_configure_log_links(): 144da58527dSSatish Balay '''Sometime symlinks can get broken if the original files are deleted. Delete such broken links''' 145da58527dSSatish Balay import os 146da58527dSSatish Balay for logfile in ['configure.log','configure.log.bkp']: 147da58527dSSatish Balay if os.path.islink(logfile) and not os.path.isfile(logfile): os.remove(logfile) 148da58527dSSatish Balay return 149da58527dSSatish Balay 150da1d79b4SSatish Balaydef move_configure_log(framework): 151da1d79b4SSatish Balay '''Move configure.log to PETSC_ARCH/conf - and update configure.log.bkp in both locations appropriately''' 152b0b472b0SSatish Balay global petsc_arch 153b0b472b0SSatish Balay 154b0b472b0SSatish Balay if hasattr(framework,'arch'): petsc_arch = framework.arch 155b0b472b0SSatish Balay if hasattr(framework,'logName'): curr_file = framework.logName 156b0b472b0SSatish Balay else: curr_file = 'configure.log' 157b0b472b0SSatish Balay 158b0b472b0SSatish Balay if petsc_arch: 159da1d79b4SSatish Balay import shutil 160da1d79b4SSatish Balay import os 161b0b472b0SSatish Balay 162b0b472b0SSatish Balay # Just in case - confdir is not created 163b0b472b0SSatish Balay conf_dir = os.path.join(petsc_arch,'conf') 164b0b472b0SSatish Balay if not os.path.isdir(petsc_arch): os.mkdir(petsc_arch) 165b0b472b0SSatish Balay if not os.path.isdir(conf_dir): os.mkdir(conf_dir) 166b0b472b0SSatish Balay 167da1d79b4SSatish Balay curr_bkp = curr_file + '.bkp' 168b0b472b0SSatish Balay new_file = os.path.join(conf_dir,curr_file) 169da1d79b4SSatish Balay new_bkp = new_file + '.bkp' 170da1d79b4SSatish Balay 171da1d79b4SSatish Balay # Keep backup in $PETSC_ARCH/conf location 172da1d79b4SSatish Balay if os.path.isfile(new_bkp): os.remove(new_bkp) 173da1d79b4SSatish Balay if os.path.isfile(new_file): os.rename(new_file,new_bkp) 1749e50940cSSatish Balay if os.path.isfile(curr_file): 1759e50940cSSatish Balay shutil.copyfile(curr_file,new_file) 1769e50940cSSatish Balay os.remove(curr_file) 177da58527dSSatish Balay if os.path.isfile(new_file): os.symlink(new_file,curr_file) 178da1d79b4SSatish Balay # If the old bkp is using the same PETSC_ARCH/conf - then update bkp link 179da1d79b4SSatish Balay if os.path.realpath(curr_bkp) == os.path.realpath(new_file): 180da58527dSSatish Balay if os.path.isfile(curr_bkp): os.remove(curr_bkp) 181da58527dSSatish Balay if os.path.isfile(new_bkp): os.symlink(new_bkp,curr_bkp) 182da1d79b4SSatish Balay return 183da1d79b4SSatish Balay 1845d5a5a7bSMatthew Knepleydef petsc_configure(configure_options): 185a0022257SSatish Balay print '===============================================================================' 18659e9bfd6SSatish Balay print ' Configuring PETSc to compile on your system ' 187a0022257SSatish Balay print '===============================================================================' 18859e9bfd6SSatish Balay 189a258c2c4SMatthew G Knepley try: 190c43ea0feSSatish Balay # Command line arguments take precedence (but don't destroy argv[0]) 191c43ea0feSSatish Balay sys.argv = sys.argv[:1] + configure_options + sys.argv[1:] 192ccb279e1SMatthew Knepley check_for_option_mistakes(sys.argv) 193a258c2c4SMatthew G Knepley except (TypeError, ValueError), e: 194a258c2c4SMatthew G Knepley emsg = str(e) 195a258c2c4SMatthew G Knepley if not emsg.endswith('\n'): emsg = emsg+'\n' 196a258c2c4SMatthew G Knepley msg ='*******************************************************************************\n'\ 197a258c2c4SMatthew G Knepley +' ERROR in COMMAND LINE ARGUMENT to ./configure \n' \ 198a258c2c4SMatthew G Knepley +'-------------------------------------------------------------------------------\n' \ 199a258c2c4SMatthew G Knepley +emsg+'*******************************************************************************\n' 200a258c2c4SMatthew G Knepley sys.exit(msg) 20159e9bfd6SSatish Balay # check PETSC_ARCH 20259e9bfd6SSatish Balay check_petsc_arch(sys.argv) 203da58527dSSatish Balay check_broken_configure_log_links() 2045fb2c094SBarry Smith 205c22cdea9SBarry Smith # support a few standard configure option types 206ed6a7445SBarry Smith for l in range(0,len(sys.argv)): 207c22cdea9SBarry Smith name = sys.argv[l] 208637cc2ebSSatish Balay if name.find('enable-') >= 0: 209193cd51eSMatthew Knepley if name.find('=') == -1: 210193cd51eSMatthew Knepley sys.argv[l] = name.replace('enable-','with-')+'=1' 211193cd51eSMatthew Knepley else: 212193cd51eSMatthew Knepley head, tail = name.split('=', 1) 213193cd51eSMatthew Knepley sys.argv[l] = head.replace('enable-','with-')+'='+tail 214637cc2ebSSatish Balay if name.find('disable-') >= 0: 215193cd51eSMatthew Knepley if name.find('=') == -1: 216193cd51eSMatthew Knepley sys.argv[l] = name.replace('disable-','with-')+'=0' 217193cd51eSMatthew Knepley else: 218193cd51eSMatthew Knepley head, tail = name.split('=', 1) 219193cd51eSMatthew Knepley if tail == '1': tail = '0' 220193cd51eSMatthew Knepley sys.argv[l] = head.replace('disable-','with-')+'='+tail 221637cc2ebSSatish Balay if name.find('without-') >= 0: 222193cd51eSMatthew Knepley if name.find('=') == -1: 223193cd51eSMatthew Knepley sys.argv[l] = name.replace('without-','with-')+'=0' 224193cd51eSMatthew Knepley else: 225193cd51eSMatthew Knepley head, tail = name.split('=', 1) 226193cd51eSMatthew Knepley if tail == '1': tail = '0' 227193cd51eSMatthew Knepley sys.argv[l] = head.replace('without-','with-')+'='+tail 228adc3e427SMatthew Knepley 2299dabcff0SSatish Balay # Check for broken cygwin 2301937db7aSSatish Balay chkbrokencygwin() 231d65f3bddSMatthew Knepley # Disable threads on RHL9 2321937db7aSSatish Balay chkrhl9() 233*14f5c25cSSatish Balay # Threads don't work for cygwin & python... 234*14f5c25cSSatish Balay chkcygwinpython() 2356a8f6897SSatish Balay chkcygwinlink() 2369dabcff0SSatish Balay 23787282423SMatthew Knepley # Should be run from the toplevel 238dbca6d9dSSatish Balay configDir = os.path.abspath('config') 239f8833479SBarry Smith bsDir = os.path.join(configDir, 'BuildSystem') 240f8833479SBarry Smith if not os.path.isdir(configDir): 2415d5a5a7bSMatthew Knepley raise RuntimeError('Run configure from $PETSC_DIR, not '+os.path.abspath('.')) 24287282423SMatthew Knepley if not os.path.isdir(bsDir): 243a0022257SSatish Balay print '===============================================================================' 244dbca6d9dSSatish Balay print '''++ Could not locate BuildSystem in %s.''' % configDir 2452787667cSMatthew G Knepley print '''++ Downloading it from http://petsc.cs.iit.edu/petsc/BuildSystem''' 246a0022257SSatish Balay print '===============================================================================' 247f94377afSLisandro Dalcin downloadPackage('http://petsc.cs.iit.edu/petsc/BuildSystem/archive/tip.tar.gz', 'BuildSystem.tar.gz', configDir) 2484f8a5b45SBarry Smith 24987282423SMatthew Knepley sys.path.insert(0, bsDir) 250f8833479SBarry Smith sys.path.insert(0, configDir) 251e69ef9dfSMatthew Knepley import config.base 2525d5a5a7bSMatthew Knepley import config.framework 253f56be888SMatthew Knepley import cPickle 2544f8a5b45SBarry Smith 2559dd2fdb1SMatthew Knepley framework = None 2569dd2fdb1SMatthew Knepley try: 2571a784507SMatthew Knepley framework = config.framework.Framework(['--configModules=PETSc.Configure','--optionsModule=PETSc.compilerOptions']+sys.argv[1:], loadArgDB = 0) 258d65f3bddSMatthew Knepley framework.setup() 259d65f3bddSMatthew Knepley framework.logPrint('\n'.join(extraLogs)) 260f24f64feSBarry Smith framework.configure(out = sys.stdout) 261358ebc22SMatthew Knepley framework.storeSubstitutions(framework.argDB) 262f56be888SMatthew Knepley framework.argDB['configureCache'] = cPickle.dumps(framework) 2637cfd0b05SBarry Smith import PETSc.packages 2647cfd0b05SBarry Smith for i in framework.packages: 2657cfd0b05SBarry Smith if hasattr(i,'postProcess'): 2667cfd0b05SBarry Smith i.postProcess() 2677c939e48SSatish Balay framework.printSummary() 26812c1d45bSMatthew G Knepley framework.argDB.save(force = True) 2697cfd0b05SBarry Smith framework.logClear() 270eefa2c0fSBarry Smith framework.closeLog() 2719e50940cSSatish Balay try: 272da1d79b4SSatish Balay move_configure_log(framework) 2739e50940cSSatish Balay except: 2749e50940cSSatish Balay # perhaps print an error about unable to shuffle logs? 2759e50940cSSatish Balay pass 276dd50d019SBarry Smith return 0 277e69ef9dfSMatthew Knepley except (RuntimeError, config.base.ConfigureSetupError), e: 2787d670a3cSBarry Smith emsg = str(e) 27942351d26SSatish Balay if not emsg.endswith('\n'): emsg = emsg+'\n' 280a0022257SSatish Balay msg ='*******************************************************************************\n'\ 281fe09c992SBarry Smith +' UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):\n' \ 282a0022257SSatish Balay +'-------------------------------------------------------------------------------\n' \ 283a0022257SSatish Balay +emsg+'*******************************************************************************\n' 284e9f3bb17SBarry Smith se = '' 2859dd2fdb1SMatthew Knepley except (TypeError, ValueError), e: 2867d670a3cSBarry Smith emsg = str(e) 28742351d26SSatish Balay if not emsg.endswith('\n'): emsg = emsg+'\n' 288a0022257SSatish Balay msg ='*******************************************************************************\n'\ 289e2e64c6bSBarry Smith +' ERROR in COMMAND LINE ARGUMENT to ./configure \n' \ 290a0022257SSatish Balay +'-------------------------------------------------------------------------------\n' \ 291a0022257SSatish Balay +emsg+'*******************************************************************************\n' 2921a02243aSBarry Smith se = '' 29396dc2fe8SMatthew Knepley except ImportError, e : 2947d670a3cSBarry Smith emsg = str(e) 29542351d26SSatish Balay if not emsg.endswith('\n'): emsg = emsg+'\n' 296a0022257SSatish Balay msg ='*******************************************************************************\n'\ 297e2e64c6bSBarry Smith +' UNABLE to FIND MODULE for ./configure \n' \ 298a0022257SSatish Balay +'-------------------------------------------------------------------------------\n' \ 299a0022257SSatish Balay +emsg+'*******************************************************************************\n' 30096dc2fe8SMatthew Knepley se = '' 30101def6f0SMatthew Knepley except OSError, e : 30201def6f0SMatthew Knepley emsg = str(e) 30301def6f0SMatthew Knepley if not emsg.endswith('\n'): emsg = emsg+'\n' 304a0022257SSatish Balay msg ='*******************************************************************************\n'\ 305e2e64c6bSBarry Smith +' UNABLE to EXECUTE BINARIES for ./configure \n' \ 306a0022257SSatish Balay +'-------------------------------------------------------------------------------\n' \ 307a0022257SSatish Balay +emsg+'*******************************************************************************\n' 30801def6f0SMatthew Knepley se = '' 309d7d3c4beSMatthew Knepley except SystemExit, e: 310d7d3c4beSMatthew Knepley if e.code is None or e.code == 0: 311d7d3c4beSMatthew Knepley return 312a0022257SSatish Balay msg ='*******************************************************************************\n'\ 313b1dada7fSMatthew Knepley +' CONFIGURATION FAILURE (Please send configure.log to petsc-maint@mcs.anl.gov)\n' \ 314a0022257SSatish Balay +'*******************************************************************************\n' 315d7d3c4beSMatthew Knepley se = str(e) 316e9f3bb17SBarry Smith except Exception, e: 317a0022257SSatish Balay msg ='*******************************************************************************\n'\ 318fe09c992SBarry Smith +' CONFIGURATION CRASH (Please send configure.log to petsc-maint@mcs.anl.gov)\n' \ 319a0022257SSatish Balay +'*******************************************************************************\n' 320e9f3bb17SBarry Smith se = str(e) 321e9f3bb17SBarry Smith 322e9f3bb17SBarry Smith print msg 3239dd2fdb1SMatthew Knepley if not framework is None: 3249dd2fdb1SMatthew Knepley framework.logClear() 325e9f3bb17SBarry Smith if hasattr(framework, 'log'): 326f6614063SBarry Smith import traceback 327b1dada7fSMatthew Knepley try: 328f24f64feSBarry Smith framework.log.write(msg+se) 329f24f64feSBarry Smith traceback.print_tb(sys.exc_info()[2], file = framework.log) 330f73e6a6cSSatish Balay if hasattr(framework,'log'): framework.log.close() 331da1d79b4SSatish Balay move_configure_log(framework) 332b1dada7fSMatthew Knepley except: 333b1dada7fSMatthew Knepley pass 334e9f3bb17SBarry Smith sys.exit(1) 3355a74f024SMatthew Knepley else: 3365a74f024SMatthew Knepley print se 3375a74f024SMatthew Knepley import traceback 3385a74f024SMatthew Knepley traceback.print_tb(sys.exc_info()[2]) 339f73e6a6cSSatish Balay if hasattr(framework,'log'): framework.log.close() 3405d5a5a7bSMatthew Knepley 3415d5a5a7bSMatthew Knepleyif __name__ == '__main__': 342a030c540SBarry Smith petsc_configure([]) 343759acf64SBarry Smith 344