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

[Bug] compile tvm_rpc without hexagon causes missing -lcdsprpc #11059

Closed
pfk-beta opened this issue Apr 19, 2022 · 2 comments · Fixed by #11080
Closed

[Bug] compile tvm_rpc without hexagon causes missing -lcdsprpc #11059

pfk-beta opened this issue Apr 19, 2022 · 2 comments · Fixed by #11080
Assignees

Comments

@pfk-beta
Copy link
Contributor

pfk-beta commented Apr 19, 2022

When I run command to compile tvm_rpc, i'm getting error, that linker cannot find -lcdsprpc, which I think is compiled/added during Hexagon module. My compilation command:

RUN mkdir -p /workspace/build && \
 cd /workspace/build && \
 cp /workspace/cmake/config.cmake . && \
 sed -i 's/set(USE_LIBBACKTRACE AUTO)/set(USE_LIBBACKTRACE OFF)/g' config.cmake && \
 sed -i 's/set(USE_CPP_RPC OFF)/set(USE_CPP_RPC ON)/g' config.cmake && \
 cmake .. \
  -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
  -DCMAKE_C_COMPILER=${ANDROID_NDK_HOME}toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang \
  -DCMAKE_CXX_COMPILER=${ANDROID_NDK_HOME}toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++ \
  -DCMAKE_FIND_ROOT_PATH=${ANDROID_NDK_HOME}toolchains/llvm/prebuilt/linux-x86_64/ \
  -DUSE_LLVM=${ANDROID_NDK_HOME}toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-config \
  -DUSE_SORT=ON \
  -DUSE_RPC=ON \
  -DUSE_OPENCL=/workspace/3rdparty/OpenCL-Headers \
  -DUSE_LIBBACKTRACE=OFF \
  -DUSE_CPP_RPC=ON \
  -DUSE_PROFILER=OFF \
  -DCMAKE_SYSTEM_NAME=Linux \
  -DCMAKE_SYSTEM_VERSION=1 \
  -DCMAKE_HOST=aarch64-linux-android \
  -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
  -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
  && \
 make -j10 tvm_rpc

Error:

e
#10 30.08 Scanning dependencies of target tvm_rpc
#10 30.09 [100%] Building CXX object apps/cpp_rpc/CMakeFiles/tvm_rpc.dir/rpc_server.cc.o
#10 30.09 [100%] Building CXX object apps/cpp_rpc/CMakeFiles/tvm_rpc.dir/main.cc.o
#10 30.09 [100%] Building CXX object apps/cpp_rpc/CMakeFiles/tvm_rpc.dir/rpc_env.cc.o
#10 32.43 [100%] Linking CXX executable ../../tvm_rpc
#10 32.47 /opt/android-sdk-linux/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find -lcdsprpc
#10 32.48 clang++: error: linker command failed with exit code 1 (use -v to see invocation)
#10 32.49 make[3]: *** [tvm_rpc] Error 1
#10 32.49 apps/cpp_rpc/CMakeFiles/tvm_rpc.dir/build.make:147: recipe for target 'tvm_rpc' failed
#10 32.49 make[2]: *** [apps/cpp_rpc/CMakeFiles/tvm_rpc.dir/all] Error 2
#10 32.49 CMakeFiles/Makefile2:1233: recipe for target 'apps/cpp_rpc/CMakeFiles/tvm_rpc.dir/all' failed
#10 32.49 make[1]: *** [apps/cpp_rpc/CMakeFiles/tvm_rpc.dir/rule] Error 2
#10 32.49 CMakeFiles/Makefile2:1245: recipe for target 'apps/cpp_rpc/CMakeFiles/tvm_rpc.dir/rule' failed
#10 32.49 make: *** [tvm_rpc] Error 2
#10 32.49 Makefile:630: recipe for target 'tvm_rpc' failed

During Cmake I see:

#10 5.125 CMake Warning at apps/cpp_rpc/CMakeLists.txt:55 (message):
#10 5.125   Could not locate some Hexagon SDK components
#10 5.125 
#10 5.125 

My SoC is Mediatek Helio P22 MT6762

@kparzysz-quic
Copy link
Contributor

As a workaround, you can add -DUSE_HEXAGON_SDK=OFF to your cmake command, or change line 48 in apps/cpp_rpc/CMakeLists.txt from

if (BUILD_FOR_ANDROID AND USE_HEXAGON_SDK)

to

if (BUILD_FOR_ANDROID AND USE_HEXAGON)

@kparzysz-quic kparzysz-quic self-assigned this Apr 19, 2022
@pfk-beta
Copy link
Contributor Author

pfk-beta commented Apr 20, 2022

Thanks, argument in cmake command doesn't work. If anyone needs, this is sed command: sed -i 's/if (BUILD_FOR_ANDROID AND USE_HEXAGON_SDK)/if (BUILD_FOR_ANDROID AND USE_HEXAGON)/g' ../apps/cpp_rpc/CMakeLists.txt (run from build folder)

masahi pushed a commit that referenced this issue Apr 21, 2022
)

* [RPC] Don't use existence of USE_HEXAGON_SDK as enablement check

Use USE_HEXAGON to check if Hexagon support is enabled or not.

This fixes #11059.

* Restart CI
shtinsa pushed a commit to Deelvin/tvm that referenced this issue May 17, 2022
…che#11080)

* [RPC] Don't use existence of USE_HEXAGON_SDK as enablement check

Use USE_HEXAGON to check if Hexagon support is enabled or not.

This fixes apache#11059.

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

Successfully merging a pull request may close this issue.

2 participants