3 # harald at klimachs.de
6 from waflib
.Tools
import fc
, fc_config
, fc_scan
7 from waflib
.Configure
import conf
9 from waflib
.Tools
.compiler_fc
import fc_compiler
10 fc_compiler
['linux'].append('fc_nec')
14 """Find the NEC fortran compiler (will look in the environment variable 'FC')"""
15 fc
= conf
.find_program(['sxf90','sxf03'], var
='FC')
16 conf
.get_sxfc_version(fc
)
17 conf
.env
.FC_NAME
= 'NEC'
18 conf
.env
.FC_MOD_CAPITALIZATION
= 'lower'
23 v
['_FCMODOUTFLAGS'] = [] # enable module files and put them in the current directory
24 v
['FCFLAGS_DEBUG'] = [] # more verbose compiler warnings
25 v
['FCFLAGS_fcshlib'] = []
26 v
['LINKFLAGS_fcshlib'] = []
28 v
['FCSTLIB_MARKER'] = ''
29 v
['FCSHLIB_MARKER'] = ''
32 def get_sxfc_version(conf
, fc
):
33 version_re
= re
.compile(r
"FORTRAN90/SX\s*Version\s*(?P<major>\d*)\.(?P<minor>\d*)", re
.I
).search
35 out
,err
= fc_config
.getoutput(conf
, cmd
, stdin
=False)
37 match
= version_re(out
)
39 match
= version_re(err
)
41 version_re
=re
.compile(r
"NEC Fortran 2003 Compiler for\s*(?P<major>\S*)\s*\(c\)\s*(?P<minor>\d*)",re
.I
).search
43 match
= version_re(out
)
45 match
= version_re(err
)
47 conf
.fatal('Could not determine the NEC Fortran compiler version.')
49 conf
.env
['FC_VERSION'] = (k
['major'], k
['minor'])
53 conf
.find_program('sxar',var
='AR')
54 conf
.add_os_flags('ARFLAGS')
55 if not conf
.env
.ARFLAGS
:
56 conf
.env
.ARFLAGS
=['rcs']