提交 5d821578 编写于 作者: Z zhouwei25 提交者: Jiabin Yang

fix bug when build openblas with a computer that has installed openblas...

fix bug when build openblas with a computer that has installed openblas before,test=develop (#21160)
上级 330b173c
......@@ -14,7 +14,7 @@
# Find the CBlas and lapack libraries
#
# It will search MKLML, atlas, OpenBlas, reference-cblas in order.
# It will search MKLML, OpenBlas, reference-cblas, extern-openblas in order.
#
# If any cblas implementation found, the following variable will be set.
# CBLAS_PROVIDER # one of MKLML, OPENBLAS, REFERENCE
......
......@@ -75,7 +75,8 @@ copy(inference_lib_dist
SRCS ${DLPACK_INCLUDE_DIR}/dlpack
DSTS ${dst_dir})
if(WITH_MKLML)
if(${CBLAS_PROVIDER} STREQUAL MKLML)
set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/mklml")
if(WIN32)
copy(inference_lib_dist
......@@ -88,12 +89,12 @@ if(WITH_MKLML)
SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR}
DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir})
endif()
elseif (NOT CBLAS_FOUND OR WIN32)
elseif(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/openblas")
copy(inference_lib_dist
SRCS ${CBLAS_INSTALL_DIR}/lib ${CBLAS_INSTALL_DIR}/include
DSTS ${dst_dir} ${dst_dir})
endif ()
endif()
if(WITH_MKLDNN)
set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/mkldnn")
......
......@@ -116,8 +116,7 @@ endif()
include(cblas) # find first, then download, build, install openblas
if(${CBLAS_PROVIDER} STREQUAL MKLML)
list(APPEND third_party_deps extern_mklml)
endif()
if(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
elseif(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
list(APPEND third_party_deps extern_openblas)
endif()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册