summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/intel.py
diff options
context:
space:
mode:
authorcookedm <cookedm@localhost>2007-06-15 21:24:46 +0000
committercookedm <cookedm@localhost>2007-06-15 21:24:46 +0000
commit635a9fbf1cc87531888eaf50d09bb559e4ad2dfa (patch)
tree1001c24b4b5ab6aec138f37bd6e6bad5080e8ad8 /numpy/distutils/fcompiler/intel.py
parent46f195b0637b929643906c8ba7b1392849abe9ac (diff)
downloadnumpy-635a9fbf1cc87531888eaf50d09bb559e4ad2dfa.tar.gz
Better version handling in fcompiler
* Remove FCompiler.get_version_cmd, FCompiler.get_flags_version, FCompiler.get_linker_so_cmd, and FCompiler.get_linker_exe_cmd; subclasses should do this in FCompiler.update_executables() * FCompiler attributes .compiler_f77, .version_cmd, etc., are now properties that read from the .executables dictionary. * Update intel.py and absoft.py for above * Add extra asserts for defensive programming. Most of our problems here seem to come from bad values being generated, and the error not being caught until later. * must call FCompiler.customize() before FCompiler.get_version(); command/build_ext.py and command/config.py updated * verify that commands make sense earlier -- must be None or lists of strings Also, * add IA-32 as another pattern to search for in 32-bit Intel compiler version. * minor formatting * add debugging helpers to environment.py:EnvironmentConfig class
Diffstat (limited to 'numpy/distutils/fcompiler/intel.py')
-rw-r--r--numpy/distutils/fcompiler/intel.py44
1 files changed, 21 insertions, 23 deletions
diff --git a/numpy/distutils/fcompiler/intel.py b/numpy/distutils/fcompiler/intel.py
index 028e2cd73..f03a8b014 100644
--- a/numpy/distutils/fcompiler/intel.py
+++ b/numpy/distutils/fcompiler/intel.py
@@ -13,22 +13,28 @@ compilers = ['IntelFCompiler', 'IntelVisualFCompiler',
def intel_version_match(type):
# Match against the important stuff in the version string
- return simple_version_match(start=r'Intel.*?Fortran.*?%s.*?Version' % (type,))
+ return simple_version_match(start=r'Intel.*?Fortran.*?(?:%s).*?Version' % (type,))
-class IntelFCompiler(FCompiler):
+class BaseIntelFCompiler(FCompiler):
+ def update_executables(self):
+ f = dummy_fortran_file()
+ self.executables['version_cmd'] = ['<F77>', '-FI', '-V', '-c',
+ f + '.f', '-o', f + '.o']
+
+class IntelFCompiler(BaseIntelFCompiler):
compiler_type = 'intel'
description = 'Intel Fortran Compiler for 32-bit apps'
- version_match = intel_version_match('32-bit')
+ version_match = intel_version_match('32-bit|IA-32')
possible_executables = ['ifort', 'ifc']
executables = {
- 'version_cmd' : ['<F77>', None],
- 'compiler_f77' : [None,"-72","-w90","-w95"],
+ 'version_cmd' : None, # set by update_executables
+ 'compiler_f77' : [None, "-72", "-w90", "-w95"],
'compiler_f90' : [None],
- 'compiler_fix' : [None,"-FI"],
- 'linker_so' : ["<F90>","-shared"],
+ 'compiler_fix' : [None, "-FI"],
+ 'linker_so' : ["<F90>", "-shared"],
'archiver' : ["ar", "-cr"],
'ranlib' : ["ranlib"]
}
@@ -37,10 +43,6 @@ class IntelFCompiler(FCompiler):
module_dir_switch = '-module ' # Don't remove ending space!
module_include_switch = '-I'
- def get_flags_version(self):
- f = dummy_fortran_file()
- return ['-FI', '-V', '-c', f + '.f', '-o', f + '.o']
-
def get_flags(self):
opt = self.pic_flags + ["-cm"]
return opt
@@ -112,9 +114,9 @@ class IntelItaniumFCompiler(IntelFCompiler):
possible_executables = ['ifort', 'efort', 'efc']
executables = {
- 'version_cmd' : ['<F77>', None],
- 'compiler_f77' : [None,"-FI","-w90","-w95"],
- 'compiler_fix' : [None,"-FI"],
+ 'version_cmd' : None,
+ 'compiler_f77' : [None, "-FI", "-w90", "-w95"],
+ 'compiler_fix' : [None, "-FI"],
'compiler_f90' : [None],
'linker_so' : ['<F90>', "-shared"],
'archiver' : ["ar", "-cr"],
@@ -130,7 +132,7 @@ class IntelEM64TFCompiler(IntelFCompiler):
possible_executables = ['ifort', 'efort', 'efc']
executables = {
- 'version_cmd' : ['<F77>', None],
+ 'version_cmd' : None,
'compiler_f77' : [None, "-FI", "-w90", "-w95"],
'compiler_fix' : [None, "-FI"],
'compiler_f90' : [None],
@@ -148,16 +150,16 @@ class IntelEM64TFCompiler(IntelFCompiler):
# Is there no difference in the version string between the above compilers
# and the Visual compilers?
-class IntelVisualFCompiler(FCompiler):
+class IntelVisualFCompiler(BaseIntelFCompiler):
compiler_type = 'intelv'
description = 'Intel Visual Fortran Compiler for 32-bit apps'
- version_match = intel_version_match('32-bit')
+ version_match = intel_version_match('32-bit|IA-32')
ar_exe = 'lib.exe'
possible_executables = ['ifl']
executables = {
- 'version_cmd' : ['<F77>', None],
+ 'version_cmd' : None,
'compiler_f77' : [None,"-FI","-w90","-w95"],
'compiler_fix' : [None,"-FI","-4L72","-w"],
'compiler_f90' : [None],
@@ -172,10 +174,6 @@ class IntelVisualFCompiler(FCompiler):
module_dir_switch = '/module:' #No space after /module:
module_include_switch = '/I'
- def get_flags_version(self):
- f = dummy_fortran_file()
- return ['-FI', '-V', '-c', f + '.f', '-o', f + '.o']
-
def get_flags(self):
opt = ['/nologo','/MD','/nbs','/Qlowercase','/us']
return opt
@@ -213,7 +211,7 @@ class IntelItaniumVisualFCompiler(IntelVisualFCompiler):
ar_exe = IntelVisualFCompiler.ar_exe
executables = {
- 'version_cmd' : ['<F77>', None],
+ 'version_cmd' : None,
'compiler_f77' : [None,"-FI","-w90","-w95"],
'compiler_fix' : [None,"-FI","-4L72","-w"],
'compiler_f90' : [None],