[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Build rules for CUDA source files

From: Ralf Wildenhues
Subject: Re: Build rules for CUDA source files
Date: Thu, 9 Sep 2010 22:27:15 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

* Adam Mercer wrote on Thu, Sep 09, 2010 at 10:17:03PM CEST:
> I'm working on adding some code that uses the NVidia CUDA compiler and
> libraries to one of our projects. I believe that I have added the
> appropriate rules to to specify how to do the build:
> noinst_LTLIBRARIES =
> libfft_la_SOURCES = \
> pkginclude_HEADERS = \
>   ComplexFFT.h \
>   RealFFT.h \
>   FFTWMutex.h \
>   TimeFreqFFT.h \
>   CudaPlan.h

JFTR, headers not going to be installed can be listed in *_SOURCES as

> .cu.o:
>   $(NVCC) -c $(INCLUDES) $(CPPFLAGS) $(NVCCFLAGS) -o $@ $<
> however when I build the source is not built, but I can
> build it manually with "make CudaFFT.o", is this due to automake not
> recognising as a source file?

For libtool libraries, it will try for a CudaFFT.lo file.  You may be
able to create a .cu.lo rule to generate that.  I think.  Since I'm not
sure that that will work OOTB with Libtool (there is no extra Cuda
language tag defined in Libtool, but you may be able to get by by using
--tag=CC or so), a workaround for now could be to remove from
*_SOURCES, add it to EXTRA_DIST, and add
  libfft_la_LIBADD = CudaFFT.o

Untested, please complain if that breaks.

Ah yes, of course you need to ensure PICness yourself in the latter

> PS: I'm working on adding support into automake to support CUDA and
> almost have something ready but I'd like to also get the above
> working.


Hope that helps.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]