source: trunk/anuga_core/compile_all.py @ 7864

Last change on this file since 7864 was 7812, checked in by steve, 15 years ago

Added file directory in thecompile_all.py file in anuga_core

File size: 2.0 KB
RevLine 
[2778]1import os
[5969]2import time
[2778]3
4buildroot = os.getcwd()
5
[5898]6os.chdir('source')
[3514]7os.chdir('anuga')
8
[2778]9
10print 'Changing to', os.getcwd()       
11
12#entries = listdir('.')
13
[5969]14t0 = time.time()
[2778]15
[7455]16# Attempt to compile all ANUGA extensions
[2778]17
18os.chdir('utilities')
19execfile('compile.py')
20
21os.chdir('..')
[7812]22os.chdir('advection')
23execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
24
25os.chdir('..')
[3560]26os.chdir('abstract_2d_finite_volumes')
[2778]27execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
28
29os.chdir('..')
[7812]30os.chdir('file')
[4978]31execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
32
33os.chdir('..')
[3563]34os.chdir('shallow_water')
35execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
36
37os.chdir('..')
[7812]38os.chdir('shallow_water_balanced')
39execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
40
41os.chdir('..')
[3027]42os.chdir('mesh_engine')
[4447]43execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
[2778]44
45os.chdir(buildroot)   
[7455]46
[7456]47print '-----------------------------------------------'
48print 'Attempting to compile Metis for parallel ANUGA!'
49print '-----------------------------------------------'
[7455]50
51# Attempt to compile Metis for use with anuga_parallel
52os.chdir('source')
53os.chdir('pymetis')
54
[7458]55make_logfile = os.path.join(buildroot, 'make_metis.log')
[7456]56options = ''
[7455]57if sys.platform == 'win32':
[7456]58    options = 'for_win32'
[7455]59else:
60    if os.name == 'posix':
61        if os.uname()[4] in ['x86_64', 'ia64']:
[7456]62            options = 'COPTIONS="-fPIC"'
[7455]63
[7456]64make_command = 'make %s > %s' % (options, make_logfile)
65print make_command
66err = os.system(make_command)
67if err != 0:
68    msg = 'Could not compile Metis '
69    msg += 'on platform %s, %s\n' % (sys.platform, os.name)
70    msg += 'You need to compile Metis manually '
71    msg += 'if you want to run ANUGA in parallel.'
72    raise Exception, msg
73else:
74    msg = 'Compiled Metis succesfully. Output from Make is available in %s'\
[7457]75        % make_logfile
76    print msg
77
78print       
[5969]79print 'That took %.3fs' %(time.time() - t0)
[6417]80
81if sys.platform == 'win32':
[6718]82    raw_input('Press the RETURN key')
Note: See TracBrowser for help on using the repository browser.