-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
176 lines (149 loc) · 6.81 KB
/
wscript
File metadata and controls
176 lines (149 loc) · 6.81 KB
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
#! /usr/bin/env python
# encoding: utf-8
# Harald Klimach 2011
#
# Compilation will create the executable and execute all unit tests,
# if you only to compile, without execution, use --notests
import os
import glob
APPNAME = 'ateles'
VERSION = '1'
top = '.'
out = 'build'
def options(opt):
opt.load('eclipse')
opt.add_option('--no_harvesting', action='store_true',
default=False,
help = 'Do not include harvesting files for compilation.',
dest = 'no_harvesting')
def configure(conf):
from waflib import Logs
if not conf.options.no_harvesting:
conf.env.build_hvs = True
else:
conf.env.build_hvs = False
conf.setenv('')
Logs.warn('Ateles specific configuration:')
# Avoid some warnings in gfortran:
if not conf.options.nowarn:
for key, fenv in conf.all_envs.items():
if fenv.FC_NAME == 'GFORTRAN':
fenv.FCFLAGS.append('-Wno-unused-dummy-argument')
fenv.FCFLAGS.append('-Wno-uninitialized')
if not conf.options.openmp:
fenv.FCFLAGS.append('-fmax-stack-var-size=131072')
Logs.warn('Ateles modified flags:')
Logs.warn('Default flags: {0}'.format(' '.join(conf.all_envs[''].FCFLAGS)))
Logs.warn('Debug flags: {0}'.format(' '.join(conf.all_envs['debug'].FCFLAGS)))
conf.setenv('')
conf.setenv('ford', conf.env)
conf.env.ford_mainpage = 'mainpage.md'
conf.env.fordurl_atl = 'https://apes-suite.github.io/ateles/'
def build(bld):
ateles_sources = bld.path.ant_glob('source/*.f90',
excl='source/ateles.f90')
ateles_sources += bld.path.ant_glob('source/equation/*.f90')
ateles_sources += bld.path.ant_glob('source/filter/*.f90')
ateles_sources += bld.path.ant_glob('source/flux/*.f90')
ateles_sources += bld.path.ant_glob('source/scheme/*.f90')
ateles_sources += bld.path.ant_glob('source/scheme/modg/*.f90')
ateles_sources += bld.path.ant_glob('source/scheme/modg_2d/*.f90')
ateles_sources += bld.path.ant_glob('source/scheme/modg_1d/*.f90')
ateles_sources += bld.path.ant_glob('source/scheme/modg/fpt/*.f90')
ateles_sources += bld.path.ant_glob('source/timestepping/*.f90')
ateles_sources += bld.path.ant_glob('source/material/*.f90')
ateles_sources += bld.path.ant_glob('source/exchange/*.f90')
atl_ppsources = bld.path.ant_glob('source/*.fpp')
atl_ppsources += bld.path.ant_glob('source/equation/*.fpp')
atl_ppsources += bld.path.ant_glob('source/filter/*.fpp')
atl_ppsources += bld.path.ant_glob('source/material/*.fpp')
atl_ppsources += bld.path.ant_glob('source/scheme/*.fpp')
atl_ppsources += bld.path.ant_glob('source/scheme/modg/*.fpp')
atl_ppsources += bld.path.ant_glob('source/scheme/modg_2d/*.fpp')
atl_ppsources += bld.path.ant_glob('source/scheme/modg_1d/*.fpp')
ateles_sources += atl_ppsources
if bld.cmd != 'docu':
compile_atl(bld, ateles_sources)
bld(
features = 'fc fcprogram',
name = 'ateles',
source = 'source/ateles.f90',
use = ['atl_objs', 'tem_objs', 'ply_objs', 'aotus', bld.env.distcrc,
bld.env.mpi_mem_c_obj, 'fftw_mod_obj', 'NAG',
'fxtp_wrap_obj', 'fxtp_obj', 'fxtp_wrapper',
'PRECICE','MPICXX', 'PYLIB', 'STDCXX', 'RT', 'ZLIB', 'PETSC',
'BOOST_system', 'BOOST_filesystem'],
target = bld.path.parent.find_or_declare('ateles'))
bld(
features = 'fc fcprogram',
source = 'peons/solve_euler_riemann.f90',
use = ['atl_objs', 'tem_objs', 'ply_objs', 'aotus',
bld.env.mpi_mem_c_obj, 'fftw_mod_obj', 'NAG', bld.env.distcrc,
'fxtp_wrap_obj', 'fxtp_obj', 'fxtp_wrapper',
'PRECICE', 'MPICXX', 'PYLIB', 'STDCXX', 'RT', 'ZLIB', 'PETSC',
'BOOST_system', 'BOOST_filesystem'],
target = 'solve_euler_riemann')
if bld.env.build_hvs and not bld.options.no_harvesting:
bld(
features = 'fc fcprogram',
name = 'atl_harvesting',
source = 'source/atl_harvesting/atl_harvesting.f90',
use = ['atl_objs', 'tem_objs', 'ply_objs', 'aotus', bld.env.distcrc,
bld.env.mpi_mem_c_obj, 'fftw_mod_obj', 'NAG', 'base64',
'fxtp_wrap_obj', 'fxtp_obj', 'fxtp_wrapper',
'PRECICE','MPICXX', 'PYLIB', 'STDCXX', 'RT', 'ZLIB', 'PETSC',
'BOOST_system', 'BOOST_filesystem'],
target = bld.path.parent.find_or_declare('atl_harvesting'))
else:
from waflib.extras.make_fordoc import gendoc
app = bld(
features = 'includes coco',
source = atl_ppsources)
if not bld.env.fordonline:
atl_preprocessed.append(bld.env.fordext_aotus)
atl_preprocessed.append(bld.env.fordext_tem)
tgt = bld.path.get_bld().make_node('docu/modules.json')
bld.env.fordext_atl = tgt
gd_args = {
"rule" : gendoc,
"src_paths" : [bld.path.find_node('source').abspath(),
bld.path.parent.find_node('polynomials').abspath(),
bld.path.parent.get_bld().abspath()
],
"target" : tgt,
"mainpage" : os.path.join(bld.top_dir, 'atl', 'mainpage.md')
}
if bld.env.fordonline:
bld( **gd_args,
extern_urls = ['aoturl = {0}'.format(bld.env.fordurl_aotus),
'temurl = {0}'.format(bld.env.fordurl_tem)
]
)
else:
bld( **gd_args,
extern = ['aoturl = {0}'.format(bld.env.fordext_aotus),
'temurl = {0}'.format(bld.env.fordext_tem)
],
)
def compile_atl(bld, ateles_sources):
from waflib.extras.utest_results import utests
bld(
features = 'coco fc',
source = ateles_sources,
use = ['FFTW3', 'NAG'],
target = 'atl_objs')
test_dep = ['aotus', 'atl_objs', 'tem_objs', 'ply_objs', bld.env.distcrc,
bld.env.mpi_mem_c_obj, 'fftw_mod_obj', 'NAG',
'fxtp_wrap_obj', 'fxtp_obj', 'fxtp_wrapper',
'PRECICE', 'MPICXX', 'PYLIB', 'STDCXX', 'RT', 'ZLIB']
utests(bld = bld, use = test_dep, preprocessor='coco')
if bld.env.LIB_FFTW3:
utests(bld = bld, use = test_dep, path = 'utests/with_fftw')
# clean output files
# add different extension format to remove
# by extending outputfiles list using outfiles.extend(glob.glob('*.yourfileext')
def cleanoutput(ctx):
outputfiles=[]
outputfiles.extend(glob.glob('*.vtk'))
for output in outputfiles:
os.remove(output)