[LLVMdev] Build PTX samples with LLVM/Clang/libclc
chenwj at iis.sinica.edu.tw
Tue Dec 6 19:17:30 PST 2011
I download llvm-ptx-samples  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 , LLVM , Clang and libclc websites  over there.
I feel people might get lost among those websites. ;-)
Here are my flows, hope it's useful to you. (At least  should be updated to
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 ../
O.K., I have a problem here.
[ 12%] Compiling blur2d_kernel.cl -> blur2d_kernel.ll
clang: error: no such file or directory: 'ptx32'
make: *** [bin/blur2d_kernel.ll] Error 1
make: *** [opencl/blur2d/CMakeFiles/blur2d_kernel.ptx.dir/all] Error 2
Do you know how to fix it? Thanks.
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
More information about the llvm-dev