diff options
author | cookedm <cookedm@localhost> | 2006-07-06 16:40:38 +0000 |
---|---|---|
committer | cookedm <cookedm@localhost> | 2006-07-06 16:40:38 +0000 |
commit | fb83db13965023c3f82eef0cf1b8e8b18789f5b9 (patch) | |
tree | c7614647f04c7a8aaabe716ffabb413312acf55b /numpy/distutils/system_info.py | |
parent | 18db7b375a7969704686a5cdcbff7185dd5813fc (diff) | |
download | numpy-fb83db13965023c3f82eef0cf1b8e8b18789f5b9.tar.gz |
cache the ATLAS version computation
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r-- | numpy/distutils/system_info.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 41da8076e..08ada4783 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -1078,12 +1078,16 @@ int main(void) { } ''' +_cached_atlas_version = {} def get_atlas_version(**config): + libraries = config.get('libraries', []) + library_dirs = config.get('library_dirs', []) + key = (tuple(libraries), tuple(library_dirs)) + if _cached_atlas_version.has_key(key): + return _cached_atlas_version[key] c = cmd_config(Distribution()) s, o = c.get_output(atlas_version_c_text, - libraries=config.get('libraries', []), - library_dirs=config.get('library_dirs', []), - ) + libraries=libraries, library_dirs=library_dirs) atlas_version = None if not s: @@ -1096,6 +1100,7 @@ def get_atlas_version(**config): else: log.info('Status: %d', s) log.info('Output: %s', o) + _cached_atlas_version[key] = atlas_version return atlas_version from distutils.util import get_platform |