diff options
author | Ondřej Čertík <ondrej.certik@gmail.com> | 2012-12-06 14:06:58 -0800 |
---|---|---|
committer | Ondřej Čertík <ondrej.certik@gmail.com> | 2012-12-13 16:27:21 -0800 |
commit | aa8c948f8375854398b79aa3cfc027f18bf5344f (patch) | |
tree | 704f5c6d4b569cea860dab7f0c2af89619cf402d /numpy/distutils/system_info.py | |
parent | cdeb48be603323b2db9e6cc3eb6441f75ec622f6 (diff) | |
download | numpy-aa8c948f8375854398b79aa3cfc027f18bf5344f.tar.gz |
FIX: Add multiarch paths to the distutils' ones
Thanks to Julian Taylor and Sandro Tosi from Debian for the original patch.
Ralf has posted a link to the patch here:
http://article.gmane.org/gmane.comp.python.numeric.general/51454
I have modified the patch to remove the bare except command only catch the
OSError. Also I suppress the stderr.
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r-- | numpy/distutils/system_info.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index e0c480d6b..4dd3d4b6b 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -214,6 +214,19 @@ else: default_x11_include_dirs.extend(['/usr/lib/X11/include', '/usr/include/X11']) + import subprocess as sp + try: + p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE, + stderr=open(os.devnull, 'w')) + except OSError: + pass # gcc is not installed + else: + triplet = str(p.communicate()[0].decode().strip()) + if p.returncode == 0: + # gcc supports the "-print-multiarch" option + default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)] + default_lib_dirs += [os.path.join("/usr/lib/", triplet)] + if os.path.join(sys.prefix, 'lib') not in default_lib_dirs: default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib')) default_include_dirs.append(os.path.join(sys.prefix, 'include')) |