提交 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 @@ ...@@ -14,7 +14,7 @@
# Find the CBlas and lapack libraries # 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. # If any cblas implementation found, the following variable will be set.
# CBLAS_PROVIDER # one of MKLML, OPENBLAS, REFERENCE # CBLAS_PROVIDER # one of MKLML, OPENBLAS, REFERENCE
......
...@@ -75,7 +75,8 @@ copy(inference_lib_dist ...@@ -75,7 +75,8 @@ copy(inference_lib_dist
SRCS ${DLPACK_INCLUDE_DIR}/dlpack SRCS ${DLPACK_INCLUDE_DIR}/dlpack
DSTS ${dst_dir}) DSTS ${dst_dir})
if(WITH_MKLML)
if(${CBLAS_PROVIDER} STREQUAL MKLML)
set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/mklml") set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/mklml")
if(WIN32) if(WIN32)
copy(inference_lib_dist copy(inference_lib_dist
...@@ -88,12 +89,12 @@ if(WITH_MKLML) ...@@ -88,12 +89,12 @@ if(WITH_MKLML)
SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR} SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR}
DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir}) DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir})
endif() endif()
elseif (NOT CBLAS_FOUND OR WIN32) elseif(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/openblas") set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/openblas")
copy(inference_lib_dist copy(inference_lib_dist
SRCS ${CBLAS_INSTALL_DIR}/lib ${CBLAS_INSTALL_DIR}/include SRCS ${CBLAS_INSTALL_DIR}/lib ${CBLAS_INSTALL_DIR}/include
DSTS ${dst_dir} ${dst_dir}) DSTS ${dst_dir} ${dst_dir})
endif () endif()
if(WITH_MKLDNN) if(WITH_MKLDNN)
set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/mkldnn") set(dst_dir "${FLUID_INFERENCE_INSTALL_DIR}/third_party/install/mkldnn")
......
...@@ -116,8 +116,7 @@ endif() ...@@ -116,8 +116,7 @@ endif()
include(cblas) # find first, then download, build, install openblas include(cblas) # find first, then download, build, install openblas
if(${CBLAS_PROVIDER} STREQUAL MKLML) if(${CBLAS_PROVIDER} STREQUAL MKLML)
list(APPEND third_party_deps extern_mklml) list(APPEND third_party_deps extern_mklml)
endif() elseif(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
if(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS)
list(APPEND third_party_deps extern_openblas) list(APPEND third_party_deps extern_openblas)
endif() endif()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册