当前位置: 技术问答>linux和unix
求助基础问题:CUDA的makefile怎么写?
来源: 互联网 发布时间:2016-11-09
本文导语: 本帖最后由 superwavelet 于 2011-02-19 09:50:19 编辑 作业里面说makefile要这么做: you will need to add the following directory paths and libraries to the command to compile the program in the make file: -I/usr/openwin/include -L/usr/openwin/lib ...
you will need to add the following
directory paths and libraries to the command to compile the program in the make file:
-I/usr/openwin/include -L/usr/openwin/lib -L/usr/X11R6/lib -lX11
但是具体的makefile怎么写?
以前看到一个是这样的:
NVCC = /usr/local/cuda/bin/nvcc
CUDAPATH = /usr/local/cuda
NVCCFLAGS = -I$(CUDAPATH)/include
LFLAGS = -L$(CUDAPATH)/lib64 -lcuda -lcudart -lm
VectorAdd:
$(NVCC) $(NVCCFLAGS) $(LFLAGS) -o VectorAdd VectorAdd.cu
|
NVCCFLAGS = -I/usr/openwin/include -I$(CUDAPATH)/include
LFLAGS = -L/usr/openwin/lib -L/usr/X11R6/lib -lX11 -L$(CUDAPATH)/lib64 -lcuda -lcudart -lm
LFLAGS = -L/usr/openwin/lib -L/usr/X11R6/lib -lX11 -L$(CUDAPATH)/lib64 -lcuda -lcudart -lm