Configuring pocl for RISCV

630 views Asked by At

I am trying to use pocl to cross-compile OpenCL programs for RISCV64. Slide 18 at this link: https://riscv.org/wp-content/uploads/2015/01/riscv-software-toolchain-workshop-jan2015.pdf seems to suggest that it is possible to generate scalar code for the RISCV backend. I am using pocl-0.8 (based on llvm 3.3 since that is the stable version for the riscv-llvm backend).

I ran the configure command as follows:

./configure CC=/path/to/riscv/bin/riscv64-unknown-elf-gcc CXX=/path/to/riscv/bin/riscv64-unknown-elf-g++ --host=riscv64-unknown-elf

I got the following error:

configure: error: unable to find the libtool dl library (usually libltdl-dev)

I don't get any error if I configure pocl for my native system (x86_64). So, I am guessing I need the RISCV variant of the library mentioned in the error message above but I am not sure how to do that. I would appreciate any help with this. Thanks!

1

There are 1 answers

0
osgx On

Do you want to run pocl on the RISC-V system generating RISC-V code or to run it on host x64 system to generate RISC-V?

Your configure command

./configure CC=riscv64-unknown-elf-gcc CXX=riscv64-unknown-elf-g++ --host=riscv64-unknown-elf

is for compiling native pocl on RISC-V which is hard (you need full cross-environment and RISC-V target cpu/emulator/board with linux, libc, and many packets). And even for this it is incorrect, as your host (machine where you start compilation of the pocl) is not riscv, but x64 (use --target to set target architecture in configure).

But if you want to run pocl on x64, don't set CC and CXX, host and target in ./configure run to get native x64 pocl. llvm will have all backend and will let you to generate RISC-V codes, when starting pocl on x64.