From 0fb65651b527edf3fe8790bb9e7704f6fe57ce36 Mon Sep 17 00:00:00 2001 From: Yan Chunwei Date: Thu, 30 May 2019 17:28:54 +0800 Subject: [PATCH] refine build.sh for server CI (#17717) --- paddle/fluid/lite/core/CMakeLists.txt | 4 ++-- paddle/fluid/lite/tools/build.sh | 22 +++++++++++++++++----- paddle/fluid/platform/CMakeLists.txt | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/lite/core/CMakeLists.txt b/paddle/fluid/lite/core/CMakeLists.txt index 4e55ba74f97..ddeae5834af 100644 --- a/paddle/fluid/lite/core/CMakeLists.txt +++ b/paddle/fluid/lite/core/CMakeLists.txt @@ -19,10 +19,10 @@ endif() proto_library(framework_proto_lite SRCS framework.proto) -cc_library(kernel_lite SRCS kernel.cc DEPS type_system target_wrapper_lite any_lite) +cc_library(kernel_lite SRCS kernel.cc DEPS type_system target_wrapper_lite any_lite op_params_lite) cc_library(variable_lite SRCS variable.cc) cc_library(op_registry_lite SRCS op_registry.cc DEPS framework_proto_lite) -cc_library(scope_lite SRCS scope.cc) +cc_library(scope_lite SRCS scope.cc DEPS ${tensor_lite}) cc_library(cpu_info_lite SRCS cpu_info.cc) cc_library(context_lite SRCS context.cc DEPS ${tensor_lite} any_lite cpu_info_lite) cc_library(op_lite SRCS op_lite.cc DEPS scope_lite op_registry_lite compatible_pb_lite target_wrapper_lite ${tensor_lite}) diff --git a/paddle/fluid/lite/tools/build.sh b/paddle/fluid/lite/tools/build.sh index 163cb630e73..bd0cb7ed375 100755 --- a/paddle/fluid/lite/tools/build.sh +++ b/paddle/fluid/lite/tools/build.sh @@ -1,17 +1,15 @@ #!/bin/bash -set -e +set -ex -TESTS_FILE="" +TESTS_FILE="./lite_tests.txt" readonly common_flags="-DWITH_LITE=ON -DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF -DWITH_PYTHON=OFF -DWITH_TESTING=ON -DLITE_WITH_ARM=OFF" function cmake_x86 { - cmake .. -DWITH_GPU=OFF -DLITE_WITH_X86=ON ${common_flags} - make test_cxx_api_lite -j8 + cmake .. -DWITH_GPU=OFF -DWITH_MKLDNN=OFF -DLITE_WITH_X86=ON ${common_flags} } function cmake_gpu { cmake .. " -DWITH_GPU=ON {common_flags} -DLITE_WITH_GPU=ON" - make test_cxx_api_lite -j8 } function cmake_arm { @@ -48,6 +46,16 @@ function test_mobile { local file=$1 } +# Build the code and run lite server tests. This is executed in the CI system. +function build_test_server { + mkdir -p ./build + cd ./build + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/paddle/build/third_party/install/mklml/lib" + cmake_x86 + build $TESTS_FILE + test_lite $TESTS_FILE +} + ############################# MAIN ################################# function print_usage { echo -e "\nUSAGE:" @@ -97,6 +105,10 @@ function main { test_lite $TESTS_FILE shift ;; + build_test_server) + build_test_server + shift + ;; *) # unknown option print_usage diff --git a/paddle/fluid/platform/CMakeLists.txt b/paddle/fluid/platform/CMakeLists.txt index 5de00db55ad..c4386689d3e 100644 --- a/paddle/fluid/platform/CMakeLists.txt +++ b/paddle/fluid/platform/CMakeLists.txt @@ -72,7 +72,7 @@ ENDIF() # avoiding cycle dependencies cc_library(device_context SRCS device_context.cc init.cc DEPS simple_threadpool malloc ${STREAM_CALLBACK_DEPS} place eigen3 stringpiece cpu_helper cpu_info framework_proto ${GPU_CTX_DEPS} ${MKLDNN_CTX_DEPS} - temp_allocator ${dgc_deps}) + temp_allocator ${dgc_deps} xxhash) if(WIN32) if(WITH_GPU AND NOT WITH_DSO) -- GitLab