diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-09-22 11:36:37 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-09-22 11:36:37 -0600 |
commit | 81ed748a9ef98625b18edea83c4762a8959adce4 (patch) | |
tree | 1fd5efdcd7ebed96633d80125779d3bf6fd76bcc | |
parent | e7689a2600a28e75d187bbad06d730fb7e66bc5f (diff) | |
parent | 62e87ab001710bcafa54786a2b3d413f77398066 (diff) | |
download | numpy-81ed748a9ef98625b18edea83c4762a8959adce4.tar.gz |
Merge pull request #6328 from zerothi/enh-distutils-openblas
ENH: enabled extra_link_args in OpenBLAS segment
-rw-r--r-- | numpy/distutils/system_info.py | 15 | ||||
-rw-r--r-- | site.cfg.example | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 90c053298..be94c8704 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -1703,6 +1703,10 @@ class openblas_info(blas_info): if info is None: return + # Add extra info for OpenBLAS + extra_info = self.calc_extra_info() + dict_append(info, **extra_info) + if not self.check_embedded_lapack(info): return @@ -1729,13 +1733,19 @@ class openblas_lapack_info(openblas_info): }""" src = os.path.join(tmpdir, 'source.c') out = os.path.join(tmpdir, 'a.out') + # Add the additional "extra" arguments + try: + extra_args = info['extra_link_args'] + except: + extra_args = [] try: with open(src, 'wt') as f: f.write(s) obj = c.compile([src], output_dir=tmpdir) try: c.link_executable(obj, out, libraries=info['libraries'], - library_dirs=info['library_dirs']) + library_dirs=info['library_dirs'], + extra_postargs=extra_args) res = True except distutils.ccompiler.LinkError: res = False @@ -1752,7 +1762,8 @@ class openblas_lapack_info(openblas_info): obj = c.compile([src], output_dir=tmpdir) try: c.link_executable(obj, out, libraries=info['libraries'], - library_dirs=info['library_dirs']) + library_dirs=info['library_dirs'], + extra_postargs=extra_args) res = True except distutils.ccompiler.LinkError: res = False diff --git a/site.cfg.example b/site.cfg.example index 1324a74d3..64eedb7f9 100644 --- a/site.cfg.example +++ b/site.cfg.example @@ -68,7 +68,7 @@ # extra_compile_args = -g -ftree-vectorize # # extra_link_args -# Add additional arguments to when libraries/executables +# Add additional arguments when libraries/executables # are linked. # Simple variable with no parsing done. # Provide a single line with all complete flags. |