fix vad and cls cmake

pull/3050/head
MarsMeng 3 years ago
parent f0ef6f1caf
commit cdeaee5e63

@ -72,9 +72,7 @@ if(WITH_TESTING)
endif() endif()
# fastdeploy # fastdeploy
if(NOT WITH_ASR) include(fastdeploy)
include(fastdeploy)
endif()
if(WITH_ASR) if(WITH_ASR)
# openfst # openfst

@ -4,17 +4,21 @@ set -xe
BUILD_ROOT=build/Linux BUILD_ROOT=build/Linux
BUILD_DIR=${BUILD_ROOT}/x86_64 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
# the build script had verified in the paddlepaddle docker image. # the build script had verified in the paddlepaddle docker image.
# please follow the instruction below to install PaddlePaddle image. # please follow the instruction below to install PaddlePaddle image.
# https://www.paddlepaddle.org.cn/documentation/docs/zh/install/docker/linux-docker.html # 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 -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} \ cmake -B ${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS=${BUILD_SO} \
-DWITH_ASR=OFF \ -DWITH_ASR=${BUILD_ASR} \
-DWITH_CLS=OFF \ -DWITH_CLS=${BUILD_CLS} \
-DWITH_VAD=ON \ -DWITH_VAD=${BUILD_VAD}
-DFASTDEPLOY_INSTALL_DIR=/workspace/zhanghui/paddle/FastDeploy/build/Linux/x86_64/install
cmake --build ${BUILD_DIR} -j cmake --build ${BUILD_DIR} -j

@ -28,8 +28,8 @@ endif()
if(ANDROID) if(ANDROID)
add_library(extern_glog INTERFACE) add_library(extern_glog INTERFACE)
add_dependencies(extern_glog gflags) add_dependencies(glog gflags)
else() # UNIX else() # UNIX
add_library(extern_glog ALIAS glog) add_library(extern_glog ALIAS glog)
add_dependencies(extern_glog gflags) add_dependencies(glog gflags)
endif() endif()

@ -8,4 +8,4 @@ target_link_libraries(cls INTERFACE -static-libstdc++;-Wl,-Bsymbolic ${FASTDEPLO
set(bin_name panns_nnet_main) set(bin_name panns_nnet_main)
add_executable(${bin_name} ${CMAKE_CURRENT_SOURCE_DIR}/${bin_name}.cc) 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} -static-libstdc++;-Wl,-Bsymbolic gflags glog cls)

@ -67,7 +67,7 @@ int ClsNnet::Init(const ClsNnetConf& conf) {
runtime_option.UsePaddleInferBackend(); runtime_option.UsePaddleInferBackend();
#endif #endif
runtime_option.SetCpuThreadNum(conf.num_cpu_thread_); 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<fastdeploy::Runtime>(new fastdeploy::Runtime()); runtime_ = std::unique_ptr<fastdeploy::Runtime>(new fastdeploy::Runtime());
if (!runtime_->Init(runtime_option)) { if (!runtime_->Init(runtime_option)) {
std::cerr << "--- Init FastDeploy Runitme Failed! " std::cerr << "--- Init FastDeploy Runitme Failed! "

@ -16,6 +16,7 @@
#include <string> #include <string>
#include "base/flags.h" #include "base/flags.h"
#include "base/log.h"
#include "cls/nnet/panns_interface.h" #include "cls/nnet/panns_interface.h"
DEFINE_string(conf_path, "", "config path"); DEFINE_string(conf_path, "", "config path");

@ -3,7 +3,7 @@ set(srcs
) )
add_library(pps_vad ${srcs}) add_library(pps_vad ${srcs})
target_link_libraries(pps_vad PUBLIC ${FASTDEPLOY_LIBS} common extern_glog) target_link_libraries(pps_vad PUBLIC ${FASTDEPLOY_LIBS} common glog)
set(bin_name vad_nnet_main) set(bin_name vad_nnet_main)
@ -13,4 +13,4 @@ target_link_libraries(${bin_name} pps_vad)
file(RELATIVE_PATH DEST_DIR ${ENGINE_ROOT} ${CMAKE_CURRENT_SOURCE_DIR}) file(RELATIVE_PATH DEST_DIR ${ENGINE_ROOT} ${CMAKE_CURRENT_SOURCE_DIR})
install(TARGETS pps_vad DESTINATION lib) install(TARGETS pps_vad DESTINATION lib)
install(TARGETS extern_glog DESTINATION lib) install(TARGETS glog DESTINATION lib)
Loading…
Cancel
Save