source: trunk/anuga_core/compile_all.py @ 8947

Last change on this file since 8947 was 8871, checked in by steve, 11 years ago

Added some comments to boyd_box_operator

File size: 2.2 KB
Line 
1import os
2import time
3import sys
4import subprocess
5
6buildroot = os.getcwd()
7
8os.chdir('source')
9os.chdir('anuga')
10
11
12print 'Changing to', os.getcwd()       
13
14#entries = listdir('.')
15
16t0 = time.time()
17
18# Attempt to compile all ANUGA extensions
19execfile('compile_all.py')
20
21
22os.chdir(buildroot)   
23
24try:
25    print '-----------------------------------------------'
26    print 'Attempting to compile Metis for parallel ANUGA!'
27    print '-----------------------------------------------'
28
29    import pypar
30
31    # Attempt to compile Metis for use with anuga_parallel
32    os.chdir('source')
33    os.chdir('anuga_parallel')
34    os.chdir('pymetis')
35
36    make_logfile = os.path.join(buildroot, 'make_metis.log')
37    options = ''
38    if sys.platform == 'win32':
39        options = 'for_win32'
40    else:
41        if os.name == 'posix':
42            if os.uname()[4] in ['x86_64', 'ia64']:
43                options = ' '
44
45    make_command = 'make %s > %s' % (options, make_logfile)
46    print make_command
47    err = os.system(make_command)
48    if err != 0:
49        msg = 'Could not compile Metis '
50        msg += 'on platform %s, %s\n' % (sys.platform, os.name)
51        msg += 'You need to compile Metis manually '
52        msg += 'if you want to run ANUGA in parallel.'
53        raise Exception, msg
54    else:
55        msg = 'Compiled Metis succesfully. Output from Make is available in %s'\
56            % make_logfile
57        print msg
58
59    print 
60    print '-----------------------------------------------'
61    print 'Attempting to compile pypar_extras'
62    print '-----------------------------------------------'
63
64    os.chdir('..')
65    os.chdir('pypar_extras')
66
67    cmd = 'python anuga_setup.py'
68    print cmd
69    err = os.system(cmd)
70    if err != 0:
71        msg = 'Could not compile pypar_extras '
72        msg += 'on platform %s, %s\n' % (sys.platform, os.name)
73        msg += 'You need to compile pypar_extras manually '
74        msg += 'if you want to run ANUGA in parallel.'
75        raise Exception, msg
76    else:
77        msg = 'Compiled pypar_extras succesfully.'
78        print msg
79except:
80    print 'anuga_parallel code not compiled as pypar not installed'
81
82
83
84print       
85print 'That took %.3fs' %(time.time() - t0)
86
87
88
89
Note: See TracBrowser for help on using the repository browser.