Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f45eaa

Browse files
njsmithcharris
authored andcommitted
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.
1 parent ebffab2 commit 3f45eaa

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

numpy/distutils/system_info.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,16 @@ def _check_libs(self, lib_dirs, libs, opt_libs, exts):
665665
found_libs, found_dirs = [], []
666666
for dir_ in lib_dirs:
667667
found_libs1 = self._lib_list(dir_, libs, exts)
668-
if found_libs1:
669-
found_libs.extend(found_libs1)
670-
found_dirs.append(dir_)
668+
# It's possible that we'll find the same library in multiple
669+
# directories. It's also possible that we'll find some
670+
# libraries on in directory, and some in another. So the
671+
# obvious thing would be to use a set instead of a list, but I
672+
# don't know if preserving order matters (does it?).
673+
for found_lib in found_libs1:
674+
if found_lib not in found_libs:
675+
found_libs.append(found_lib)
676+
if dir_ not in found_dirs:
677+
found_dirs.append(dir_)
671678
else:
672679
found_libs = self._lib_list(lib_dirs, libs, exts)
673680
found_dirs = [lib_dirs]

0 commit comments

Comments
 (0)