[LLVMdev] Build PTX samples with LLVM/Clang/libclc

陳韋任 chenwj at iis.sinica.edu.tw
Tue Dec 6 19:17:30 PST 2011


Hi Justin,

  I download llvm-ptx-samples [1] and try to build them. I found it seems lack
of a complete document on how to build them with LLVM/Clang/libclc. Do you think
it's a good idea to put a complete document/tutorial in _one_ place? Currently,
there are your website [2], LLVM [3], Clang and libclc websites [5] over there.
I feel people might get lost among those websites. ;-)

  Here are my flows, hope it's useful to you. (At least [1] should be updated to
include libclc)

1. Build LLVM/Clang with PTX support.

2. Download your PTX samples and libclc, then build them. I guess you want to
   pull libclc under llvm-ptx-samples/libclc/, right?

---
$ git clone git://github.com/jholewinski/llvm-ptx-samples.git
$ cd llvm-ptx-samples; rm -rf libclc/
$ git clone git://git.pcc.me.uk/~peter/libclc.git
# Build libclc first
$ cd libclc/
$ ./configure.py --with-llvm-config=/path/to/llvm-config && make
# Then build your PTX samples
$ cd ../; make build; cd build
$ cmake ../
$ make
---

  O.K., I have a problem here.

[ 12%] Compiling blur2d_kernel.cl -> blur2d_kernel.ll
clang: error: no such file or directory: 'ptx32'
make[2]: *** [bin/blur2d_kernel.ll] Error 1
make[1]: *** [opencl/blur2d/CMakeFiles/blur2d_kernel.ptx.dir/all] Error 2

  Do you know how to fix it? Thanks.

[1] https://github.com/jholewinski/llvm-ptx-samples
[2] http://sites.google.com/site/justinholewinski/projects/llvm-ptx-back-end
[3] http://llvm.org/docs/ReleaseNotes.html#whatsnew
[4] http://clang.llvm.org/docs/ReleaseNotes.html#opencl
[5] http://www.pcc.me.uk/~peter/libclc/

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj




More information about the llvm-dev mailing list