source: anuga_core/compile_all.py @ 7459

Last change on this file since 7459 was 7458, checked in by ole, 15 years ago

Made logfile pathname absolute

File size: 1.8 KB
RevLine 
[2778]1import os
[5969]2import time
[2778]3
4buildroot = os.getcwd()
5
[5898]6os.chdir('source')
[3514]7os.chdir('anuga')
8
[2778]9
10print 'Changing to', os.getcwd()       
11
12#entries = listdir('.')
13
[5969]14t0 = time.time()
[2778]15
[7455]16# Attempt to compile all ANUGA extensions
[2778]17
18os.chdir('utilities')
19execfile('compile.py')
20
21os.chdir('..')
[3560]22os.chdir('abstract_2d_finite_volumes')
[2778]23execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
24
25os.chdir('..')
[4978]26os.chdir('advection')
27execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
28
29
30os.chdir('..')
[3563]31os.chdir('shallow_water')
32execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
33
34os.chdir('..')
[3027]35os.chdir('mesh_engine')
[4447]36execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
[2778]37
38os.chdir(buildroot)   
[7455]39
[7456]40print '-----------------------------------------------'
41print 'Attempting to compile Metis for parallel ANUGA!'
42print '-----------------------------------------------'
[7455]43
44# Attempt to compile Metis for use with anuga_parallel
45os.chdir('source')
46os.chdir('pymetis')
47
[7458]48make_logfile = os.path.join(buildroot, 'make_metis.log')
[7456]49options = ''
[7455]50if sys.platform == 'win32':
[7456]51    options = 'for_win32'
[7455]52else:
53    if os.name == 'posix':
54        if os.uname()[4] in ['x86_64', 'ia64']:
[7456]55            options = 'COPTIONS="-fPIC"'
[7455]56
[7456]57make_command = 'make %s > %s' % (options, make_logfile)
58print make_command
59err = os.system(make_command)
60if err != 0:
61    msg = 'Could not compile Metis '
62    msg += 'on platform %s, %s\n' % (sys.platform, os.name)
63    msg += 'You need to compile Metis manually '
64    msg += 'if you want to run ANUGA in parallel.'
65    raise Exception, msg
66else:
67    msg = 'Compiled Metis succesfully. Output from Make is available in %s'\
[7457]68        % make_logfile
69    print msg
70
71print       
[5969]72print 'That took %.3fs' %(time.time() - t0)
[6417]73
74if sys.platform == 'win32':
[6718]75    raw_input('Press the RETURN key')
Note: See TracBrowser for help on using the repository browser.