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

Method calc_info

numpy/distutils/system_info.py:2206–2234  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2204 notfounderror = BlasNotFoundError
2205
2206 def calc_info(self):
2207 lib_dirs = self.get_lib_dirs()
2208 opt = self.get_option_single('blas_libs', 'libraries')
2209 blas_libs = self.get_libs(opt, self._lib_names)
2210 info = self.check_libs(lib_dirs, blas_libs, [])
2211 if info is None:
2212 return
2213 else:
2214 info['include_dirs'] = self.get_include_dirs()
2215 if platform.system() == 'Windows':
2216 # The check for windows is needed because get_cblas_libs uses the
2217 # same compiler that was used to compile Python and msvc is
2218 # often not installed when mingw is being used. This rough
2219 # treatment is not desirable, but windows is tricky.
2220 info['language'] = 'f77' # XXX: is it generally true?
2221 # If cblas is given as an option, use those
2222 cblas_info_obj = cblas_info()
2223 cblas_opt = cblas_info_obj.get_option_single('cblas_libs', 'libraries')
2224 cblas_libs = cblas_info_obj.get_libs(cblas_opt, None)
2225 if cblas_libs:
2226 info['libraries'] = cblas_libs + blas_libs
2227 info['define_macros'] = [('HAVE_CBLAS', None)]
2228 else:
2229 lib = self.get_cblas_libs(info)
2230 if lib is not None:
2231 info['language'] = 'c'
2232 info['libraries'] = lib
2233 info['define_macros'] = [('HAVE_CBLAS', None)]
2234 self.set_info(**info)
2235
2236 def get_cblas_libs(self, info):
2237 """ Check whether we can link with CBLAS interface

Callers

nothing calls this directly

Calls 8

get_cblas_libsMethod · 0.95
cblas_infoClass · 0.85
get_lib_dirsMethod · 0.80
get_option_singleMethod · 0.80
get_libsMethod · 0.80
check_libsMethod · 0.80
get_include_dirsMethod · 0.80
set_infoMethod · 0.80

Tested by

no test coverage detected