source: trunk/anuga_core/compile_all.py @ 8690

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

Rolling in Padarn's update to fit_interpolation

File size: 3.2 KB
Line 
1import os
2import time
3import sys
4import subprocess
5
6buildroot = os.getcwd()
7
8os.chdir('source')
9os.chdir('anuga')
10
11
12print 'Changing to', os.getcwd()       
13
14#entries = listdir('.')
15
16t0 = time.time()
17
18# Attempt to compile all ANUGA extensions
19
20os.chdir('utilities')
21subprocess.call([sys.executable, 'compile.py', 'quad_tree.c'])
22subprocess.call([sys.executable, 'compile.py', 'sparse_dok.c'])
23subprocess.call([sys.executable, 'compile.py', 'sparse_csr.c'])
24execfile('compile.py')
25
26os.chdir('..')
27os.chdir('advection')
28execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
29
30os.chdir('..')
31os.chdir('operators')
32execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
33
34os.chdir('..')
35os.chdir('file_conversion')
36execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
37
38os.chdir('..')
39os.chdir('geometry')
40execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
41
42os.chdir('..')
43os.chdir('structures')
44execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
45
46os.chdir('..')
47os.chdir('abstract_2d_finite_volumes')
48execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
49
50os.chdir('..')
51os.chdir('file')
52execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
53
54os.chdir('..')
55os.chdir('shallow_water')
56execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
57
58
59os.chdir('..')
60os.chdir('mesh_engine')
61execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
62
63os.chdir('..')
64os.chdir('fit_interpolate')
65execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
66
67
68os.chdir(buildroot)   
69
70print '-----------------------------------------------'
71print 'Attempting to compile Metis for parallel ANUGA!'
72print '-----------------------------------------------'
73
74# Attempt to compile Metis for use with anuga_parallel
75os.chdir('source')
76os.chdir('anuga_parallel')
77os.chdir('pymetis')
78
79make_logfile = os.path.join(buildroot, 'make_metis.log')
80options = ''
81if sys.platform == 'win32':
82    options = 'for_win32'
83else:
84    if os.name == 'posix':
85        if os.uname()[4] in ['x86_64', 'ia64']:
86            options = ' '
87
88make_command = 'make %s > %s' % (options, make_logfile)
89print make_command
90err = os.system(make_command)
91if err != 0:
92    msg = 'Could not compile Metis '
93    msg += 'on platform %s, %s\n' % (sys.platform, os.name)
94    msg += 'You need to compile Metis manually '
95    msg += 'if you want to run ANUGA in parallel.'
96    raise Exception, msg
97else:
98    msg = 'Compiled Metis succesfully. Output from Make is available in %s'\
99        % make_logfile
100    print msg
101
102
103print '-----------------------------------------------'
104print 'Attempting to compile pypar_extras'
105print '-----------------------------------------------'
106
107os.chdir('..')
108os.chdir('pypar_extras')
109
110cmd = 'python anuga_setup.py'
111print cmd
112err = os.system(cmd)
113if err != 0:
114    msg = 'Could not compile pypar_extras '
115    msg += 'on platform %s, %s\n' % (sys.platform, os.name)
116    msg += 'You need to compile pypar_extras manually '
117    msg += 'if you want to run ANUGA in parallel.'
118    raise Exception, msg
119else:
120    msg = 'Compiled pypar_extras succesfully.'
121    print msg
122
123
124print       
125print 'That took %.3fs' %(time.time() - t0)
126
127
128
129if sys.platform == 'win32':
130    raw_input('Press the RETURN key')
Note: See TracBrowser for help on using the repository browser.