* 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 Makefile.am to specify how to do the build: > > noinst_LTLIBRARIES = libfft.la > libfft_la_SOURCES = \ [...] > CudaFFT.cu > > 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 well. > .cu.o: > $(NVCC) -c $(INCLUDES) $(CPPFLAGS) $(NVCCFLAGS) -o $@ $< > > however when I build the CudaFFT.cu source is not built, but I can > build it manually with "make CudaFFT.o", is this due to automake not > recognising CudaFFT.cu 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 CudaFFT.cu 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 case. > 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. Cool. Hope that helps. Cheers, Ralf