3 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
5 import os,sys,imp,types,re
6 from waflib import Utils,Configure,Options,Logs,Errors
7 from waflib.Tools import fc
8 fc_compiler={'win32':['gfortran','ifort'],'darwin':['gfortran','g95','ifort'],'linux':['gfortran','g95','ifort'],'java':['gfortran','g95','ifort'],'default':['gfortran'],'aix':['gfortran']}
9 def default_compilers():
10 build_platform=Utils.unversioned_sys_platform()
11 possible_compiler_list=fc_compiler.get(build_platform,fc_compiler['default'])
12 return' '.join(possible_compiler_list)
14 try:test_for_compiler=conf.options.check_fortran_compiler or default_compilers()
15 except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_fc')")
16 for compiler in re.split('[ ,]+',test_for_compiler):
18 conf.start_msg('Checking for %r (Fortran compiler)'%compiler)
21 except conf.errors.ConfigurationError ,e:
24 Logs.debug('compiler_fortran: %r'%e)
27 conf.end_msg(conf.env.get_flat('FC'))
28 conf.env.COMPILER_FORTRAN=compiler
32 conf.fatal('could not configure a Fortran compiler!')
34 test_for_compiler=default_compilers()
35 opt.load_special_tools('fc_*.py')
36 fortran_compiler_opts=opt.add_option_group('Configuration options')
37 fortran_compiler_opts.add_option('--check-fortran-compiler',default=None,help='list of Fortran compiler to try [%s]'%test_for_compiler,dest="check_fortran_compiler")
38 for x in test_for_compiler.split():