diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index efeb62188c71b3dcc69027f2c5c20ec33a7ca340..e48292e86cbe9e506181a2ab0de190f3a721bd1a 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -72,9 +72,7 @@ if(WITH_TESTING) endif() # fastdeploy -if(NOT WITH_ASR) - include(fastdeploy) -endif() +include(fastdeploy) if(WITH_ASR) # openfst diff --git a/runtime/build.sh b/runtime/build.sh index 4a27766a9d635951756ab17710f229e42e3805f5..0ee628fd8e8530824cdcbc53d726ba6961726412 100755 --- a/runtime/build.sh +++ b/runtime/build.sh @@ -6,15 +6,24 @@ BUILD_DIR=${BUILD_ROOT}/x86_64 mkdir -p ${BUILD_DIR} +BUILD_TYPE=Release +#BUILD_TYPE=Debug +BUILD_SO=OFF +BUILD_ASR=OFF +BUILD_CLS=ON +BUILD_VAD=ON +FASTDEPLOY_INSTALL_DIR="" + # the build script had verified in the paddlepaddle docker image. # please follow the instruction below to install PaddlePaddle image. # https://www.paddlepaddle.org.cn/documentation/docs/zh/install/docker/linux-docker.html #cmake -B build -DBUILD_SHARED_LIBS=OFF -DWITH_ASR=OFF -DWITH_CLS=OFF -DWITH_VAD=ON -DFASTDEPLOY_INSTALL_DIR=/workspace/zhanghui/paddle/FastDeploy/build/Android/arm64-v8a-api-21/install cmake -B ${BUILD_DIR} \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=OFF \ - -DWITH_ASR=OFF \ - -DWITH_CLS=OFF \ - -DWITH_VAD=ON \ - -DFASTDEPLOY_INSTALL_DIR=/workspace/zhanghui/paddle/FastDeploy/build/Linux/x86_64/install + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + -DBUILD_SHARED_LIBS=${BUILD_SO} \ + -DWITH_ASR=${BUILD_ASR} \ + -DWITH_CLS=${BUILD_CLS} \ + -DWITH_VAD=${BUILD_VAD} \ + -DFASTDEPLOY_INSTALL_DIR=${FASTDEPLOY_INSTALL_DIR} + cmake --build ${BUILD_DIR} -j diff --git a/runtime/cmake/glog.cmake b/runtime/cmake/glog.cmake index 51d0ef0668930dd7ae713cef6f3bcaa09a92ac3c..898562c776dbb34b376a8ee5be5a43224cbe03ae 100644 --- a/runtime/cmake/glog.cmake +++ b/runtime/cmake/glog.cmake @@ -28,8 +28,8 @@ endif() if(ANDROID) add_library(extern_glog INTERFACE) - add_dependencies(extern_glog gflags) + add_dependencies(glog gflags) else() # UNIX add_library(extern_glog ALIAS glog) - add_dependencies(extern_glog gflags) + add_dependencies(glog gflags) endif() \ No newline at end of file diff --git a/runtime/engine/cls/nnet/CMakeLists.txt b/runtime/engine/cls/nnet/CMakeLists.txt index d331d31a62bf2d78b19e2731ad7132cb29344b2b..652e05b341ac66a3a1da266c87ca57173553255e 100644 --- a/runtime/engine/cls/nnet/CMakeLists.txt +++ b/runtime/engine/cls/nnet/CMakeLists.txt @@ -4,8 +4,8 @@ set(srcs ) add_library(cls ${srcs}) -target_link_libraries(cls INTERFACE -static-libstdc++;-Wl,-Bsymbolic ${FASTDEPLOY_LIBS} kaldi-matrix kaldi-base frontend utils ) +target_link_libraries(cls PRIVATE ${FASTDEPLOY_LIBS} kaldi-matrix kaldi-base frontend utils ) set(bin_name panns_nnet_main) add_executable(${bin_name} ${CMAKE_CURRENT_SOURCE_DIR}/${bin_name}.cc) -target_link_libraries(${bin_name} -static-libstdc++;-Wl,-Bsymbolic gflags glog) +target_link_libraries(${bin_name} gflags glog cls) diff --git a/runtime/engine/cls/nnet/panns_nnet.cc b/runtime/engine/cls/nnet/panns_nnet.cc index bd2265d427a0a4e6865901b75cefa100c3529b62..2edf71f2e517b6b19b9a50d7a4bfc257bcccfb85 100644 --- a/runtime/engine/cls/nnet/panns_nnet.cc +++ b/runtime/engine/cls/nnet/panns_nnet.cc @@ -67,7 +67,7 @@ int ClsNnet::Init(const ClsNnetConf& conf) { runtime_option.UsePaddleInferBackend(); #endif runtime_option.SetCpuThreadNum(conf.num_cpu_thread_); - runtime_option.DeletePaddleBackendPass("simplify_with_basic_ops_pass"); + // runtime_option.DeletePaddleBackendPass("simplify_with_basic_ops_pass"); runtime_ = std::unique_ptr(new fastdeploy::Runtime()); if (!runtime_->Init(runtime_option)) { std::cerr << "--- Init FastDeploy Runitme Failed! " diff --git a/runtime/engine/cls/nnet/panns_nnet_main.cc b/runtime/engine/cls/nnet/panns_nnet_main.cc index 14f91fc719baec44447d297fd82addf83685f605..4407208231187f6a3a447c78d54440018f5bbb8e 100644 --- a/runtime/engine/cls/nnet/panns_nnet_main.cc +++ b/runtime/engine/cls/nnet/panns_nnet_main.cc @@ -16,6 +16,7 @@ #include #include "base/flags.h" +#include "base/log.h" #include "cls/nnet/panns_interface.h" DEFINE_string(conf_path, "", "config path"); diff --git a/runtime/engine/vad/nnet/CMakeLists.txt b/runtime/engine/vad/nnet/CMakeLists.txt index 22c9f760252e40f2408393d9b5168b976daece28..8fea3b19c61520f9100a79029c5c163b21d3a23f 100644 --- a/runtime/engine/vad/nnet/CMakeLists.txt +++ b/runtime/engine/vad/nnet/CMakeLists.txt @@ -13,4 +13,4 @@ target_link_libraries(${bin_name} pps_vad) file(RELATIVE_PATH DEST_DIR ${ENGINE_ROOT} ${CMAKE_CURRENT_SOURCE_DIR}) install(TARGETS pps_vad DESTINATION lib) -install(TARGETS extern_glog DESTINATION lib) \ No newline at end of file +install(TARGETS glog DESTINATION lib) \ No newline at end of file