source: trunk/anuga_core/compile_all.py @ 8630

Last change on this file since 8630 was 8630, checked in by steve, 12 years ago

Starting to wrap in Yuyangs code for sww2dem

File size: 2.8 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('operators')
27execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
28
29os.chdir('..')
30os.chdir('file_conversion')
31execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
32
33os.chdir('..')
34os.chdir('geometry')
35execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
36
37os.chdir('..')
38os.chdir('structures')
39execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
40
41os.chdir('..')
42os.chdir('abstract_2d_finite_volumes')
43execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
44
45os.chdir('..')
46os.chdir('file')
47execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
48
49os.chdir('..')
50os.chdir('shallow_water')
51execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
52
53
54os.chdir('..')
55os.chdir('mesh_engine')
56execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
57
58os.chdir(buildroot)   
59
60print '-----------------------------------------------'
61print 'Attempting to compile Metis for parallel ANUGA!'
62print '-----------------------------------------------'
63
64# Attempt to compile Metis for use with anuga_parallel
65os.chdir('source')
66os.chdir('anuga_parallel')
67os.chdir('pymetis')
68
69make_logfile = os.path.join(buildroot, 'make_metis.log')
70options = ''
71if sys.platform == 'win32':
72    options = 'for_win32'
73else:
74    if os.name == 'posix':
75        if os.uname()[4] in ['x86_64', 'ia64']:
76            options = ' '
77
78make_command = 'make %s > %s' % (options, make_logfile)
79print make_command
80err = os.system(make_command)
81if err != 0:
82    msg = 'Could not compile Metis '
83    msg += 'on platform %s, %s\n' % (sys.platform, os.name)
84    msg += 'You need to compile Metis manually '
85    msg += 'if you want to run ANUGA in parallel.'
86    raise Exception, msg
87else:
88    msg = 'Compiled Metis succesfully. Output from Make is available in %s'\
89        % make_logfile
90    print msg
91
92
93print '-----------------------------------------------'
94print 'Attempting to compile pypar_extras'
95print '-----------------------------------------------'
96
97os.chdir('..')
98os.chdir('pypar_extras')
99
100cmd = 'python anuga_setup.py'
101print cmd
102err = os.system(cmd)
103if err != 0:
104    msg = 'Could not compile pypar_extras '
105    msg += 'on platform %s, %s\n' % (sys.platform, os.name)
106    msg += 'You need to compile pypar_extras manually '
107    msg += 'if you want to run ANUGA in parallel.'
108    raise Exception, msg
109else:
110    msg = 'Compiled pypar_extras succesfully.'
111    print msg
112
113
114print       
115print 'That took %.3fs' %(time.time() - t0)
116
117
118
119if sys.platform == 'win32':
120    raw_input('Press the RETURN key')
Note: See TracBrowser for help on using the repository browser.