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
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('..')
[8129]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('..')
[3560]34os.chdir('abstract_2d_finite_volumes')
[2778]35execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
36
37os.chdir('..')
[7812]38os.chdir('file')
[4978]39execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
40
41os.chdir('..')
[3563]42os.chdir('shallow_water')
43execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
44
45os.chdir('..')
[7812]46os.chdir('shallow_water_balanced')
47execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
48
49os.chdir('..')
[3027]50os.chdir('mesh_engine')
[4447]51execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
[2778]52
53os.chdir(buildroot)   
[7455]54
[7456]55print '-----------------------------------------------'
56print 'Attempting to compile Metis for parallel ANUGA!'
57print '-----------------------------------------------'
[7455]58
59# Attempt to compile Metis for use with anuga_parallel
60os.chdir('source')
[7934]61os.chdir('anuga_parallel')
[7455]62os.chdir('pymetis')
63
[7458]64make_logfile = os.path.join(buildroot, 'make_metis.log')
[7456]65options = ''
[7455]66if sys.platform == 'win32':
[7456]67    options = 'for_win32'
[7455]68else:
69    if os.name == 'posix':
70        if os.uname()[4] in ['x86_64', 'ia64']:
[7456]71            options = 'COPTIONS="-fPIC"'
[7455]72
[7456]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'\
[7457]84        % make_logfile
85    print msg
86
87print       
[5969]88print 'That took %.3fs' %(time.time() - t0)
[6417]89
90if sys.platform == 'win32':
[6718]91    raw_input('Press the RETURN key')
Note: See TracBrowser for help on using the repository browser.