[llvm-dev] problem on compiling cuda program with clang++

Justin Lebar via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 27 12:43:01 PDT 2016


(+llvm-dev)

My question was whether your host machine, the one which is running
the compiler, is ARM (as opposed to x86 or POWER).  The header you
pointed to was in "aarch64-linux-gnu", which made me think you might
be on an ARM system.

If you are not running linux x86, it is not likely to work.

If you are running linux x86, we will need much more details about
your system in order to be able to assist you.  (For example, what
Linux distribution are you running, and what version?)  We will also
need the output of running your command with "clang -v" and the
preprocessor output, clang -E.

-Justin

On Thu, Oct 27, 2016 at 11:49 AM, 李阳 <liyang.cs.cqu at gmail.com> wrote:
> Yes, I am following the document `CompileCUDAWithLLVM.rst`.
>
> And I want to use the `clang++` to compile the CUDA program to generate
> intermediate representation(IR). However what I have been trying is that
> `nvcc` can compile correctly and `clang++` cannot.
>
> I dont know whether the `nvcc` can generate the IR code or PTX level
> instruction? Thanks!
>
> 2016-10-28 2:02 GMT+08:00 Justin Lebar <jlebar at google.com>:
>>
>> Hi, it looks like you're compiling CUDA for an ARM host?  This is not
>> a configuration we have tested, nor is it something we have the
>> capability of testing at the moment.
>>
>> You may be able to make it work by providing the appropriate -isystem
>> flags to clang so that it can find your headers, but who knows, it may
>> be more complicated than that.
>>
>> Regards,
>> -Justin
>>
>> On Wed, Oct 26, 2016 at 9:59 PM, 李阳 via llvm-dev
>> <llvm-dev at lists.llvm.org> wrote:
>> > Hi all,
>> >
>> > I compiled the llvm3.9 source code on the Nvidia TX1 board. And now I am
>> > following the document in the docs/CompileCudaWithLLVM.rst to compile
>> > cuda
>> > program with clang++.
>> >
>> > However, when I compile `axpy.cu` using `nvcc`, nvcc can generate the
>> > correct the binary;
>> >
>> > while compiling `axpy.cu` using clang++, the detailed command is
>> > `clang++
>> > axpy.cu -o axpy --cuda-gpu-arch=sm_53 -L/usr/local/cuda/lib64
>> > -lcudart_static -ldl -lrt -pthread`, clang++ generate the following
>> > error:`/usr/include/features.h:367:12: fatal error: 'sys/cdefs.h' file
>> > not
>> > found
>> > #  include <sys/cdefs.h>`.
>> >
>> > And I find that 'sys/cdefs.h' is included in the directory
>> > `/usr/include/aarch64-linux-gnu/sys`.
>> >
>> > Anybody ever came accross the same problems? Thanks!
>> >
>> >
>> > _______________________________________________
>> > LLVM Developers mailing list
>> > llvm-dev at lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>> >
>
>


More information about the llvm-dev mailing list