summaryrefslogtreecommitdiff
path: root/numpy/distutils/command/config.py
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2010-08-30 10:56:17 +0000
committerPearu Peterson <pearu.peterson@gmail.com>2010-08-30 10:56:17 +0000
commitc663655a87cfb7e818ed9d6bdb287ef3b63c3b29 (patch)
tree2199e0ea6c33dd9face6b13be4db39cb88c75519 /numpy/distutils/command/config.py
parent3743430ec92b16aadb7d0cac4515db07a15ac635 (diff)
downloadnumpy-c663655a87cfb7e818ed9d6bdb287ef3b63c3b29.tar.gz
Implemented detection of gfortran usage for ATLAS linkage. get_atlas_version returns now a tuple (version_str, info_dict). Nice thing about the patch is that specifying gnu95 compiler is not needed anymore for numpy (neither for scipy) build when using ATLAS containing gfortran compiled blas/lapack.
Diffstat (limited to 'numpy/distutils/command/config.py')
-rw-r--r--numpy/distutils/command/config.py29
1 files changed, 26 insertions, 3 deletions
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py
index c99c966ac..791e7db64 100644
--- a/numpy/distutils/command/config.py
+++ b/numpy/distutils/command/config.py
@@ -399,8 +399,15 @@ int main ()
self._check_compiler()
exitcode, output = 255, ''
try:
- src, obj, exe = self._link(body, headers, include_dirs,
- libraries, library_dirs, lang)
+ grabber = GrabStdout()
+ try:
+ src, obj, exe = self._link(body, headers, include_dirs,
+ libraries, library_dirs, lang)
+ grabber.restore()
+ except:
+ output = grabber.data
+ grabber.restore()
+ raise
exe = os.path.join('.', exe)
exitstatus, output = exec_command(exe, execute_in='.')
if hasattr(os, 'WEXITSTATUS'):
@@ -416,6 +423,22 @@ int main ()
log.info("success!")
except (CompileError, LinkError):
log.info("failure.")
-
self._clean()
return exitcode, output
+
+class GrabStdout(object):
+
+ def __init__(self):
+ self.sys_stdout = sys.stdout
+ self.data = ''
+ sys.stdout = self
+
+ def write (self, data):
+ self.sys_stdout.write(data)
+ self.data += data
+
+ def flush (self):
+ self.sys_stdout.flush()
+
+ def restore(self):
+ sys.stdout = self.sys_stdout