如何配置 LLVM 来进行带有向量扩展的 RISC-V 编译?
我目前正在研究支持 RISC-V 矢量扩展的处理器作为大学项目。我想对它做一些基准测试,并且在汇编中编写它会很痛苦。软件不是我的强项,我在配置 LLVM 14.0.0 支持向量扩展时遇到问题。有人有如何设置的指南吗?最好使用自动矢量化。它在 CompilerExplorer 上运行良好: https://godbolt.org/z/8YebGee3W
目前我已经配置了它像这样:
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
-DLLVM_TARGETS_TO_BUILD=all -DCMAKE_BUILD_TYPE=Release ../llvm
如果我编译:
clang --target=riscv32 -march=rv32gcv test.c
我收到以下错误:
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)
我在 x86_64 系统上的 Ubuntu 20.04 上。任何帮助表示赞赏。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论