[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: |
Ralf Wildenhues |
Subject: |
Re: Circular dependency dropped warning from make in relating to CUDA code |
Date: |
Sat, 27 Jun 2009 12:33:07 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-15) |
Hello Adam,
* Adam Mercer wrote on Fri, Jun 26, 2009 at 09:23:03PM CEST:
> make: Circular CudaChisq.cu <- CudaChisq.cu.c dependency dropped.
>
> The following rule is used to generate the .c file from the .cu source:
>
> CudaChisq.cu.c: CudaChisq.cu
> nvcc -cuda --host-compilation=c $(INCLUDES) $(CPPFLAGS) --output-file
> $@ $<
>
> and I think that this is the source of the dependency warning. Does
> anyone know how I can "fix" this warning?
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).
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.
Cheers,
Ralf