source: trunk/anuga_core/compile_all.py @ 8466

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

commiting at the anuga_core level

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