diff options
| author | Ondřej Čertík <ondrej.certik@gmail.com> | 2012-12-13 16:32:06 -0800 |
|---|---|---|
| committer | Ondřej Čertík <ondrej.certik@gmail.com> | 2012-12-13 16:32:06 -0800 |
| commit | 5db0088b97982a5bf9b63ff4fe577a9e570525a4 (patch) | |
| tree | 704f5c6d4b569cea860dab7f0c2af89619cf402d | |
| parent | cdeb48be603323b2db9e6cc3eb6441f75ec622f6 (diff) | |
| parent | aa8c948f8375854398b79aa3cfc027f18bf5344f (diff) | |
| download | numpy-5db0088b97982a5bf9b63ff4fe577a9e570525a4.tar.gz | |
Merge pull request #2792 from certik/multi_arch
Add multiarch paths to the distutils' ones
| -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')) |
