diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 90c05329861f..be94c87047e3 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -1703,6 +1703,10 @@ def calc_info(self): 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 @@ def check_embedded_lapack(self, 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 @@ def check_embedded_lapack(self, 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 1324a74d3715..64eedb7f9cd2 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.