From 0f9f5fe61b4ce5e7d3ab3d698560c227fb0f81f5 Mon Sep 17 00:00:00 2001 From: huzhiqiang <912790387@qq.com> Date: Fri, 25 Oct 2019 20:27:12 +0800 Subject: [PATCH] X86 dynamic compile (#2218) build x86 dynamic library in ci_build.sh ./lite/tool/ci_build.sh build_test_server --- lite/api/CMakeLists.txt | 7 ++++++- lite/fluid/lod.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lite/api/CMakeLists.txt b/lite/api/CMakeLists.txt index fc6d2dd66b..9f46cdaefd 100644 --- a/lite/api/CMakeLists.txt +++ b/lite/api/CMakeLists.txt @@ -9,12 +9,17 @@ if (LITE_ON_TINY_PUBLISH) set(CMAKE_C_FLAGS_RELEASE "-Os -DNDEBUG") endif() set(light_lib_DEPS light_api paddle_api paddle_api_light optimizer) -if ((NOT LITE_ON_TINY_PUBLISH) AND (ARM_TARGET_OS STREQUAL "android")) +if ((NOT LITE_ON_TINY_PUBLISH) AND (LITE_WITH_X86 OR ARM_TARGET_OS STREQUAL "android")) #full api dynamic library add_library(paddle_full_api_shared SHARED "") target_sources(paddle_full_api_shared PUBLIC ${__lite_cc_files} paddle_api.cc light_api.cc cxx_api.cc cxx_api_impl.cc light_api_impl.cc) add_dependencies(paddle_full_api_shared op_list_h kernel_list_h framework_proto) target_link_libraries(paddle_full_api_shared framework_proto) + add_dependencies(lite_compile_deps paddle_full_api_shared) + if(LITE_WITH_X86) + add_dependencies(paddle_full_api_shared xxhash) + target_link_libraries(paddle_full_api_shared xxhash) + endif() #light api dynamic library lite_cc_library(paddle_light_api_shared MODULE diff --git a/lite/fluid/lod.h b/lite/fluid/lod.h index 68068ba1d0..36386f7eb9 100644 --- a/lite/fluid/lod.h +++ b/lite/fluid/lod.h @@ -21,7 +21,7 @@ namespace lite { namespace fluid { using LoD = std::vector>; -LoD ToAbsOffset(const LoD &in) { +static LoD ToAbsOffset(const LoD &in) { // the lowest level stores relative offsets if (in.empty() || in.size() == 1) return in; LoD result = in; -- GitLab