aboutsummaryrefslogtreecommitdiff
path: root/environment.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-09-08 23:06:49 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-09-08 23:06:49 +0300
commit36d6fc47b3be6bee0742ce1040dacc9c8df17500 (patch)
treecbef6f44a0ff90949c5b17b484fb29d4b3f09f1c /environment.py
parentd79b8a19a06ef4b0957acd7295434b0726b4d7d0 (diff)
downloadmeson-36d6fc47b3be6bee0742ce1040dacc9c8df17500.zip
meson-36d6fc47b3be6bee0742ce1040dacc9c8df17500.tar.gz
meson-36d6fc47b3be6bee0742ce1040dacc9c8df17500.tar.bz2
Fortran compiler fixes from Peter Koval.
Diffstat (limited to 'environment.py')
-rw-r--r--environment.py40
1 files changed, 37 insertions, 3 deletions
diff --git a/environment.py b/environment.py
index cf32d5e..8fd5429 100644
--- a/environment.py
+++ b/environment.py
@@ -1159,7 +1159,7 @@ class FortranCompiler():
return True
def sanity_check(self, work_dir):
- source_name = os.path.join(work_dir, 'sanitycheckf.f95')
+ source_name = os.path.join(work_dir, 'sanitycheckf.f90')
binary_name = os.path.join(work_dir, 'sanitycheckf')
ofile = open(source_name, 'w')
ofile.write('''program prog
@@ -1190,7 +1190,7 @@ end program prog
return []
def get_std_warn_args(self):
- return GnuFortranCompiler.std_warn_args
+ return FortranCompiler.std_warn_args
def get_buildtype_args(self, buildtype):
return gnulike_buildtype_args[buildtype]
@@ -1257,6 +1257,9 @@ class G95FortranCompiler(FortranCompiler):
super().__init__(exelist, version, is_cross, exe_wrapper=None)
self.id = 'g95'
+ def get_module_outdir_args(self, path):
+ return ['-fmod='+path]
+
class SunFortranCompiler(FortranCompiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None):
super().__init__(exelist, version, is_cross, exe_wrapper=None)
@@ -1266,7 +1269,35 @@ class SunFortranCompiler(FortranCompiler):
return ['-fpp']
def get_always_args(self):
- return ['']
+ return []
+
+ def get_std_warn_args(self):
+ return []
+
+ def get_module_outdir_args(self, path):
+ return ['-moddir='+path]
+
+class IntelFortranCompiler(FortranCompiler):
+ std_warn_args = ['-warn', 'all']
+
+ def __init__(self, exelist, version, is_cross, exe_wrapper=None):
+ super().__init__(exelist, version, is_cross, exe_wrapper=None)
+ self.id = 'intel'
+
+ def get_module_outdir_args(self, path):
+ return ['-module', path]
+
+ def get_always_args(self):
+ return []
+
+ def can_compile(self, src):
+ suffix = os.path.splitext(src)[1].lower()
+ if suffix == '.f' or suffix == '.f90':
+ return True
+ return False
+
+ def get_std_warn_args(self):
+ return IntelFortranCompiler.std_warn_args
class VisualStudioLinker():
always_args = ['/NOLOGO']
@@ -1580,6 +1611,9 @@ class Environment():
version = vmatch.group(0)
return SunFortranCompiler([compiler], version, is_cross, exe_wrap)
+ if 'ifort (IFORT)' in out:
+ return IntelFortranCompiler([compiler], version, is_cross, exe_wrap)
+
raise EnvironmentException('Unknown compiler(s): "' + ', '.join(compilers) + '"')
def get_scratch_dir(self):