Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd78546

Browse files
committed
BUG: fix CBLAS/LAPACK detection logic.
1 parent 7ec6cf4 commit fd78546

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

bscript

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,42 @@ def check_blas_lapack(conf):
4545
conf.check_cc(lib=mkl_libs, msg="Checking for MKL (CBLAS)",
4646
uselib_store="CBLAS")
4747
conf.env.HAS_CBLAS = True
48+
except waflib.Errors.ConfigurationError:
49+
conf.env.HAS_LAPACK = False
4850

51+
try:
4952
conf.check_cc(lib=mkl_libs, msg="Checking for MKL (LAPACK)",
5053
uselib_store="LAPACK")
5154
conf.env.HAS_LAPACK = True
5255
except waflib.Errors.ConfigurationError:
53-
pass
56+
conf.env.HAS_LAPACK = False
57+
5458

5559
elif sys.platform == "darwin":
5660
try:
57-
conf.check(framework="Accelerate", msg="Checking for framework Accelerate", uselib_store="CBLAS")
61+
conf.check(framework="Accelerate", msg="Checking for framework Accelerate (CBLAS)", uselib_store="CBLAS")
5862
conf.env.HAS_CBLAS = True
63+
except waflib.Errors.ConfigurationError:
64+
conf.env.HAS_CBLAS = False
5965

60-
conf.check(framework="Accelerate", msg="Checking for framework Accelerate", uselib_store="LAPACK")
66+
try:
67+
conf.check(framework="Accelerate", msg="Checking for framework Accelerate (LAPACK)", uselib_store="LAPACK")
6168
conf.env.HAS_LAPACK = True
6269
except waflib.Errors.ConfigurationError:
63-
pass
70+
conf.env.HAS_LAPACK = False
6471
else:
6572
try:
6673
conf.check_cc(lib=["cblas", "atlas"], uselib_store="CBLAS")
6774
conf.env.HAS_CBLAS = True
75+
except waflib.Errors.ConfigurationError:
76+
conf.env.HAS_CBLAS = False
6877

78+
try:
6979
conf.check_cc(lib=["lapack", "f77blas", "cblas", "atlas"],
7080
uselib_store="LAPACK")
7181
conf.env.HAS_LAPACK = True
7282
except waflib.Errors.ConfigurationError:
73-
pass
83+
conf.env.HAS_LAPACK = False
7484

7585
# You can manually set up blas/lapack as follows:
7686
#conf.env.HAS_CBLAS = True

0 commit comments

Comments
 (0)