2

I did not get response from Qualcomm forum so I decided to post here. When I was trying to run examples of Halide for Hexagon by running make run as written in the document. Then I got the following issue. The -lc++abi is missing.

clang++ -std=c++11 -I /opt/qcom/Hexagon_SDK/4.3.0.0/tools/HALIDE_Tools/2.3.03/Halide/include -stdlib=libc++ -O3 -g -fno-rtti -rdynamic conv3x3_generator.cpp /opt/qcom/Hexagon_SDK/4.3.0.0/tools/HALIDE_Tools/2.3.03/Halide/lib/libHalide.a /opt/qcom/Hexagon_SDK/4.3.0.0/tools/HALIDE_Tools/2.3.03/Halide/tools/GenGen.cpp -o /opt/qcom/Hexagon_SDK/4.3.0.0/tools/HALIDE_Tools/2.3.03/Halide/Examples/build/offload/hexagon_benchmarks/bin/conv3x3.generator  -lz -lrt -ldl -lpthread -lm
/usr/bin/ld: cannot find -lc++abi
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I checked the /usr/lib and find. So it should be there?

./x86_64-linux-gnu/libc++abi.so.1.0
./x86_64-linux-gnu/libc++abi.so.1
./llvm-10/lib/libc++abi.so.1.0
./llvm-10/lib/libc++abi.so.1

Did I miss anything or make anything stupid? Thanks!

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Yaoshen
  • 23
  • 4

2 Answers2

0

ld is your system's host linker -- that's GNU BFD ld. clang++ must be in your PATH but it's the host clang++ and not the hexagon-clang++ that would be with Halide/Hexagon tools.

Brian Cain
  • 14,403
  • 3
  • 50
  • 88
  • Yes, they are NOT hexagon-clang++. Here is the info: `/usr/bin/clang++` clang version 10.0.0-4ubuntu1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin linker is: `/usr/bin/ld` – Yaoshen Aug 08 '21 at 03:20
  • You should not expect the host `clang++` to work for hexagon. For a relevant example about one reason why -- the `libc++abi`/`libc++` libraries are built for the host architecture and not hexagon. You must use `hexagon-clang++` from the Hexagon Tools. – Brian Cain Aug 08 '21 at 04:23
  • Yes. I also tried hexagon-clang++ but then the pthread.h was missing. https://developer.qualcomm.com/forum/qdn-forums/software/hexagon-dsp-sdk/debugging/68719 I have been confused about this question for several days. Still can't figure out what is happening. – Yaoshen Aug 08 '21 at 04:51
  • It's pretty unfortunate that the toolchain does not ship with conventional behavior for finding the OS includes/libraries. The SDK comes with examples but reproducing the results may be challenging. I think you want to make a hexagon shared object with C++ sources, to be loaded by a fastrpc shell program. I'll see if I can make a simpler example than the ones in the SDK. – Brian Cain Aug 08 '21 at 05:02
  • Thanks!. The aim for me is to have some demo run on snapdragon device since I am developing some pipeline using hexagon DSP. – Yaoshen Aug 08 '21 at 14:15
  • The problem has been solved. See my new comment. – Yaoshen Aug 11 '21 at 01:53
0

I contacted the person from Qualcomm. I am not supposed to use either /usr/bin/clang++ nor hexagon-clang++. I downloaded clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz from https://releases.llvm.org/7.0.1/. You should use clang++ under the bin folder after you extract it. Now it works for me.

Yaoshen
  • 23
  • 4