3

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!

kchanuec
  • 55
  • 5
  • Do you have any news on this? Maybe one can get further support on the RISC-V mailing lists? – Christoph Feb 11 '17 at 17:20
  • Didn't get any response on the RISC-V and the pocl mailing lists. – kchanuec Feb 13 '17 at 03:29
  • This is looks like problem in your native system. Is it ubuntu or debian? Try this `sudo apt-get build-dep libpocl1` to install all packages needed to build pocl in native mode. It may help you to get build for cross. Also check https://answers.launchpad.net/pocl/+question/209564 - they say that you needs ltdl.h for the target system. – osgx Mar 15 '17 at 02:44

1 Answers1

1

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.

osgx
  • 90,338
  • 53
  • 357
  • 513