diff options
author | carlkl <cmkleffner@gmail.com> | 2015-02-20 01:44:47 +0100 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-02-27 08:41:57 -0700 |
commit | 08178994ee2d97ff8c48cb6e8f1140b3dae2bd69 (patch) | |
tree | 815ae5fc5e3594861b8932eff7d813822cf8b283 /numpy/distutils/system_info.py | |
parent | ae438c3707ccb451c6f0d8150388f9d75a9b5375 (diff) | |
download | numpy-08178994ee2d97ff8c48cb6e8f1140b3dae2bd69.tar.gz |
BLD: Improve mingw-w64 detection of check_embedded_lapack.
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r-- | numpy/distutils/system_info.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index d73aef59f..25e8a63df 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -1722,6 +1722,23 @@ class openblas_lapack_info(openblas_info): res = False finally: shutil.rmtree(tmpdir) + if sys.platform == 'win32' and not res: + c = distutils.ccompiler.new_compiler(compiler='mingw32') + tmpdir = tempfile.mkdtemp() + src = os.path.join(tmpdir, 'source.c') + out = os.path.join(tmpdir, 'a.out') + 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']) + res = True + except distutils.ccompiler.LinkError: + res = False + finally: + shutil.rmtree(tmpdir) return res |