forked from su2code/SU2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preconfigure.py
executable file
·611 lines (515 loc) · 27.7 KB
/
preconfigure.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
#!/usr/bin/env python
## \file configure.py
# \brief An extended configuration script.
# \author T. Albring
# \version 5.0.0 "Raven"
#
# SU2 Original Developers: Dr. Francisco D. Palacios.
# Dr. Thomas D. Economon.
#
# SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
# Prof. Piero Colonna's group at Delft University of Technology.
# Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
# Prof. Alberto Guardone's group at Polytechnic University of Milan.
# Prof. Rafael Palacios' group at Imperial College London.
# Prof. Edwin van der Weide's group at the University of Twente.
# Prof. Vincent Terrapon's group at the University of Liege.
#
# Copyright (C) 2012-2017 SU2, the open-source CFD code.
#
# SU2 is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# SU2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with SU2. If not, see <http://www.gnu.org/licenses/>.
from optparse import OptionParser, BadOptionError
import sys,time, os, subprocess, os.path, glob, re, shutil, fileinput
import commands
from subprocess import call
# "Pass-through" option parsing -- an OptionParser that ignores
# unknown options and lets them pile up in the leftover argument
# list. Useful to pass unknown arguments to the automake configure.
class PassThroughOptionParser(OptionParser):
def _process_long_opt(self, rargs, values):
try:
OptionParser._process_long_opt(self, rargs, values)
except BadOptionError, err:
self.largs.append(err.opt_str)
def _process_short_opts(self, rargs, values):
try:
OptionParser._process_short_opts(self, rargs, values)
except BadOptionError, err:
self.largs.append(err.opt_str)
def main():
# Command Line Options
usage = './preconfigure.py [options]' \
'\nNote: Options not listed below are passed to the automake configure.' \
'\n Compiler flags must be set with \'export CFLAGS=...\' or \'export CXXFLAGS=...\' ' \
'\n before calling this script.'
parser = PassThroughOptionParser(usage = usage)
parser.add_option("--enable-direct-diff", action="store_true",
help="Enable direct differentiation mode support", dest="directdiff", default=False)
parser.add_option("--enable-autodiff", action="store_true",
help="Enable Automatic Differentiation support", dest="ad_support", default=False)
parser.add_option("--with-ad", action="store", type = "string", help="AD Tool, CODI/ADOLC", default="CODI", dest="adtool")
parser.add_option("--enable-mpi", action="store_true",
help="Enable mpi support", dest="mpi_enabled", default=False)
parser.add_option("--enable-PY_WRAPPER", action="store_true",
help="Enable Python wrapper compilation", dest="py_wrapper_enabled", default=False)
parser.add_option("--disable-normal", action="store_true",
help="Disable normal mode support", dest="normal_mode", default=False)
parser.add_option("-c" , "--check", action="store_true",
help="Check the source code for potential problems", dest="check", default=False)
parser.add_option("-r" , "--replace", action="store_true",
help="Do a search and replace of necessary symbols. Creates back up of source files.", dest="replace", default=False)
parser.add_option("-d" , "--delete", action="store_true",
help="Removes the back up files.", dest="remove", default=False)
parser.add_option("-v" , "--revert", action="store_true",
help="Revert files to original state.", dest="revert", default=False)
parser.add_option("-u", "--update", action="store_true",
help="Update and recompile submodules.", dest="update", default=False)
(options, args)=parser.parse_args()
options.adtool = options.adtool.upper()
if options.directdiff == False:
adtool_dd = ""
else:
adtool_dd = options.adtool
if options.ad_support == False:
adtool_da = ""
else:
adtool_da = options.adtool
conf_environ = os.environ
made_adolc = False
made_codi = False
header()
modes = {'SU2_BASE' : not options.normal_mode == True,
'SU2_DIRECTDIFF' : adtool_dd ,
'SU2_AD' : adtool_da }
# Create a dictionary from the arguments
argument_dict = dict(zip(args[::2],args[1::2]))
# Set the default installation path (if not set with --prefix)
argument_dict['--prefix'] = argument_dict.get('--prefix', os.getcwd().rstrip())
if not options.check:
if any([modes["SU2_AD"] == 'CODI', modes["SU2_DIRECTDIFF"] == 'CODI']):
conf_environ, made_codi = init_codi(argument_dict,modes,options.mpi_enabled, options.update)
configure(argument_dict,
conf_environ,
options.mpi_enabled,
options.py_wrapper_enabled,
modes,
made_adolc,
made_codi)
if options.check:
prepare_source(options.replace, options.remove, options.revert)
def prepare_source(replace = False, remove = False, revert = False):
# Directories containing the source code
print 'Preparing source code ...'
dir_list = [ "Common",
"SU2_CFD",
"SU2_DEF",
"SU2_DOT",
"SU2_GEO",
"SU2_SOL",
"SU2_MSH"]
file_list = ""
exclude_dic_lines = {}
exclude_dic_files = {}
exclude_file_name = 'preconf.exclude'
# # Build the dictionaries for line and file excludes that
# # are defined in the exlude file 'preconf.exclude'.
# # Syntax:
# # PathTo/File[:Line1,Line2,...]
# if os.path.exists(exclude_file_name):
# print 'Reading \'' + exclude_file_name + '\' ...'
# with open(exclude_file_name, 'r') as exclude:
# for line in exclude:
# exclude_line = line.split(':')
# exclude_file = exclude_line[0].rstrip()
# if len(exclude_line) > 1:
# exclude_lines = exclude_line[1].split(',')
# for index,item in enumerate(exclude_lines):
# exclude_lines[index] = int(item.rstrip())
# exclude_dic_lines[exclude_line[0].rstrip()] = exclude_lines
# else:
# exclude_dic_files[exclude_line[0].rstrip()] = [-1]
# else:
# print 'Exclude file \'' + exclude_file_name + '\' not found. Checking all files.'
# Hardcoded files that will be skipped
exclude_dic_files = { 'Common/include/datatype_structure.hpp' : [-1],
'Common/include/datatype_structure.inl' : [-1],
'Common/include/mpi_structure.hpp' : [-1],
'Common/include/mpi_structure.inl' : [-1],
'Common/src/datatype_structure.cpp': [-1],
'Common/src/mpi_structure.cpp' : [-1] }
str_double = 'double'
regex_double = re.compile(r'(^|[^\w])('+str_double+')([^\w]|$)')
replacement_double = r'\1su2double\3'
simple_replacements = {'MPI_Reduce' : 'SU2_MPI::Reduce',
'MPI_Allreduce' : 'SU2_MPI::Allreduce',
'MPI_Gather' : 'SU2_MPI::Gather',
'MPI_Allgather' : 'SU2_MPI::Allgather',
'MPI_Isend' : 'SU2_MPI::Isend',
'MPI_Irecv' : 'SU2_MPI::Irecv',
'MPI_Send' : 'SU2_MPI::Send',
'MPI_Wait' : 'SU2_MPI::Wait',
'MPI_Waitall' : 'SU2_MPI::Waitall',
'MPI_Waitany' : 'SU2_MPI::Waitany',
'MPI_Bsend' : 'SU2_MPI::Bsend' ,
'MPI_Bcast' : 'SU2_MPI::Bcast',
'MPI_Sendrecv' : 'SU2_MPI::Sendrecv',
'MPI_Init' : 'SU2_MPI::Init',
'MPI_Recv' : 'SU2_MPI::Recv',
'sprintf' : 'SPRINTF'}
regex_cast_1 = re.compile(r'(^|[^\w|^\\])(int)(\s*\()')
replacement_cast_1 = r'\1SU2_TYPE::Int\3'
regex_cast_2 = re.compile(r'\(int\)\s*')
logfile = open ('preconf.log','w')
backup_ext = '.orig'
print 'Checking for problems...'
# Test each source file for the occurrence of missing replacements
# and print the respective lines.
for dir in dir_list:
file_list = glob.glob(dir+os.path.sep+'*[src,include]'+os.path.sep+'*[.cpp,.hpp,.inl]')
for file in file_list:
if not file in exclude_dic_files.keys():
if all([not replace, revert]):
# Check if back up file exists
if os.path.isfile(file + backup_ext):
os.remove(file);
shutil.copy(file + backup_ext, file)
else:
print 'Cannot find backup file ' + file + backup_ext
# Remove backup files if requested
if all([not replace, remove]):
if os.path.isfile(file + backup_ext):
print 'Removing' + file + backup_ext
os.remove(file + backup_ext)
if all([not remove, not revert]):
num_found = 0
found_line = ""
ignore_line = ""
new_line = ""
for line in fileinput.input(file, inplace = 1, backup = backup_ext):
new_line = line.rstrip('\n')
if any([re.findall(regex_double, line), find_all(line, simple_replacements), re.findall(regex_cast_1, line)]):
if not fileinput.lineno() in exclude_dic_lines.get(file,[]):
if replace:
new_line = replace_all(new_line, simple_replacements)
new_line = re.sub(regex_double, replacement_double, new_line)
new_line = re.sub(regex_cast_1, replacement_cast_1, new_line)
found_line = found_line + '\tLine ' + str(fileinput.lineno()) +': ' + line.rstrip() + '\n\t\t => ' + new_line.rstrip() + '\n'
else:
found_line = found_line + '\tLine ' + str(fileinput.lineno()) +': ' + line.rstrip() + '\n'
num_found = num_found + 1
else:
ignore_line = ignore_line + 'Ignoring line ' + str(fileinput.lineno()) + ' in ' + file + ' (' + line.rstrip() + ')\n'
print new_line
if num_found > 0:
if replace:
print 'Solved ' + str(num_found) + ' potential problem(s) in ' + file + '.'
logfile.write('Solved ' + str(num_found) + ' potential problem(s) in ' + file + ':\n')
else:
print 'Found ' + str(num_found) + ' potential problem(s) in ' + file + '.'
logfile.write('Found ' + str(num_found) + ' potential problem(s) in ' + file + ':\n')
logfile.write( found_line )
else:
os.remove(file + backup_ext)
if not ignore_line == "":
print ignore_line.rstrip();
else:
print 'Ignoring file ' + file
print '\nPlease check preconf.log to get more information about potential problems.'
def replace_all(text, dic):
for i, j in dic.iteritems():
text = text.replace(i, j)
return text
def find_all(text, dic):
for i,j in dic.iteritems():
if not text.find(i) == -1:
return True
return False
def init_codi(argument_dict, modes, mpi_support = False, update = False):
modules_failed = True
# This information of the modules is used if projects was not cloned using git
# The sha tag must be maintained manually to point to the correct commit
sha_version_codi = '2ec7cccf3ccd4b052f9d4ef95d6dc69244484f13'
github_repo_codi = 'https://github.com/scicompkl/CoDiPack'
sha_version_ampi = '31b2267c3a55a391a37d830369f2e0dba09008d1'
github_repo_ampi = 'https://github.com/michel2323/AdjointMPI'
ampi_name = 'AdjointMPI'
codi_name = 'CoDiPack'
alt_name_ampi = 'adjointmpi'
alt_name_codi = 'codi'
# Some log and error files
log = open( 'preconf.log', 'w' )
err = open( 'preconf.err', 'w' )
pkg_environ = os.environ
codi_status = False
ampi_status = False
print "Checking the status of submodules"
print '====================================================================='
# Remove modules if update is requested
if update:
if os.path.exists('externals/'+alt_name_codi):
print 'Removing' + ' externals/' + alt_name_codi
shutil.rmtree('externals/'+alt_name_codi)
if os.path.exists('externals/'+alt_name_ampi):
print 'Removing' + ' externals/' + alt_name_ampi
shutil.rmtree('externals/'+alt_name_ampi)
# If project was cloned using git, we can use the
# submodule feature of git to initialize the packages
if all([os.path.exists('.gitmodules')]):
codi_status = submodule_status('externals/'+alt_name_codi, update)
if mpi_support:
ampi_status = submodule_status('externals/'+alt_name_ampi, update)
modules_failed = not all([codi_status, ampi_status])
else:
modules_failed = not codi_status
else:
print '.gitmodules not found, using fall-back method...'
os.chdir('externals')
# If modules still dont exists, use wget to download zip
if all([any([not os.path.exists('codi/' + sha_version_codi), update]), modules_failed]):
if all([os.path.exists('codi'), not os.path.exists('codi/' + sha_version_codi)]):
print 'Found an old or unspecified version of CoDiPack in externals/codi.\nUse -u to reset module.'
sys.exit()
download_module(codi_name, alt_name_codi, github_repo_codi, sha_version_codi, log, err)
elif modules_failed:
print 'Found correct version of CoDiPack in externals/codi.'
if all([any([not os.path.exists('adjointmpi/' + sha_version_ampi), update]), mpi_support, modules_failed]):
if all([os.path.exists('adjointmpi'), not os.path.exists('adjointmpi/' + sha_version_ampi)]):
print 'Found an old or unspecified version of AdjointMPI in externals/adjointmpi.\nUse -u to reset module.'
sys.exit()
download_module(ampi_name, alt_name_ampi, github_repo_ampi, sha_version_ampi, log, err)
elif modules_failed:
print 'Found correct version of AdjointMPI in externals/adjointmpi.'
# Build AdjointMPI if MPI Support is requested. If a C compiler was specified as an argument use it here.
if mpi_support:
os.chdir('adjointmpi')
configure_ampi = './configure --prefix=' + os.getcwd().rstrip()
if any([not os.path.exists('libAMPI.a'), update]):
if not argument_dict.get('--with-cc', ' ') == ' ':
configure_ampi = configure_ampi + ' --with-mpicc=' + argument_dict['--with-cc']
print '\nConfiguring and building AdjointMPI in externals/' + alt_name_ampi
print '====================================================================='
run_command(configure_ampi + ' && make clean && make', os.getcwd().rstrip() + '/preconf_ampi.log', os.getcwd().rstrip() + '/preconf_ampi.err', os.environ)
os.chdir(os.pardir)
os.chdir(os.pardir)
return pkg_environ, True
def submodule_status(path, update):
try:
status = check_output('git submodule status ' + path)
except RuntimeError:
return False
status_indicator = status[0][0]
if status_indicator == '+':
sys.stderr.write('WARNING: the currently checked out submodule commit in ' + path + ' does not match the SHA-1 found in the index.\n')
sys.stderr.write('Use \'git submodule update --init '+ path + '\' to reset the module if necessary.\n')
elif any([status_indicator == '-', update]):
print 'Initialize submodule ' + path + ' using git ... '
subprocess.check_call('git submodule update --init ' + path, shell = True)
elif status_indicator == ' ':
print 'Found submodule ' + path + '.'
return True
def download_module(name, alt_name, git_repo, commit_sha, logfile, errorfile):
print '\nInitializing ' + name + ' \'' + commit_sha + '\''
print '====================================================================='
# Download package
try:
print 'Downloading module from ' + git_repo
subprocess.check_call('wget -N ' + git_repo + '/archive/' + commit_sha + '.zip', stdout = logfile, stderr = errorfile, shell = True )
except subprocess.CalledProcessError:
print 'Download of module ' + name + ' failed. See preconf.err for more information.'
print 'To download it manually, perform the following steps:'
print '\t - Download the zip at \"' + git_repo + '/archive/' + commit_sha + '.zip\"'
print '\t - Extract the archive to externals/' + alt_name
print '\t - Execute command \'touch externals/'+ alt_name + '/' + commit_sha + '\''
print '\t - Run preconfigure.py again'
sys.exit()
# Extract zip archive
try:
print 'Extracting archive ...'
subprocess.check_call('unzip -u ' + commit_sha + '.zip', stdout = logfile, stderr = errorfile, shell=True)
except subprocess.CalledProcessError:
print 'Extraction of module ' + name + ' failed. See preconf.err for more information.'
sys.exit()
# Rename folder and create a file to identify the version
try:
print 'Creating identifier ...'
subprocess.check_call('mv '+ name + '-' + commit_sha + ' ' + alt_name + ' && touch ' + alt_name + '/' + commit_sha, stdout = logfile, stderr = errorfile, shell = True)
except subprocess.CalledProcessError:
print 'Renaming of module ' + name + ' failed. See preconf.err for more information.'
sys.exit()
# Remove archive
subprocess.check_call('rm ' + commit_sha + '.zip', shell=True)
def configure(argument_dict,
conf_environ,
mpi_support,
py_wrapper,
modes,
made_adolc,
made_codi):
# Set the base command for running configure
configure_base = '../configure'
# Add the arguments to the configure command
for arg in argument_dict:
configure_base = configure_base + " " + arg + "=" + argument_dict[arg]
configure_mode = ''
if mpi_support:
configure_base = configure_base + ' --enable-mpi'
if py_wrapper:
configure_base = configure_base + ' --enable-PY_WRAPPER'
build_dirs = ''
# Create the commands for the different configurations and run configure
for key in modes:
if modes[key]:
print '\nRunning configure in folder ' + key,
if modes[key] == 'CODI':
if key == 'SU2_DIRECTDIFF':
configure_mode = '--enable-codi-forward'
if key == 'SU2_AD':
configure_mode = '--enable-codi-reverse'
print 'using ' + modes[key]
elif modes[key] == 'ADOLC':
if key == 'SU2_DIRECTDIFF':
configure_mode = '--enable-adolc-forward'
if key == 'SU2_AD':
configure_mode = '--enable-adolc-reverse'
print 'using ' + modes[key]
elif modes[key] == 'COMPLEX':
configure_mode = '--enable-complex'
print 'using ' + modes[key]
else:
configure_mode = ''
print ''
print '====================================================================='
log = os.getcwd().rstrip() + '/conf_'+ key+'.log'
err = os.getcwd().rstrip() + '/conf_'+ key+'.err'
if not os.path.exists(key):
os.mkdir(key)
os.chdir(key)
run_command(configure_base + ' ' + configure_mode, log, err, conf_environ)
os.chdir(os.pardir)
build_dirs += key + ' '
write_makefile(build_dirs)
print '\nPre-configuration Summary:\n' \
'=====================================================================\n'\
'\tConfiguration sets: '+ build_dirs + '\n'
print '\tUse "make <install>" to compile (and install) all configured binaries:\n'
if modes['SU2_BASE']:
print '\tSU2_CFD -> General solver for direct, cont. adjoint and linearized equations.\n' \
'\tSU2_DOT -> Gradient Projection Code.\n' \
'\tSU2_DEF -> Mesh Deformation Code.\n' \
'\tSU2_MSH -> Mesh Adaption Code.\n' \
'\tSU2_SOL -> Solution Export Code.\n' \
'\tSU2_GEO -> Geometry Definition Code.\n'
if modes['SU2_AD']:
print '\tSU2_CFD_AD -> Discrete Adjoint Solver and general AD support.'
print '\tSU2_DOT_AD -> Mesh sensitivity computation and general AD support.'
if modes['SU2_DIRECTDIFF']:
print '\tSU2_CFD_DIRECTDIFF -> Direct Differentation Mode.'
print '\n'
print '\tPlease be sure to add the $SU2_HOME and $SU2_RUN environment variables,\n' \
'\tand update your $PATH (and $PYTHONPATH if applicable) with $SU2_RUN.\n' \
'\n' \
'\tBased on the input to this configuration, add these lines to your .bashrc file: \n' \
'\n' \
'\texport SU2_RUN="'+argument_dict['--prefix']+'/bin"\n' \
'\texport SU2_HOME="'+os.getcwd().rstrip()+'"\n' \
'\texport PATH=$PATH:$SU2_RUN\n' \
'\texport PYTHONPATH=$PYTHONPATH:$SU2_RUN\n'
def run_command(command, log, err, env):
try:
logfile = open(log, 'w')
errfile = open(err, 'w')
print 'Command: ' + command
subprocess.check_call(command, env = env, stdout = logfile, stderr = errfile, shell=True)
print 'Logfile written to ' + log
logfile.close()
errfile.close()
except subprocess.CalledProcessError:
errfile = open(err, 'r')
print '\nThere was an error while running command \'' + command + '\'.'
print '=== Error Log ==='
print errfile.read()
errfile.close()
sys.exit(1)
def check_output(cmd):
std, err = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell = True).communicate()
if err:
raise RuntimeError(err)
return std
def write_makefile(build_dirs):
print '\nCreating Makefile ...\n'
makefile = open('Makefile', 'w')
makefile.writelines(['# This file is auto-generated by preconfigure.py\n',
'SUBDIRS = '+ build_dirs + '\n',
'INSTALLDIRS = $(SUBDIRS:%=install-%)\n',
'CLEANDIRS = $(SUBDIRS:%=clean-%)\n',
'\n',
'subdirs: $(SUBDIRS)\n',
'\n',
'$(SUBDIRS):\n',
'\t$(MAKE) -C $@\n',
'\n',
'install: $(INSTALLDIRS)\n',
'$(INSTALLDIRS):\n',
'\t$(MAKE) -C $(@:install-%=%) install\n',
'\n',
'clean: $(CLEANDIRS)\n',
'$(CLEANDIRS):\n',
'\t$(MAKE) -C $(@:clean-%=%) clean\n',
'\n',
'.PHONY: subdirs $(SUBDIRS)\n',
'.PHONY: subdirs $(INSTALLDIRS)\n',
'.PHONY: subdirs $(CLEANDIRS)\n',
'.PHONY: install\n'])
makefile.close()
def header():
print '-------------------------------------------------------------------------\n'\
'| ___ _ _ ___ | \n'\
'| / __| | | |_ ) Release 5.0.0 \'Raven\' | \n'\
'| \__ \ |_| |/ / | \n'\
'| |___/\___//___| Pre-configuration Script | \n'\
'| | \n'\
'------------------------------------------------------------------------- \n'\
'| SU2 Original Developers: Dr. Francisco D. Palacios. | \n'\
'| Dr. Thomas D. Economon. | \n'\
'------------------------------------------------------------------------- \n'\
'| SU2 Developers: | \n'\
'| - Prof. Juan J. Alonso\'s group at Stanford University. | \n'\
'| - Prof. Piero Colonna\'s group at Delft University of Technology. | \n'\
'| - Prof. Nicolas R. Gauger\'s group at Kaiserslautern U. of Technology. | \n'\
'| - Prof. Alberto Guardone\'s group at Polytechnic University of Milan. | \n'\
'| - Prof. Rafael Palacios\' group at Imperial College London. | \n'\
'| - Prof. Edwin van der Weide\'s group at the University of Twente. | \n'\
'| - Prof. Vincent Terrapon\'s group at the University of Liege. | \n'\
'------------------------------------------------------------------------- \n'\
'| Copyright (C) 2012-2017 SU2, the open-source CFD code. | \n'\
'| | \n'\
'| SU2 is free software; you can redistribute it and/or | \n'\
'| modify it under the terms of the GNU Lesser General Public | \n'\
'| License as published by the Free Software Foundation; either | \n'\
'| version 2.1 of the License, or (at your option) any later version. | \n'\
'| | \n'\
'| SU2 is distributed in the hope that it will be useful, | \n'\
'| but WITHOUT ANY WARRANTY; without even the implied warranty of | \n'\
'| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | \n'\
'| Lesser General Public License for more details. | \n'\
'| | \n'\
'| You should have received a copy of the GNU Lesser General Public | \n'\
'| License along with SU2. If not, see <http://www.gnu.org/licenses/>. | \n'\
'------------------------------------------------------------------------- \n'
# -------------------------------------------------------------------
# Run Main Program
# -------------------------------------------------------------------
# this is only accessed if running from command prompt
if __name__ == '__main__':
main()