From 2a7705d7e809f2d5b5089c21c66a5ff6039b834e Mon Sep 17 00:00:00 2001 From: DefTruth <31974251+DefTruth@users.noreply.github.com> Date: Mon, 28 Nov 2022 13:32:28 +0800 Subject: [PATCH] [Bug Fix] fix libomp.so not found error (#715) * [Android] Add VisSegmentation NEON support * [ARM] change vqaddq_u8 -> vaddq_u8 * [ARM] change vqaddq_u8 -> vaddq_u8 * [Bug Fix] add FDASSERT * update assert info * add QuantizeBlendingWeight8 * Update QuantizeBlendingWeight8 * Update VisSegmentation * [Visualize] add DefaultVisualizeType and EnableFastVisuzlie * fix typos * fix typo * Update VisSegmentation * [Android] Add omp parallel support for Android * Add omp schedule(static) * [Bug Fix] fix libomp.so not found error --- CMakeLists.txt | 12 ++++++++---- java/android/fastdeploy/build.gradle | 5 +++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3250eca8d..efc35b51c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,7 @@ option(WITH_TESTING "Whether to compile with unittest." OFF) ############################# Options for Android cross compiling ######################### option(WITH_OPENCV_STATIC "Use OpenCV static lib for Android." OFF) option(WITH_LITE_STATIC "Use Paddle Lite static lib for Android." OFF) +option(WITH_OPENMP "Use OpenMP support for Android." OFF) # Please don't open this flag now, some bugs exists. # Only support Linux Now @@ -489,12 +490,15 @@ if(MSVC) target_compile_options(${LIBRARY_NAME} PRIVATE "$<$>:/wd4251>$<$>:-Xcompiler=/wd4251>") endif() -if (ANDROID) +# extra depend libs for android +if(ANDROID) find_library(log-lib log) list(APPEND DEPEND_LIBS ${log-lib}) - find_package(OpenMP) - if(OpenMP_CXX_FOUND) - list(APPEND DEPEND_LIBS OpenMP::OpenMP_CXX) + if(WITH_OPENMP) + find_package(OpenMP) + if(OpenMP_CXX_FOUND) + list(APPEND DEPEND_LIBS OpenMP::OpenMP_CXX) + endif() endif() endif() diff --git a/java/android/fastdeploy/build.gradle b/java/android/fastdeploy/build.gradle index d73e1e36f..688d8e795 100644 --- a/java/android/fastdeploy/build.gradle +++ b/java/android/fastdeploy/build.gradle @@ -31,6 +31,11 @@ android { version "3.10.2" } } + sourceSets { + main { + jniLibs.srcDirs = ['libs'] + } + } ndkVersion '20.1.5948944' }