From 3f45eaa310b0ead7270d56697018173dc4b7daad Mon Sep 17 00:00:00 2001 From: "Nathaniel J. Smith" Date: Wed, 16 May 2012 18:45:20 +0100 Subject: Fix numpy.distutils to find atlas BLAS on Ubuntu As per discussion here: http://mail.scipy.org/pipermail/numpy-discussion/2012-May/062363.html numpy.distutils was failing to find BLAS on my Ubuntu 11.04 system. The problem is that _check_libs looks for libraries in several directories, and it turns out that the "atlas" library was found in both /usr/lib64/atlas-base *and* in /usr/lib64, which confused _check_libs into thinking that it couldn't be found at all. With this fix, scipy now builds against numpy master for me. --- numpy/distutils/system_info.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'numpy/distutils') diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 5ad668ef3..9c3cee3cb 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -665,9 +665,16 @@ class system_info: found_libs, found_dirs = [], [] for dir_ in lib_dirs: found_libs1 = self._lib_list(dir_, libs, exts) - if found_libs1: - found_libs.extend(found_libs1) - found_dirs.append(dir_) + # It's possible that we'll find the same library in multiple + # directories. It's also possible that we'll find some + # libraries on in directory, and some in another. So the + # obvious thing would be to use a set instead of a list, but I + # don't know if preserving order matters (does it?). + for found_lib in found_libs1: + if found_lib not in found_libs: + found_libs.append(found_lib) + if dir_ not in found_dirs: + found_dirs.append(dir_) else: found_libs = self._lib_list(lib_dirs, libs, exts) found_dirs = [lib_dirs] -- cgit v1.2.1