提交 c5c96385 authored 作者: Frederic Bastien's avatar Frederic Bastien

If epd is installed, use its blas version by default.

上级 e2ff6a5e
...@@ -27,6 +27,8 @@ New Features ...@@ -27,6 +27,8 @@ New Features
* debugprint new param stop_on_name=[False, True]. If True, we don't print * debugprint new param stop_on_name=[False, True]. If True, we don't print
anything below an intermediate variable that has a name. Defaults to False. anything below an intermediate variable that has a name. Defaults to False.
* debugprint does not print anymore the "|" symbol in a column after the last input. * debugprint does not print anymore the "|" symbol in a column after the last input.
* If you use Enthought Python Distribution (EPD) now we use its blas
implementation by default.
============= =============
Release Notes Release Notes
......
...@@ -123,7 +123,7 @@ optimization is `local_gemm_to_gemv`. ...@@ -123,7 +123,7 @@ optimization is `local_gemm_to_gemv`.
""" """
import logging, copy, os import logging, copy, os, sys
import numpy import numpy
import numpy.distutils import numpy.distutils
...@@ -301,6 +301,11 @@ ger_destructive = Ger(destructive=True) ...@@ -301,6 +301,11 @@ ger_destructive = Ger(destructive=True)
def default_blas_ldflags(): def default_blas_ldflags():
try: try:
# If we are in a EPD installation, mkl is available
if "EPD" in sys.version:
return ' '.join(
['-L%s' % os.path.join(sys.prefix, "lib")] +
['-l%s' % l for l in numpy.distutils.__config__.blas_opt_info['libraries']])
#if numpy was linked with library that are not installed, we can't reuse them. #if numpy was linked with library that are not installed, we can't reuse them.
if all(not os.path.exists(dir) for dir in numpy.distutils.__config__.blas_opt_info['library_dirs']): if all(not os.path.exists(dir) for dir in numpy.distutils.__config__.blas_opt_info['library_dirs']):
return "-lblas" return "-lblas"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论