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

Justin Holewinski justin.holewinski at gmail.com
Wed Dec 7 06:46:35 PST 2011


On Tue, Dec 6, 2011 at 10:17 PM, 陳韋任 <chenwj at iis.sinica.edu.tw> wrote:

> 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. ;-)
>

I agree.  I'm just not sure how these projects fit in with LLVM as a whole.
 LLVM does not really have a "samples" project, and these are very specific
in their use-case.


>
>  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
> ---
>
>
libclc is a submodule of the llvm-ptx-samples repo.  Therefore, the flow is
simple:

$ git clone git://github.com/jholewinski/llvm-ptx-samples
$ cd llvm-ptx-samples
$ git submodule init
$ git submodule update

I'll update the documentation to reflect this.

Also, the libclc configuration is not necessary.  Only some header files
are pulled in by the samples.


>  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.
>

That's a new one.  I just tried a fresh clone and build, and did not
experience this issue.

Can you run "make VERBOSE=1" and post the compiler command-line?


> [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
>



-- 

Thanks,

Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111207/72af2795/attachment.html>


More information about the llvm-dev mailing list