MCPcopy Create free account
hub / github.com/numpy/numpy / check_embedded_lapack

Method check_embedded_lapack

numpy/distutils/system_info.py:2527–2555  ·  view source on GitHub ↗

libflame does not necessarily have a wrapper for fortran LAPACK, we need to check

(self, info)

Source from the content-addressed store, hash-verified

2525 notfounderror = FlameNotFoundError
2526
2527 def check_embedded_lapack(self, info):
2528 """ libflame does not necessarily have a wrapper for fortran LAPACK, we need to check """
2529 c = customized_ccompiler()
2530
2531 tmpdir = tempfile.mkdtemp()
2532 s = textwrap.dedent("""\
2533 void zungqr_();
2534 int main(int argc, const char *argv[])
2535 {
2536 zungqr_();
2537 return 0;
2538 }""")
2539 src = os.path.join(tmpdir, 'source.c')
2540 out = os.path.join(tmpdir, 'a.out')
2541 # Add the additional "extra" arguments
2542 extra_args = info.get('extra_link_args', [])
2543 try:
2544 with open(src, 'w') as f:
2545 f.write(s)
2546 obj = c.compile([src], output_dir=tmpdir)
2547 try:
2548 c.link_executable(obj, out, libraries=info['libraries'],
2549 library_dirs=info['library_dirs'],
2550 extra_postargs=extra_args)
2551 return True
2552 except distutils.ccompiler.LinkError:
2553 return False
2554 finally:
2555 shutil.rmtree(tmpdir)
2556
2557 def calc_info(self):
2558 lib_dirs = self.get_lib_dirs()

Callers 1

calc_infoMethod · 0.95

Calls 6

openFunction · 0.85
customized_ccompilerFunction · 0.70
joinMethod · 0.45
getMethod · 0.45
writeMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected