提交 c440043b 编写于 作者: C Chunwei

Merge branch 'chunwei/export-tools' into 'incubate/lite'

add tools to publish

See merge request inference/paddlelite!81
...@@ -235,7 +235,7 @@ if (WITH_TESTING) ...@@ -235,7 +235,7 @@ if (WITH_TESTING)
endif() endif()
# for publish # for publish
set(INFER_LITE_PUBLISH_ROOT "${CMAKE_BINARY_DIR}/inference_lite_lib" CACHE STRING "inference publish path") set(INFER_LITE_PUBLISH_ROOT "${CMAKE_BINARY_DIR}/inference_lite_lib.${ARM_TARGET_OS}.${ARM_TARGET_ARCH_ABI}")
message(STATUS "publish inference lib to ${INFER_LITE_PUBLISH_ROOT}") message(STATUS "publish inference lib to ${INFER_LITE_PUBLISH_ROOT}")
# The final target for publish lite lib # The final target for publish lite lib
...@@ -244,18 +244,25 @@ add_custom_target(publish_inference_lite) ...@@ -244,18 +244,25 @@ add_custom_target(publish_inference_lite)
#cc_library(inference_cxx_lib DEPS cxx_api_lite) #cc_library(inference_cxx_lib DEPS cxx_api_lite)
add_custom_target(publish_inference_cxx_lib ${TARGET} add_custom_target(publish_inference_cxx_lib ${TARGET}
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/cxx/lib" COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/cxx/lib"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/bin"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/cxx/include" COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/cxx/include"
COMMAND cp "${CMAKE_SOURCE_DIR}/paddle/fluid/lite/api/paddle_*.h" "${INFER_LITE_PUBLISH_ROOT}/cxx/include" COMMAND cp "${CMAKE_SOURCE_DIR}/paddle/fluid/lite/api/paddle_*.h" "${INFER_LITE_PUBLISH_ROOT}/cxx/include"
COMMAND cp "${CMAKE_BINARY_DIR}/libpaddle_api_full_bundled.a" "${INFER_LITE_PUBLISH_ROOT}/cxx/lib" COMMAND cp "${CMAKE_BINARY_DIR}/libpaddle_api_full_bundled.a" "${INFER_LITE_PUBLISH_ROOT}/cxx/lib"
COMMAND cp "${CMAKE_BINARY_DIR}/paddle/fluid/lite/api/model_optimize_tool" "${INFER_LITE_PUBLISH_ROOT}/bin"
COMMAND cp "${CMAKE_BINARY_DIR}/paddle/fluid/lite/gen_code/paddle_code_generator" "${INFER_LITE_PUBLISH_ROOT}/bin"
) )
add_dependencies(publish_inference_cxx_lib model_optimize_tool)
add_dependencies(publish_inference_cxx_lib paddle_code_generator)
add_dependencies(publish_inference_cxx_lib bundle_full_api) add_dependencies(publish_inference_cxx_lib bundle_full_api)
add_dependencies(publish_inference_lite publish_inference_cxx_lib) add_dependencies(publish_inference_lite publish_inference_cxx_lib)
if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
#cc_library(inference_mobile_lib DEPS light_api_lite) #cc_library(inference_mobile_lib DEPS light_api_lite)
add_custom_target(publish_inference_mobile_lib ${TARGET} add_custom_target(publish_inference_mobile_lib ${TARGET}
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/mobile/lib" COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/mobile/lib"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/mobile/bin"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/mobile/include" COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/mobile/include"
COMMAND cp "${CMAKE_SOURCE_DIR}/paddle/fluid/lite/api/paddle_*.h" "${INFER_LITE_PUBLISH_ROOT}/mobile/include" COMMAND cp "${CMAKE_SOURCE_DIR}/paddle/fluid/lite/api/paddle_*.h" "${INFER_LITE_PUBLISH_ROOT}/mobile/include"
COMMAND cp "${CMAKE_BINARY_DIR}/libpaddle_api_light_bundled.a" "${INFER_LITE_PUBLISH_ROOT}/mobile/lib" COMMAND cp "${CMAKE_BINARY_DIR}/libpaddle_api_light_bundled.a" "${INFER_LITE_PUBLISH_ROOT}/mobile/lib"
......
...@@ -255,8 +255,8 @@ function _test_model_optimize_tool { ...@@ -255,8 +255,8 @@ function _test_model_optimize_tool {
local adb="adb -s emulator-${port}" local adb="adb -s emulator-${port}"
make model_optimize_tool -j$NUM_CORES_FOR_COMPILE make model_optimize_tool -j$NUM_CORES_FOR_COMPILE
local test_path=$(find . -name model_optimize_tool) local test_path=$(find . -name model_optimize_tool | head -n1)
local model_path=$(find . -name lite_naive_model) local model_path=$(find . -name lite_naive_model | head -n1)
$adb push ${test_path} ${ADB_WORK_DIR} $adb push ${test_path} ${ADB_WORK_DIR}
$adb shell mkdir -p $remote_model_path $adb shell mkdir -p $remote_model_path
$adb push $model_path/* $remote_model_path $adb push $model_path/* $remote_model_path
...@@ -272,7 +272,7 @@ function _test_paddle_code_generator { ...@@ -272,7 +272,7 @@ function _test_paddle_code_generator {
local adb="adb -s emulator-${port}" local adb="adb -s emulator-${port}"
make paddle_code_generator -j$NUM_CORES_FOR_COMPILE make paddle_code_generator -j$NUM_CORES_FOR_COMPILE
local test_path=$(find . -name $test_name) local test_path=$(find . -name $test_name | head -n1)
$adb push $test_path $remote_test $adb push $test_path $remote_test
$adb shell $remote_test --optimized_model $remote_model --generated_code_file $ADB_WORK_DIR/gen_code.cc $adb shell $remote_test --optimized_model $remote_model --generated_code_file $ADB_WORK_DIR/gen_code.cc
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册