GithubHelp home page GithubHelp logo

Comments (9)

mollybuild avatar mollybuild commented on May 3, 2024

更新llvm-project到最新commit:31859f896cf90d64904134ce7b31230f374c3fcc (Jun 10)
还是报相同的error:

$ make vector
/home/cxo/repos/llvm-project/build2/install/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR  -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/bin/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64/bin  -c -o src/utils.o src/utils.c
clang-13: error: invalid arch name 'rv64gcv1p0', unsupported version number 1.0 for experimental extension (this compiler supports 0.10) 'v'
make: *** [Makefile:18: vector] Error 1

from intern.

ArdxWe avatar ArdxWe commented on May 3, 2024

LLVM你应该使用 rvv-iscas分支

repo: https://github.com/isrc-cas/rvv-llvm.git
branch: rvv-iscas
commit: c360b611314ec39777487d050af6daa24eae811c
我会更新文档 抱歉我没写清楚

from intern.

mollybuild avatar mollybuild commented on May 3, 2024

LLVM你应该使用 rvv-iscas分支

repo: https://github.com/isrc-cas/rvv-llvm.git
branch: rvv-iscas
commit: c360b611314ec39777487d050af6daa24eae811c
我会更新文档 抱歉我没写清楚

这个repo的地址现在已经发生了变化,现在是https://github.com/plctlab/llvm-project。

from intern.

mollybuild avatar mollybuild commented on May 3, 2024

现在代码换到指定的commit(c360b6113),执行make vector,会报下面的错误:

$ make vector
/home/cxo/opt/llvm/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR  -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64  -c -o src/utils.o src/utils.c
/home/cxo/opt/llvm/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64  -c -o src/axpy.o src/axpy.c
/home/cxo/opt/llvm/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR  -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64 -c -o src/main.o src/main.c
/home/cxo/opt/llvm/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64 -o bin/rvv-test src/*.o -lm
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: src/axpy.o: can't link double-float modules with soft-float modules
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file src/axpy.o
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: src/main.o: can't link double-float modules with soft-float modules
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file src/main.o
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: src/utils.o: can't link double-float modules with soft-float modules
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file src/utils.o
clang-12: error: ld command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:21: vector] Error 1

我的Makefile配置如下:

$ make vector
/home/cxo/opt/llvm/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR  -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64  -c -o src/utils.o src/utils.c
/home/cxo/opt/llvm/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64  -c -o src/axpy.o src/axpy.c
/home/cxo/opt/llvm/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR  -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64 -c -o src/main.o src/main.c
/home/cxo/opt/llvm/bin/clang  -Wall --target=riscv64-unknown-elf -DUSE_RISCV_VECTOR -march=rv64gcv1p0 -menable-experimental-extensions -O2  --sysroot=/home/cxo/opt/rv64/riscv64-unknown-elf --gcc-toolchain=/home/cxo/opt/rv64 -o bin/rvv-test src/*.o -lm
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: src/axpy.o: can't link double-float modules with soft-float modules
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file src/axpy.o
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: src/main.o: can't link double-float modules with soft-float modules
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file src/main.o
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: src/utils.o: can't link double-float modules with soft-float modules
/home/cxo/opt/rv64/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../bin/riscv64-unknown-elf-ld: failed to merge target specific data of file src/utils.o
clang-12: error: ld command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:21: vector] Error 1

from intern.

ArdxWe avatar ArdxWe commented on May 3, 2024

看着似乎是链接的问题,测试代码你切换到指定分支了吗?
repo : https://github.com/RALC88/riscv-vectorized-benchmark-suite.git
branch : rvv-1.0

from intern.

mollybuild avatar mollybuild commented on May 3, 2024

看着似乎是链接的问题,测试代码你切换到指定分支了吗?
repo : https://github.com/RALC88/riscv-vectorized-benchmark-suite.git
branch : rvv-1.0

是的,是这个分支没错的

from intern.

mollybuild avatar mollybuild commented on May 3, 2024

可能是我的gnu 工具链支持的arch不匹配,我再看看

from intern.

ArdxWe avatar ArdxWe commented on May 3, 2024

可能是我的gnu 工具链支持的arch不匹配,我再看看

$ git clone https://github.com/riscv/riscv-gnu-toolchain
$ cd riscv-gnu-toolchain
$ ./configure --prefix=/opt/riscv
$ make

这是我的方法 你可以试试

from intern.

mollybuild avatar mollybuild commented on May 3, 2024

可能是我的gnu 工具链支持的arch不匹配,我再看看

应该就是GNU工具链的问题引起的,我重新编译了GNU工具链,就可以成功make vector,并且可以成功运行rvv-test,运行的结果如下:

$ /home/cxo/repos/plct-qemu/build/qemu-riscv64 -cpu plct-u64,x-v=true ./rvv-test
init_vector time: 0.000767
doing reference axpy
axpy_reference time: 0.000270
doing vector axpy
axpy_intrinsics time: 0.004088
done
Result ok !!!

重新编译GNU工具链的命令是:

$ cd riscv-gnu-toolchain
$ mkdir build && cd build
$ ../configure --prefix=$RISCV64/Base/ --with-arch=rv64gc --with-abi=lp64d --with-multilib-generator="rv64gc-lp64d--"
$ make -j $nproc

from intern.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.