Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed when enable RKNN option #6

Open
weitianhan opened this issue Jul 10, 2024 · 2 comments
Open

Build failed when enable RKNN option #6

weitianhan opened this issue Jul 10, 2024 · 2 comments

Comments

@weitianhan
Copy link

weitianhan commented Jul 10, 2024

Shout out to your great work! It's easy to follow your instruction to build and run the project. It's working greatly on my RK3588 with CPU inference.

However, when I try to enable the RKNN acceleration, I failed to build the targets. It seems that the compiler fails to link the RKNN library. Could you guide me how to fix it?

What I have done is just adding -DUSE_RKNN=ON in cmake command.
I have make sure the RKNN library librknnrt.so is under /usr/lib and the header files rknn*.h are under /usr/include

[ 36%] Built target piper
[ 45%] Linking CXX executable paroli-cli
[ 54%] Linking CXX executable paroli-server
/usr/bin/ld: cannot find -lrknn: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/paroli-cli.dir/build.make:99: paroli-cli] Error 1
make[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/paroli-cli.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lrknn: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/paroli-server.dir/build.make:165: paroli-server] Error 1
make[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/paroli-server.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
@weitianhan
Copy link
Author

Never mind the problem. I fix it by passing the library path in cmakelist.

if (USE_RKNN)
    target_compile_definitions(piper PRIVATE USE_RKNN)
    target_sources(piper PRIVATE piper/rknn-inferer.cpp)
-   target_link_libraries(piper PRIVATE rknn)
+   target_link_libraries(piper PRIVATE /usr/lib/librknnrt.so)
endif()

@marty1885
Copy link
Owner

Ah dang I broke it accidentally. Thanks for finding it. Will patch it soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants