3 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
5 import os,sys,imp,types
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 __list_possible_compiler(platform):
11 return fc_compiler[platform]
13 return fc_compiler["default"]
15 try:test_for_compiler=conf.options.check_fc
16 except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_fc')")
17 for compiler in test_for_compiler.split():
19 conf.start_msg('Checking for %r (fortran compiler)'%compiler)
22 except conf.errors.ConfigurationError ,e:
25 Logs.debug('compiler_fortran: %r'%e)
28 conf.end_msg(conf.env.get_flat('FC'))
29 conf.env.COMPILER_FORTRAN=compiler
33 conf.fatal('could not configure a fortran compiler!')
35 opt.load_special_tools('fc_*.py')
36 build_platform=Utils.unversioned_sys_platform()
37 detected_platform=Options.platform
38 possible_compiler_list=__list_possible_compiler(detected_platform)
39 test_for_compiler=' '.join(possible_compiler_list)
40 fortran_compiler_opts=opt.add_option_group("Fortran Compiler Options")
41 fortran_compiler_opts.add_option('--check-fortran-compiler',default="%s"%test_for_compiler,help='On this platform (%s) the following Fortran Compiler will be checked by default: "%s"'%(detected_platform,test_for_compiler),dest="check_fc")
42 for compiler in test_for_compiler.split():
43 opt.load('%s'%compiler)