我想在
Linux下编译一个非常基本的hello世界级的Cuda程序.我有三个文件:
>内核:helloWorld.cu
> main方法:helloWorld.cpp
> common header:helloWorld.h
你能给我写一个简单的Makefile来编译这个nvcc和g吗?
谢谢,
的Gabor
解决方法
以防万一,这是我的变种.我用它在Mac上编译CUDA项目,但我认为它也适合Linux.它需要CUDA SDK.
BINDIR = ./ # places compiled binary in current directory EXECUTABLE := helloWorld CCFILES := helloWorld.cpp CUFILES := helloWorld.cu # an ugly part - setting rootdir for CUDA SDK makefile # look for common.mk - I don't know where SDK installs it on Linux - # and change ROOTDIR accordingly ROOTDIR := /Developer/GPU\ Computing/C/common include $(ROOTDIR)/../common/common.mk