source: anuga_core/compile_all.py @ 7457

Last change on this file since 7457 was 7457, checked in by ole, 15 years ago

Typos in compile_all

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