ifort: Derive from IntelCompiler base class

And fix the list of supported file suffixes, and use .f90 for all
fortran tests since ifort, the Intel Fortran compiler ignores files
ending with .f95, .f03, and .f08
pull/1253/head
Nirbheek Chauhan 8 years ago
parent 6e5c87e380
commit 2589009d23
  1. 16
      mesonbuild/compilers.py
  2. 2
      test cases/fortran/1 basic/meson.build
  3. 0
      test cases/fortran/1 basic/simple.f90
  4. 2
      test cases/fortran/2 modules/meson.build
  5. 0
      test cases/fortran/2 modules/prog.f90
  6. 0
      test cases/fortran/2 modules/stuff.f90
  7. 0
      test cases/fortran/5 static/main.f90
  8. 4
      test cases/fortran/5 static/meson.build
  9. 0
      test cases/fortran/5 static/static_hello.f90
  10. 0
      test cases/fortran/6 dynamic/dynamic.f90
  11. 0
      test cases/fortran/6 dynamic/main.f90
  12. 4
      test cases/fortran/6 dynamic/meson.build

@ -33,7 +33,9 @@ lib_suffixes = ('a', 'lib', 'dll', 'dylib', 'so')
lang_suffixes = {
'c': ('c',),
'cpp': ('cpp', 'cc', 'cxx', 'c++', 'hh', 'hpp', 'ipp', 'hxx'),
'fortran': ('f', 'f90', 'f95'),
# f90, f95, f03, f08 are for free-form fortran ('f90' recommended)
# f, for, ftn, fpp are for fixed-form fortran ('f' or 'for' recommended)
'fortran': ('f90', 'f95', 'f03', 'f08', 'f', 'for', 'ftn', 'fpp'),
'd': ('d', 'di'),
'objc': ('m',),
'objcpp': ('mm',),
@ -2704,12 +2706,15 @@ class SunFortranCompiler(FortranCompiler):
def get_module_outdir_args(self, path):
return ['-moddir=' + path]
class IntelFortranCompiler(FortranCompiler):
class IntelFortranCompiler(IntelCompiler, FortranCompiler):
std_warn_args = ['-warn', 'all']
def __init__(self, exelist, version, is_cross, exe_wrapper=None):
self.file_suffixes = ('f', 'f90')
super().__init__(exelist, version, is_cross, exe_wrapper=None)
self.file_suffixes = ('f90', 'f', 'for', 'ftn', 'fpp')
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
# FIXME: Add support for OS X and Windows in detect_fortran_compiler so
# we are sent the type of compiler
IntelCompiler.__init__(self, ICC_STANDARD)
self.id = 'intel'
def get_module_outdir_args(self, path):
@ -2771,9 +2776,6 @@ class NAGFortranCompiler(FortranCompiler):
def get_module_outdir_args(self, path):
return ['-mdir', path]
def get_always_args(self):
return []
def get_warn_args(self, level):
return NAGFortranCompiler.std_warn_args

@ -2,6 +2,6 @@ project('simple fortran', 'fortran')
add_global_arguments('-fbounds-check', language : 'fortran')
e = executable('simple', 'simple.f95',
e = executable('simple', 'simple.f90',
fortran_args : '-ffree-form')
test('Simple Fortran', e)

@ -1,4 +1,4 @@
project('modules', 'fortran')
e = executable('modprog', 'stuff.f95', 'prog.f95')
e = executable('modprog', 'stuff.f90', 'prog.f90')
test('moduletest', e)

@ -1,5 +1,5 @@
project('try-static-library', 'fortran')
static_hello = static_library('static_hello', 'static_hello.f95')
static_hello = static_library('static_hello', 'static_hello.f90')
executable('test_exe', 'main.f95', link_with : static_hello)
executable('test_exe', 'main.f90', link_with : static_hello)

@ -1,4 +1,4 @@
project('dynamic_fortran', 'fortran')
dynamic = shared_library('dynamic', 'dynamic.f95')
executable('test_exe', 'main.f95', link_with : dynamic)
dynamic = shared_library('dynamic', 'dynamic.f90')
executable('test_exe', 'main.f90', link_with : dynamic)

Loading…
Cancel
Save