0

I am currently working on processor supporting RISC-V vector extension as a university project. I want to do some benchmarks on it and writing that in assembly would be a painful. Software is not my strongest side and I am having trouble configuring LLVM 14.0.0 support vector extension. Does anyone have a guide on how to set it up? Preferably with autovectorization. It works fine on CompilerExplorer: https://godbolt.org/z/8YebGee3W

Currently I have configured it like this:

cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
-DLLVM_TARGETS_TO_BUILD=all -DCMAKE_BUILD_TYPE=Release ../llvm

If i compile with:

clang --target=riscv32 -march=rv32gcv test.c 

I get following error:

ld.lld: error: unable to find library -lc
ld.lld: error: unable to find library -lm
ld.lld: error: unable to find library -lclang_rt.builtins-riscv32
clang-14: error: ld.lld command failed with exit code 1 (use -v to see invocation)

I am on Ubuntu 20.04 on an x86_64 system. Any help is appreciated.

Rumle1708
  • 1
  • 1
  • 1
    Looks like you're compiling successfully, you're just failing linking due to missing riscV libraries – Chris Dodd Feb 25 '22 at 23:32
  • You can look at these topics: [Using Clang to compile for RISC-V](https://stackoverflow.com/questions/68580399/using-clang-to-compile-for-risc-v/68583104#68583104) [RISC-V Toolchain with Vector support](https://stackoverflow.com/questions/69375945/risc-v-toolchain-with-vector-support?noredirect=1&lq=1) – Celuk Mar 02 '22 at 13:57

0 Answers0