From 60eed2d138f5fd08fc8fa016debbac097371a47d Mon Sep 17 00:00:00 2001 From: cookedm Date: Mon, 28 May 2007 17:49:55 +0000 Subject: Better temporary file handling by using one temporary directory for numpy.distutils, and removing that at exit. Replaces using tempfile.mktemp. --- numpy/distutils/fcompiler/intel.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'numpy/distutils/fcompiler/intel.py') diff --git a/numpy/distutils/fcompiler/intel.py b/numpy/distutils/fcompiler/intel.py index 4244c5505..52e968e09 100644 --- a/numpy/distutils/fcompiler/intel.py +++ b/numpy/distutils/fcompiler/intel.py @@ -24,8 +24,7 @@ class IntelFCompiler(FCompiler): possible_executables = ['ifort', 'ifc'] executables = { - 'version_cmd' : ["", "-FI -V -c %(fname)s.f -o %(fname)s.o" \ - % {'fname':dummy_fortran_file()}], + 'version_cmd' : None, 'compiler_f77' : [None,"-72","-w90","-w95"], 'compiler_f90' : [None], 'compiler_fix' : [None,"-FI"], @@ -38,6 +37,10 @@ class IntelFCompiler(FCompiler): module_dir_switch = '-module ' # Don't remove ending space! module_include_switch = '-I' + def get_version_cmd(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 @@ -91,8 +94,7 @@ class IntelItaniumFCompiler(IntelFCompiler): possible_executables = ['ifort', 'efort', 'efc'] executables = { - 'version_cmd' : ['', "-FI -V -c %(fname)s.f -o %(fname)s.o" \ - % {'fname':dummy_fortran_file()}], + 'version_cmd' : None, 'compiler_f77' : [None,"-FI","-w90","-w95"], 'compiler_fix' : [None,"-FI"], 'compiler_f90' : [None], @@ -110,8 +112,7 @@ class IntelEM64TFCompiler(IntelFCompiler): possible_executables = ['ifort', 'efort', 'efc'] executables = { - 'version_cmd' : ['', "-FI -V -c %(fname)s.f -o %(fname)s.o" \ - % {'fname':dummy_fortran_file()}], + 'version_cmd' : None, 'compiler_f77' : [None, "-FI", "-w90", "-w95"], 'compiler_fix' : [None, "-FI"], 'compiler_f90' : [None], @@ -138,8 +139,7 @@ class IntelVisualFCompiler(FCompiler): possible_executables = ['ifl'] executables = { - 'version_cmd' : ['', "-FI -V -c %(fname)s.f -o %(fname)s.o" \ - % {'fname':dummy_fortran_file()}], + 'version_cmd' : None, 'compiler_f77' : [None,"-FI","-w90","-w95"], 'compiler_fix' : [None,"-FI","-4L72","-w"], 'compiler_f90' : [None], @@ -154,6 +154,10 @@ class IntelVisualFCompiler(FCompiler): module_dir_switch = '/module:' #No space after /module: module_include_switch = '/I' + def get_version_cmd(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 @@ -191,8 +195,7 @@ class IntelItaniumVisualFCompiler(IntelVisualFCompiler): ar_exe = IntelVisualFCompiler.ar_exe executables = { - 'version_cmd' : ['', "-FI -V -c %(fname)s.f -o %(fname)s.o" \ - % {'fname':dummy_fortran_file()}], + 'version_cmd' : None, 'compiler_f77' : [None,"-FI","-w90","-w95"], 'compiler_fix' : [None,"-FI","-4L72","-w"], 'compiler_f90' : [None], -- cgit v1.2.1