20
20
blas_info
21
21
lapack_info
22
22
openblas_info
23
+ blis_info
23
24
blas_opt_info # usage recommended
24
25
lapack_opt_info # usage recommended
25
26
fftw_info,dfftw_info,sfftw_info
@@ -323,6 +324,7 @@ def get_info(name, notfound_action=0):
323
324
'openblas' : openblas_info , # use blas_opt instead
324
325
# openblas with embedded lapack
325
326
'openblas_lapack' : openblas_lapack_info , # use blas_opt instead
327
+ 'blis' : blis_info , # use blas_opt instead
326
328
'lapack_mkl' : lapack_mkl_info , # use lapack_opt instead
327
329
'blas_mkl' : blas_mkl_info , # use blas_opt instead
328
330
'x11' : x11_info ,
@@ -482,6 +484,7 @@ def __init__(self,
482
484
self .files .extend (get_standard_file ('.numpy-site.cfg' ))
483
485
self .files .extend (get_standard_file ('site.cfg' ))
484
486
self .parse_config_files ()
487
+
485
488
if self .section is not None :
486
489
self .search_static_first = self .cp .getboolean (
487
490
self .section , 'search_static_first' )
@@ -497,7 +500,7 @@ def calc_libraries_info(self):
497
500
libs = self .get_libraries ()
498
501
dirs = self .get_lib_dirs ()
499
502
# The extensions use runtime_library_dirs
500
- r_dirs = self .get_runtime_lib_dirs ()
503
+ r_dirs = self .get_runtime_lib_dirs ()
501
504
# Intrinsic distutils use rpath, we simply append both entries
502
505
# as though they were one entry
503
506
r_dirs .extend (self .get_runtime_lib_dirs (key = 'rpath' ))
@@ -508,17 +511,20 @@ def calc_libraries_info(self):
508
511
dict_append (info , ** i )
509
512
else :
510
513
log .info ('Library %s was not found. Ignoring' % (lib ))
511
- i = self .check_libs (r_dirs , [lib ])
512
- if i is not None :
513
- # Swap library keywords found to runtime_library_dirs
514
- # the libraries are insisting on the user having defined
515
- # them using the library_dirs, and not necessarily by
516
- # runtime_library_dirs
517
- del i ['libraries' ]
518
- i ['runtime_library_dirs' ] = i .pop ('library_dirs' )
519
- dict_append (info , ** i )
520
- else :
521
- log .info ('Runtime library %s was not found. Ignoring' % (lib ))
514
+
515
+ if r_dirs :
516
+ i = self .check_libs (r_dirs , [lib ])
517
+ if i is not None :
518
+ # Swap library keywords found to runtime_library_dirs
519
+ # the libraries are insisting on the user having defined
520
+ # them using the library_dirs, and not necessarily by
521
+ # runtime_library_dirs
522
+ del i ['libraries' ]
523
+ i ['runtime_library_dirs' ] = i .pop ('library_dirs' )
524
+ dict_append (info , ** i )
525
+ else :
526
+ log .info ('Runtime library %s was not found. Ignoring' % (lib ))
527
+
522
528
return info
523
529
524
530
def set_info (self , ** info ):
@@ -643,7 +649,10 @@ def get_lib_dirs(self, key='library_dirs'):
643
649
return self .get_paths (self .section , key )
644
650
645
651
def get_runtime_lib_dirs (self , key = 'runtime_library_dirs' ):
646
- return self .get_paths (self .section , key )
652
+ path = self .get_paths (self .section , key )
653
+ if path == ['' ]:
654
+ path = []
655
+ return path
647
656
648
657
def get_include_dirs (self , key = 'include_dirs' ):
649
658
return self .get_paths (self .section , key )
@@ -711,6 +720,7 @@ def check_libs2(self, lib_dirs, libs, opt_libs=[]):
711
720
if not info :
712
721
log .info (' libraries %s not found in %s' , ',' .join (libs ),
713
722
lib_dirs )
723
+
714
724
return info
715
725
716
726
def _lib_list (self , lib_dir , libs , exts ):
@@ -736,6 +746,7 @@ def _lib_list(self, lib_dir, libs, exts):
736
746
l += '.dll'
737
747
liblist .append (l )
738
748
break
749
+
739
750
return liblist
740
751
741
752
def _check_libs (self , lib_dirs , libs , opt_libs , exts ):
@@ -1584,6 +1595,11 @@ def calc_info(self):
1584
1595
self .set_info (** blas_mkl_info )
1585
1596
return
1586
1597
1598
+ blis_info = get_info ('blis' )
1599
+ if blis_info :
1600
+ self .set_info (** blis_info )
1601
+ return
1602
+
1587
1603
openblas_info = get_info ('openblas' )
1588
1604
if openblas_info :
1589
1605
self .set_info (** openblas_info )
@@ -1798,6 +1814,31 @@ def check_embedded_lapack(self, info):
1798
1814
return res
1799
1815
1800
1816
1817
+ class blis_info (blas_info ):
1818
+ section = 'blis'
1819
+ dir_env_var = 'BLIS'
1820
+ _lib_names = ['blis' ]
1821
+ notfounderror = BlasNotFoundError
1822
+
1823
+ def calc_info (self ):
1824
+ lib_dirs = self .get_lib_dirs ()
1825
+ blis_libs = self .get_libs ('libraries' , self ._lib_names )
1826
+ if blis_libs == self ._lib_names :
1827
+ blis_libs = self .get_libs ('blis_libs' , self ._lib_names )
1828
+
1829
+ info = self .check_libs2 (lib_dirs , blis_libs , [])
1830
+ if info is None :
1831
+ return
1832
+
1833
+ # Add include dirs
1834
+ incl_dirs = self .get_include_dirs ()
1835
+ dict_append (info ,
1836
+ language = 'c' ,
1837
+ define_macros = [('HAVE_CBLAS' , None )],
1838
+ include_dirs = incl_dirs )
1839
+ self .set_info (** info )
1840
+
1841
+
1801
1842
class blas_src_info (system_info ):
1802
1843
section = 'blas_src'
1803
1844
dir_env_var = 'BLAS_SRC'
@@ -2345,7 +2386,7 @@ def dict_append(d, **kws):
2345
2386
languages .append (v )
2346
2387
continue
2347
2388
if k in d :
2348
- if k in ['library_dirs' , 'include_dirs' ,
2389
+ if k in ['library_dirs' , 'include_dirs' ,
2349
2390
'extra_compile_args' , 'extra_link_args' ,
2350
2391
'runtime_library_dirs' , 'define_macros' ]:
2351
2392
[d [k ].append (vv ) for vv in v if vv not in d [k ]]
0 commit comments