3 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
7 # harald at klimachs.de
10 from waflib import Utils
11 from waflib.Tools import fc,fc_config,fc_scan
12 from waflib.Configure import conf
14 from waflib.Tools.compiler_fc import fc_compiler
15 fc_compiler['linux'].insert(0, 'fc_open64')
18 def find_openf95(conf):
19 """Find the Open64 Fortran Compiler (will look in the environment variable 'FC')"""
21 fc = conf.find_program(['openf95', 'openf90'], var='FC')
22 conf.get_open64_version(fc)
23 conf.env.FC_NAME = 'OPEN64'
24 conf.env.FC_MOD_CAPITALIZATION = 'UPPER.mod'
27 def openf95_flags(conf):
29 v['FCFLAGS_DEBUG'] = ['-fullwarn']
32 def openf95_modifier_platform(conf):
33 dest_os = conf.env['DEST_OS'] or Utils.unversioned_sys_platform()
34 openf95_modifier_func = getattr(conf, 'openf95_modifier_' + dest_os, None)
35 if openf95_modifier_func:
36 openf95_modifier_func()
39 def get_open64_version(conf, fc):
40 """Get the Open64 compiler version"""
42 version_re = re.compile(r"Open64 Compiler Suite: *Version *(?P<major>\d*)\.(?P<minor>\d*)", re.I).search
43 cmd = fc + ['-version']
45 out, err = fc_config.getoutput(conf,cmd,stdin=False)
47 match = version_re(out)
49 match = version_re(err)
51 conf.fatal('Could not determine the Open64 version.')
53 conf.env['FC_VERSION'] = (k['major'], k['minor'])
61 conf.openf95_modifier_platform()