THU-DSP-LAB / llvm-project

LLVM OpenCL C compiler suite for ventus GPGPU
http://llvm.org
Other
31 stars 15 forks source link

ocl-icd #123

Closed suleymanemre closed 5 months ago

suleymanemre commented 5 months ago

Sorry I am new at compiler field. Thankl you for your time. I tried to download ventus LLVM Compiler. I got an output like this, but I didn't understand whether the process was completed or not. If I need to build ocl-icd, should I do it in the file I downloaded? Doesn't the script file do it automatically?

In file included from /home/suleyman/Ventus_Compiler/ventus-driver/driver/spike_device/ventus.cpp:18:
In file included from /home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/spike_main/spike_main.h:11:
/home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/riscv/sim.h:179:8: warning: 'set_target_endianness' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  void set_target_endianness(memif_endianness_t endianness);
       ^
/home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/fesvr/memif.h:30:16: note: overridden virtual function is here
  virtual void set_target_endianness(memif_endianness_t endianness) {}
               ^
In file included from /home/suleyman/Ventus_Compiler/ventus-driver/driver/spike_device/ventus.cpp:18:
In file included from /home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/spike_main/spike_main.h:11:
/home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/riscv/sim.h:180:22: warning: 'get_target_endianness' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  memif_endianness_t get_target_endianness() const;
                     ^
/home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/fesvr/memif.h:31:30: note: overridden virtual function is here
  virtual memif_endianness_t get_target_endianness() const {
                             ^
In file included from /home/suleyman/Ventus_Compiler/ventus-driver/driver/spike_device/ventus.cpp:18:
In file included from /home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/spike_main/spike_main.h:10:
In file included from /home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/riscv/cfg.h:7:
In file included from /home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/riscv/mmu.h:11:
/home/suleyman/Ventus_Compiler/llvm-project/../ventus-gpgpu-isa-simulator/riscv/processor.h:272:12: warning: unused function 'cto' [-Wunused-function]
static int cto(reg_t val)
           ^
14 warnings generated.
[4/4] Linking CXX executable codetests/codetests
ninja: Entering directory `/home/suleyman/Ventus_Compiler/llvm-project/../ventus-driver/build'
[0/1] Install the project...
-- Install configuration: "Debug"
-- Installing: /home/suleyman/Ventus_Compiler/llvm-project/install/lib/libspike_driver.so
-- Set non-toolchain portion of  runtime path of "/home/suleyman/Ventus_Compiler/llvm-project/install/lib/libspike_driver.so" to ""
Please build ocl-icd first!

Another question,

/Ventus_Compiler/llvm-project/build/lib in this directory there is no libpocl.so so I cannot link icd driver like given below.

Run export OCL_ICD_VENDORS=${VENTUS_INSTALL_PREFIX}/lib/libpocl.so to tell ocl icd loader where the icd driver is.

suleymanemre commented 5 months ago

Firstly we need to config, make and make install to ocl-icd (you can take a look at readme file in ocl-icd directory)

$cd ocl-icd
ocl-icd$ ./configure

after configure you need to call make in ocl-icd directory

suleyman@DESKTOP-UD9KE8O:~/Ventus_Compiler/ocl-icd$ make
ruby icd_generator.rb --mode database --database ./ocl_interface.yaml \

/bin/bash: ruby: command not found
make: *** [Makefile:1660: stamp-generator] Error 127

If you see error something like this

sudo apt install ruby

after that you can make ocl-icd

ocl-icd$ make

after make command just make install in ocl-icd

ocl-icd$ sudo make install

after building ocl-icd you can back to llvm-project file and

llvm-project$ bash ./build-ventus.sh