[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Circular dependency dropped warning from make in relating to CUDA co
From: |
Adam Mercer |
Subject: |
Re: Circular dependency dropped warning from make in relating to CUDA code |
Date: |
Mon, 29 Jun 2009 15:19:59 -0500 |
On Sat, Jun 27, 2009 at 05:33, Ralf Wildenhues<address@hidden> wrote:
Ralf
> Why not name the product file CudaChisq.c rather than CudaChisq.cu.c?
> The problem here is that the other half of the circle comes from the
> make-internal rule `%: %.c' for compiling single-source programs.
> I guess you can also avoid it with `make -r', but that may have other,
> unwanted consequences.
>
> (Note also that using $< in target rules is not portable to non-GNU
> make).
Is there a more portable version?
> Here's what I would do:
>
> NVCC = nvcc
> NVCFLAGS = -cuda --host-compilation=c
> SUFFIXES = .cu .c
> .cu.c:
> $(NVCC) $(NVCFLAGS) $(INCLUDES) $(CPPFLAGS) --output-file $@ $<
>
> and then list *.cu files in automake *_SOURCES variables instead of the
> *.c files. You can list *.c files in EXTRA_DIST if you want to have
> them distributed (which implies that the output of nvcc should be
> portable, which I don't know whether it is the case).
>
> Hope that helps.
Thanks, that's got rid of the warning!
Cheers
Adam