Compile and run the openblas library on the riscv simulator

83 views
Skip to first unread message

xin wang

unread,
Dec 2, 2021, 10:25:10 PM12/2/21
to OpenBLAS-users
I want to try to compile and run the Openblas library on the riscv simulator, but I am currently experiencing some problems. My current attempt is to use

make HOSTCC=gcc TARGET=C910V CC=riscv64-unknown-linux-gnu-gcc FC=riscv64-unknown-linux-gnu-gfortran (this command comes from the official OPENBLAS document)

This command is used to compile openblas, and finally the qemu simulation tool is used for simulation operation. At present, there are always problems during the compilation process and the compilation cannot be successful. I think it may be that the versions of the riscv64-unknown-linux-gnu-gcc and openblas libraries need to match, but I don’t know how to correctly cross-compile openblas for riscv. I hope someone who knows this can help. Thanks!

martin-frbg

unread,
Dec 3, 2021, 4:13:20 PM12/3/21
to OpenBLAS-users
You will probably need the vendor version of gcc, not the one from the riscv-gnu-toolchain project on github. Please see closed issue #3290 in the OpenBLAS project, https://github.com/xianyi/OpenBLAS/issues/3290

xin wang

unread,
Dec 5, 2021, 10:03:03 PM12/5/21
to OpenBLAS-users
Thank you Martin !
In fact, I have seen your previous communication with dream-math  in issue #3290 in the openblas project, before asking the question.

I still encountered the same problem, and finally found that the vendor version of gcc I was using was still relatively old, the April or May 2020 version (https://github.com/c-sky/xuantie- vector-demos). Now I have successfully compiled openblas for risc-v (v0.3.18) by using a newer vendor version gcc, the June 2021 version (https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource/1836682/1624260655742/riscv64-linux-x86_64-20210618.tar.gz).This version of gcc tool can be matched with openblas v0.3.18, the link is in Chinese, you need to register alibaba account to log in to download. 

I found a vendor version of the gcc toolchain on github, the link is https://github.com/T-head-Semi/xuantie-gnu-toolchain. There are also several newer versions of the vendor version of gcc. The link is as follows: https://occ.t-head.cn/community/download?id=3987618263851929600, I hope it will be helpful to others.

Finally, I would like to ask if the version of rvv-spec used by OpenBLAS is 0.7.1 intrinsic of xuantie. Thank you for your help.
Reply all
Reply to author
Forward
0 new messages