From 8af85fa5d37c4d4f750cce0e9bb71795e0c46872 Mon Sep 17 00:00:00 2001 From: zhangjun Date: Mon, 26 Apr 2021 11:56:30 +0800 Subject: [PATCH] fix compile error with WITH_MKLML=ON; fix wrong port in xpu example --- cmake/paddlepaddle.cmake | 6 ++++-- python/examples/xpu/ernie/ernie_client.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/paddlepaddle.cmake b/cmake/paddlepaddle.cmake index 1421f52c..aac2791b 100644 --- a/cmake/paddlepaddle.cmake +++ b/cmake/paddlepaddle.cmake @@ -136,8 +136,10 @@ LINK_DIRECTORIES(${PADDLE_INSTALL_DIR}/third_party/install/mklml/lib) SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${PADDLE_INSTALL_DIR}/third_party/install/mkldnn/lib") LINK_DIRECTORIES(${PADDLE_INSTALL_DIR}/third_party/install/mkldnn/lib) -ADD_LIBRARY(openblas STATIC IMPORTED GLOBAL) -SET_PROPERTY(TARGET openblas PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/third_party/install/openblas/lib/libopenblas.a) +if (NOT WITH_MKLML) + ADD_LIBRARY(openblas STATIC IMPORTED GLOBAL) + SET_PROPERTY(TARGET openblas PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/third_party/install/openblas/lib/libopenblas.a) +endif() ADD_LIBRARY(paddle_inference STATIC IMPORTED GLOBAL) SET_PROPERTY(TARGET paddle_inference PROPERTY IMPORTED_LOCATION ${PADDLE_INSTALL_DIR}/lib/libpaddle_inference.a) diff --git a/python/examples/xpu/ernie/ernie_client.py b/python/examples/xpu/ernie/ernie_client.py index d5f2d25d..b02c9d0a 100644 --- a/python/examples/xpu/ernie/ernie_client.py +++ b/python/examples/xpu/ernie/ernie_client.py @@ -23,7 +23,7 @@ args = benchmark_args() reader = ChineseErnieReader({"max_seq_len": 128}) fetch = ["save_infer_model/scale_0"] -endpoint_list = ['127.0.0.1:12000'] +endpoint_list = ['127.0.0.1:7704'] client = Client() client.load_client_config(args.model) client.connect(endpoint_list) -- GitLab