source: trunk/anuga_core/compile_all.py @ 9567

Last change on this file since 9567 was 9567, checked in by steve, 10 years ago

Chenged compile_all to use source/setup.py

File size: 3.4 KB
Line 
1import os
2import time
3import sys
4import subprocess
5
6buildroot = os.getcwd()
7t0 = time.time()
8
9#--------------------------------------------------
10# Compiling anuga code
11#--------------------------------------------------
12os.chdir('source')
13
14print 'Changing to', os.getcwd()       
15
16cmd = 'python setup.py build_ext --inplace -f '
17print cmd
18err = os.system(cmd)
19if err != 0:
20    msg = 'Could not compile anuga '
21    msg += 'on platform %s, %s\n' % (sys.platform, os.name)
22    raise Exception, msg
23else:
24    print 50*"-"
25    print
26    msg = 'Compiled anuga successfully.'
27    print msg
28
29#
30#
31#
32#
33# print 'Changing to', os.getcwd()       
34#
35# #entries = listdir('.')
36#
37# t0 = time.time()
38#
39# # Attempt to compile all ANUGA extensions
40# execfile('compile_all.py')
41#
42#
43# os.chdir(buildroot)
44#
45#
46# #--------------------------------------------------
47# # Compiling anuga_1d code
48# # excluded for the time being
49# #--------------------------------------------------
50# #os.chdir('anuga_1d')
51#
52#
53# #t0 = time.time()
54#
55# # Attempt to compile all ANUGA_1D extensions
56# #execfile('compile_all.py')
57#
58#
59# os.chdir(buildroot)
60# print
61# print 'Changing to', os.getcwd()       
62#
63# #--------------------------------------------------
64# # Compiling partition code
65# #--------------------------------------------------
66#
67# try:
68#     print
69#     print '-----------------------------------------------'
70#     print 'Attempting to compile Metis'
71#     print '-----------------------------------------------'
72#
73#     import pypar
74#
75#     # Attempt to compile Metis for use with anuga_parallel
76#     os.chdir('source')
77#     os.chdir('anuga')
78#     #os.chdir('parallel')
79#     os.chdir('pymetis')
80#
81#     print 'Changing to', os.getcwd()       
82#
83#     cmd = 'python setup.py build_ext --inplace -f '
84#     print cmd
85#     err = os.system(cmd)
86#     if err != 0:
87#         msg = 'Could not compile pymetis '
88#         msg += 'on platform %s, %s\n' % (sys.platform, os.name)
89#         msg += 'You need to compile metis manually '
90#         msg += 'if you want to run ANUGA in parallel.'
91#         raise Exception, msg
92#     else:
93#         msg = 'Compiled pymetis successfully.'
94#         print msg
95#
96#
97#         
98# except:
99#     print
100#     print 'pymetis could not compile as pypar not installed'
101#
102#
103# os.chdir(buildroot)
104# print 'Changing to', os.getcwd()
105#
106# #--------------------------------------------------
107# # Compiling pypar_extras
108# #--------------------------------------------------
109#
110# try:
111#     print
112#     print '-----------------------------------------------'
113#     print 'Attempting to compile mpiextras'
114#     print '-----------------------------------------------'
115#
116#     import pypar
117#     
118#     os.chdir('source')
119#     os.chdir('anuga')
120#     os.chdir('parallel')
121#     #os.chdir('pypar_extras')
122#
123#     cmd = 'python setup.py build_ext --inplace -f '
124#     print cmd
125#     err = os.system(cmd)
126#     if err != 0:
127#         msg = 'Could not compile mpiextras '
128#         msg += 'on platform %s, %s\n' % (sys.platform, os.name)
129#         msg += 'You need to compile mpiextras manually '
130#         msg += 'if you want to run ANUGA in parallel.'
131#         raise Exception, msg
132#     else:
133#         msg = 'Compiled mpiextras successfully.'
134#         print msg
135# except:
136#     print 'anuga.parallel code not compiled as pypar not installed'
137#
138#
139
140print       
141print 'That took %.3fs' %(time.time() - t0)
142
143
144
145
Note: See TracBrowser for help on using the repository browser.