diff --git a/CMakeLists.txt b/CMakeLists.txt index 737a8ca..8c369cf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ option(BUILD_TARGET_LINUX "Set the build target is Linux" OFF) option(BUILD_TARGET_WINDOWS "Set the build target is Windows" OFF) option(BUILD_TARGET_ARM "Set the build target is Arm" OFF) option(BUILD_TARGET_MIPS "Set the build target is MIPS" OFF) +option(BUILD_TARGET_LOONGARCH64 "Set the build target is LOONGS" OFF) add_compile_options(-std=c++11) option(WITH_OCR "enable OCR module" ON) diff --git a/README.md b/README.md index c66ace7..0152a98 100755 --- a/README.md +++ b/README.md @@ -54,6 +54,12 @@ build_windows.bat ``` ./build_mips64.sh ``` +* build script on loongarch64 is build_loong.sh + +*Note: Loongarch64 only supports local compiling now* +``` +./build_loongarch64.sh +``` #### 6. Run the test program diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e982fd4..fb1e80c 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,6 +51,11 @@ elseif(BUILD_TARGET_MIPS) ${PROJECT_SOURCE_PATH}/3rdparty/libs/mips64/ksai-lite/libtensorflow-lite.so dl ) +elseif(BUILD_TARGET_LOONGARCH64) + set(LINK_LIB_LIST + ${PROJECT_SOURCE_PATH}/3rdparty/libs/loongarch64/opencv/libopencv_world.so + ${PROJECT_SOURCE_PATH}/3rdparty/libs/loongarch64/ksai-lite/libksai-lite.so + ) else() # default is linux set(LINK_LIB_LIST ${PROJECT_SOURCE_PATH}/3rdparty/libs/linux_x86_64/opencv/libopencv_world.so diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f050d7b..c659c11 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -38,6 +38,12 @@ elseif(BUILD_TARGET_MIPS) ${PROJECT_SOURCE_PATH}/3rdparty/libs/mips64/ksai-lite/libtensorflow-lite.so ${LIBRARY_OUTPUT_PATH}/libKSAI-Toolkits.so ) +elseif(BUILD_TARGET_LOONGARCH64) + set(LINK_LIB_LIST + ${PROJECT_SOURCE_PATH}/3rdparty/libs/loongarch64/opencv/libopencv_world.so + ${PROJECT_SOURCE_PATH}/3rdparty/libs/loongarch64/ksai-lite/libksai-lite.so + ${LIBRARY_OUTPUT_PATH}/libKSAI-Toolkits.so + ) else() # default is linux set(LINK_LIB_LIST ${PROJECT_SOURCE_PATH}/3rdparty/libs/linux_x86_64/opencv/libopencv_world.so diff --git a/tools/build_loongarch64.sh b/tools/build_loongarch64.sh new file mode 100644 index 0000000..ae93a0a --- /dev/null +++ b/tools/build_loongarch64.sh @@ -0,0 +1,6 @@ +cd .. +mkdir -p output/loongarch64 +cd output/loongarch64 +cmake -D BUILD_TARGET_LOONGARCH64=ON -D CMAKE_BUILD_TYPE=Release ../../ +make +cd ../../