-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
262 lines (231 loc) · 10.3 KB
/
wscript
File metadata and controls
262 lines (231 loc) · 10.3 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
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
# Copyright (c) 2014-2016, 2018-2019 Harald Klimach <harald@klimachs.de>
# Copyright (c) 2014 Tobias Schneider <tobias1.schneider@student.uni-siegen.de>
# Copyright (c) 2015-2016 Nikhil Anand <nikhil.anand@uni-siegen.de>
# Copyright (c) 2015 Kay Langhammer <kay.langhammer@student.uni-siegen.de>
# Copyright (c) 2016 Verena Krupp
# Copyright (c) 2016 Peter Vitt <peter.vitt2@uni-siegen.de>
#
# Parts of this file were written by Harald Klimach, Tobias Schneider, Kay
# Langhammer, Verena Krupp, Peter Vitt and Nikhil Anand for Universit of
# Siegen.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# **************************************************************************** !
#! /usr/bin/env python
APPNAME = 'polynomials'
VERSION = '1'
top = '.'
out = 'build'
def configure(conf):
from waflib import Errors, Logs
if conf.env.FC_NAME == 'NFORT':
conf.setenv("cenv")
conf.check(lib='asl_sequential', uselib_store='ASL', mandatory=False)
conf.check(lib='aslfftw3', uselib_store='FFTW3', use='ASL', mandatory=False)
if conf.env.LIB_FFTW3:
conf.all_envs[''].LIB_ASL = conf.env.LIB_ASL
conf.all_envs[''].LIB_FFTW3 = conf.env.LIB_FFTW3 + conf.env.LIB_ASL
conf.setenv('')
else:
# Check for FFTW lib (if not on Aurora with nfort)
fftw_libpath = None
fftw_omplibpath = None
if conf.options.fftw_libpath:
fftw_libpath = conf.options.fftw_libpath
elif conf.options.fftw_path:
fftw_libpath = conf.options.fftw_path + '/lib'
conf.setenv("cenv")
if fftw_libpath:
Logs.info('Checking path to FFTW lib: ' + fftw_libpath)
conf.check(lib='fftw3', libpath=fftw_libpath, uselib_store='FFTW3', mandatory=False)
if conf.options.fftw_incpath:
conf.env.INCLUDES_FFTW3 = conf.options.fftw_incpath
elif conf.options.fftw_path:
conf.env.INCLUDES_FFTW3 = conf.options.fftw_path+'/include'
else:
# Try to use pkg-config to find the FFTW library.
oenv = conf.env.env
# Empty the CPATH for pkg-config, as it will be ignored by the Fortran compiler
conf.env.env = dict(conf.environ)
conf.env.env['CPATH'] = ''
conf.check_cfg(package='fftw3', uselib_store='FFTW3',
args=['--cflags', '--libs'], mandatory=False)
conf.env.env = oenv
if not conf.env.LIB_FFTW3:
# Try to link the fftw without any further options.
conf.check(lib='fftw3', uselib_store='FFTW3', mandatory=False)
if conf.env.LIB_FFTW3:
FFTW_INCLUDES = conf.env.INCLUDES_FFTW3
if len(conf.env.INCLUDES_FFTW3) == 0:
FFTW_INCLUDES.append('/usr/include')
conf.all_envs[''].FCFLAGS_FFTW3 = conf.env.CFLAGS_FFTW3
conf.all_envs[''].LIB_FFTW3 = conf.env.LIB_FFTW3
conf.all_envs[''].LIBPATH_FFTW3 = conf.env.LIBPATH_FFTW3
conf.all_envs[''].INCLUDES_FFTW3 = FFTW_INCLUDES
conf.setenv('')
if conf.env.LIB_FFTW3:
try:
# Check for the fftw3.f03 header:
Logs.info(f'FFTW include dirs: {conf.env.INCLUDES_FFTW3}')
if conf.env.LIB_ASL:
conf.check_fc(fragment= "program test\n use, intrinsic :: iso_c_binding\n include 'aslfftw3.f03'\nend program test",
includes= conf.env.INCLUDES_FFTW3,
msg = "Checking for the fftw3.f03 header",
errmsg = "ASLFFTW header not found, make sure to source /opt/nec/ve/nlc/X.X.X/bin/nlcvars.sh!"
)
conf.env.WITH_ASL = True
else:
conf.check_fc(fragment= "program test\n use, intrinsic :: iso_c_binding\n include 'fftw3.f03'\nend program test",
includes= conf.env.INCLUDES_FFTW3,
msg = "Checking for the fftw3.f03 header",
errmsg = "FFTW lib seems to be available, but no compatible Fortran header (need FFTW >=3.3.1)!"
)
except Errors.ConfigurationError:
conf.env.LIB_FFTW3 = None
if not conf.env.LIB_FFTW3:
# There is no FFTW found, use a dummy library to abort upon calls to the library.
Logs.warn('There was NO FFTW3 library found, using a dummy implementation.')
Logs.warn('You will not be able to use the FPT with the MODG scheme!')
Logs.warn('')
# Check for m lib (necessary for FXTP):
conf.check_cc(lib='m', uselib_store='MATH')
def build(bld):
from waflib import Logs
from waflib.extras.utest_results import utests
ply_sources = bld.path.ant_glob('source/fpt/*.f90')
ply_sources += bld.path.ant_glob('source/*.f90')
ply_ppsources = bld.path.ant_glob('source/fpt/*.fpp')
ply_ppsources += bld.path.ant_glob('source/*.fpp')
ply_sources += ply_ppsources
#FXTP Sources
fxtp_wrap_sources = ['external/fxtp/fxt_fif.f90',
'external/fxtp/fxt_fwrap.f90']
fxtp_sources = ['fxt_faltld.c',
'fxt_faltld_comp.c',
'fxt_faltld_preproc.c',
'fxt_file.c',
'fxt_error.c',
'fxt_flptld.c',
'fxt_flptld_comp.c',
'fxt_flptld_preproc.c',
'fxt_fmmld.c',
'fxt_fmmld_estimate.c',
'fxt_fmmld_evaluate.c',
'fxt_fmmld_evl.c',
'fxt_fmmld_exp.c',
'fxt_fmmld_lagld.c',
'fxt_fmmld_locexpmat.c',
'fxt_fmmld_matrix.c',
'fxt_fmmld_mulexpmat.c',
'fxt_fmmld_network.c',
'fxt_fmmld_preproc.c',
'fxt_fmmld_regions.c',
'fxt_fmmld_scalefmm.c',
'fxt_fmmld_scalevec.c',
'fxt_fxtld.c',
'fxt_fxtld_amat.c',
'fxt_fxtld_comp.c',
'fxt_fxtld_div.c',
'fxt_fxtld_fmm.c',
'fxt_fxtld_info.c',
'fxt_fxtld_lagld.c',
'fxt_fxtld_make.c',
'fxt_fxtld_scale.c',
'fxt_lagld.c',
'fxt_lagld_comp.c',
'fxt_lagld_drop.c',
'fxt_lagld_normal.c',
'fxt_lagld_oper.c',
'fxt_math_gaussll.c',
'fxt_math_legendrell.c',
'fxt_math_lsqrt.c',
'fxt_matld.c',
'fxt_matld_drop.c',
'fxt_matld_glq.c',
'fxt_matld_ipstab.c',
'fxt_matld_lagld.c',
'fxt_matld_lowrank.c',
'fxt_matld_vecld.c',
'fxt_matll.c',
'fxt_matll_drop.c',
'fxt_matll_ipstab.c',
'fxt_sarld.c',
'fxt_sarld_comp.c',
'fxt_sarld_error.c',
'fxt_sarld_lagld.c',
'fxt_sarld_scale.c',
'fxt_vecl.c',
'fxt_vecld.c',
'fxt_vecll.c']
for i_source in range(0, len(fxtp_sources)):
fxtp_sources[i_source] = 'external/fxtp/fxtpack140715/' + fxtp_sources[i_source]
if bld.cmd != 'docu':
if bld.env.LIB_FFTW3:
fftwdep = 'FFTW3'
if bld.env.WITH_ASL:
fftwrapsource = 'external/fftw/aslfftw_wrap.f90'
else:
fftwrapsource = 'external/fftw/fftw_wrap.f90'
bld( features = 'fc',
source = fftwrapsource,
use = fftwdep,
target = 'fftw_mod_obj')
else:
Logs.warn('Using the *dummy* FFTW here!')
bld( features = 'fc',
source = 'external/dummy/fftw_wrap.f90',
target = 'fftw_mod_obj')
bld( features = 'c',
source = fxtp_sources,
use = ['MATH'],
includes = 'external/fxtp/fxtpack140715',
target = 'fxtp_obj')
bld( features = 'c',
source = ['external/fxtp/fxtf_wrapper.c'],
use = ['MATH'],
includes = 'external/fxtp/fxtpack140715',
target = 'fxtp_wrapper')
bld( features = 'fc',
source = fxtp_wrap_sources,
use = ['MATH'],
target = 'fxtp_wrap_obj')
bld(
features = 'coco fc',
source = ply_sources,
use = ['FFTW3', 'NAG', 'tem_objs', 'fftw_mod_obj', 'aotus'],
target = 'ply_objs')
bld(
features = 'fc fcprogram',
source = ['peons/approximate_1D_jump.f90'],
use = ['FFTW3', 'NAG', 'tem_objs', 'ply_objs', 'fftw_mod_obj',
bld.env.mpi_mem_c_obj, 'fxtp_wrap_obj', 'fxtp_obj',
'PRECICE', 'fxtp_wrapper', 'aotus'],
target = 'approximate_1D_jump')
test_dep = ['FFTW3', 'NAG', 'tem_objs', bld.env.mpi_mem_c_obj,
'ply_objs', 'fftw_mod_obj', 'fxtp_wrap_obj', 'fxtp_obj',
'fxtp_wrapper', 'aotus']
utest_sources = bld.path.ant_glob('utests/*_module.f90')
bld(
features = 'fc',
source = utest_sources,
use = ['tem_objs', 'aotus', 'ply_objs'],
target = 'ply_utest_objs')
test_dep.append('ply_utest_objs')
test_dep.append('PRECICE')
utests(bld = bld, use = test_dep)
if bld.env.LIB_FFTW3 or bld.env.WITH_ASL:
utests(bld = bld, use = test_dep, path = 'utests/with_fftw')
else:
bld.env.ply_pp = bld(
features = 'includes coco',
source = ply_ppsources)