source: trunk/anuga_core/compile_all.py @ 7859

Last change on this file since 7859 was 7812, checked in by steve, 14 years ago

Added file directory in thecompile_all.py file in anuga_core

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