Skip to content

Commit

Permalink
Support loongarch64 local compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhaoqi committed Feb 7, 2022
1 parent 7bc12d0 commit 2b580a8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tools/build_loongarch64.sh
Original file line number Diff line number Diff line change
@@ -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 ../../

0 comments on commit 2b580a8

Please sign in to comment.