@@ -1159,7 +1159,7 @@ def needs_static_linker(self):
1159
1159
return True
1160
1160
1161
1161
def sanity_check (self , work_dir ):
1162
- source_name = os .path .join (work_dir , 'sanitycheckf.f95 ' )
1162
+ source_name = os .path .join (work_dir , 'sanitycheckf.f90 ' )
1163
1163
binary_name = os .path .join (work_dir , 'sanitycheckf' )
1164
1164
ofile = open (source_name , 'w' )
1165
1165
ofile .write ('''program prog
@@ -1190,7 +1190,7 @@ def get_linker_always_args(self):
1190
1190
return []
1191
1191
1192
1192
def get_std_warn_args (self ):
1193
- return GnuFortranCompiler .std_warn_args
1193
+ return FortranCompiler .std_warn_args
1194
1194
1195
1195
def get_buildtype_args (self , buildtype ):
1196
1196
return gnulike_buildtype_args [buildtype ]
@@ -1257,6 +1257,9 @@ def __init__(self, exelist, version, is_cross, exe_wrapper=None):
1257
1257
super ().__init__ (exelist , version , is_cross , exe_wrapper = None )
1258
1258
self .id = 'g95'
1259
1259
1260
+ def get_module_outdir_args (self , path ):
1261
+ return ['-fmod=' + path ]
1262
+
1260
1263
class SunFortranCompiler (FortranCompiler ):
1261
1264
def __init__ (self , exelist , version , is_cross , exe_wrapper = None ):
1262
1265
super ().__init__ (exelist , version , is_cross , exe_wrapper = None )
@@ -1266,7 +1269,35 @@ def get_dependency_gen_args(self, outtarget, outfile):
1266
1269
return ['-fpp' ]
1267
1270
1268
1271
def get_always_args (self ):
1269
- return ['' ]
1272
+ return []
1273
+
1274
+ def get_std_warn_args (self ):
1275
+ return []
1276
+
1277
+ def get_module_outdir_args (self , path ):
1278
+ return ['-moddir=' + path ]
1279
+
1280
+ class IntelFortranCompiler (FortranCompiler ):
1281
+ std_warn_args = ['-warn' , 'all' ]
1282
+
1283
+ def __init__ (self , exelist , version , is_cross , exe_wrapper = None ):
1284
+ super ().__init__ (exelist , version , is_cross , exe_wrapper = None )
1285
+ self .id = 'intel'
1286
+
1287
+ def get_module_outdir_args (self , path ):
1288
+ return ['-module' , path ]
1289
+
1290
+ def get_always_args (self ):
1291
+ return []
1292
+
1293
+ def can_compile (self , src ):
1294
+ suffix = os .path .splitext (src )[1 ].lower ()
1295
+ if suffix == '.f' or suffix == '.f90' :
1296
+ return True
1297
+ return False
1298
+
1299
+ def get_std_warn_args (self ):
1300
+ return IntelFortranCompiler .std_warn_args
1270
1301
1271
1302
class VisualStudioLinker ():
1272
1303
always_args = ['/NOLOGO' ]
@@ -1580,6 +1611,9 @@ def detect_fortran_compiler(self, want_cross):
1580
1611
version = vmatch .group (0 )
1581
1612
return SunFortranCompiler ([compiler ], version , is_cross , exe_wrap )
1582
1613
1614
+ if 'ifort (IFORT)' in out :
1615
+ return IntelFortranCompiler ([compiler ], version , is_cross , exe_wrap )
1616
+
1583
1617
raise EnvironmentException ('Unknown compiler(s): "' + ', ' .join (compilers ) + '"' )
1584
1618
1585
1619
def get_scratch_dir (self ):
0 commit comments