source: trunk/anuga_core/compile_all.py @ 8129

Last change on this file since 8129 was 8129, checked in by steve, 13 years ago

Getting the unit tests for structures to pass when called from test_all.py in directory anuga

File size: 2.2 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('structures')
31execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
32
33os.chdir('..')
34os.chdir('abstract_2d_finite_volumes')
35execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
36
37os.chdir('..')
38os.chdir('file')
39execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
40
41os.chdir('..')
42os.chdir('shallow_water')
43execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
44
45os.chdir('..')
46os.chdir('shallow_water_balanced')
47execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
48
49os.chdir('..')
50os.chdir('mesh_engine')
51execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
52
53os.chdir(buildroot)   
54
55print '-----------------------------------------------'
56print 'Attempting to compile Metis for parallel ANUGA!'
57print '-----------------------------------------------'
58
59# Attempt to compile Metis for use with anuga_parallel
60os.chdir('source')
61os.chdir('anuga_parallel')
62os.chdir('pymetis')
63
64make_logfile = os.path.join(buildroot, 'make_metis.log')
65options = ''
66if sys.platform == 'win32':
67    options = 'for_win32'
68else:
69    if os.name == 'posix':
70        if os.uname()[4] in ['x86_64', 'ia64']:
71            options = 'COPTIONS="-fPIC"'
72
73make_command = 'make %s > %s' % (options, make_logfile)
74print make_command
75err = os.system(make_command)
76if err != 0:
77    msg = 'Could not compile Metis '
78    msg += 'on platform %s, %s\n' % (sys.platform, os.name)
79    msg += 'You need to compile Metis manually '
80    msg += 'if you want to run ANUGA in parallel.'
81    raise Exception, msg
82else:
83    msg = 'Compiled Metis succesfully. Output from Make is available in %s'\
84        % make_logfile
85    print msg
86
87print       
88print 'That took %.3fs' %(time.time() - t0)
89
90if sys.platform == 'win32':
91    raw_input('Press the RETURN key')
Note: See TracBrowser for help on using the repository browser.