(self)
| 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 |
nothing calls this directly
no test coverage detected