Feb 212011
 
#!/bin/make
# Makefile for Cuda
# Version 0.2
# Author: Mark Dwyer (m2.dwyer@qut.edu.au)
 
# Any NVidia specific options are prefixed with NV
 
 
# Where is the cuda toolkit installed?
CUDA = /home/dwyer3/Public/Cuda/3.2/cuda
# Cuda on Lyra : Node: cl1n041
#CUDA = /pkg/suse11/cuda/3.2/cuda
 
# A name for the binary being created
BINARY = Go
 
# What are the source files?
SRC = 
CUSRC = Main.cu
 
 
# For now, go with generic compilers
CC = g++
NV = $(CUDA)/bin/nvcc
 
# Compiler options
OPTS = -O2 
NVOPTS =  
 
# The objects that need to be created (derived from SRC)
OBJS = $(SRC:.cpp=.o)
NVOBJS = $(CUSRC:.cu=.o)
 
# These are combined for now - may need to separate if possible
INC = -I$(CUDA)/include 
LIBS = -L$(CUDA)/lib64 -lcuda -lcudart
 
.SUFFIXES: .cu .o
	.cpp .o
 
.cpp.o:
	$(CC) $(OPTS) $(INC) -c $< -o $@
 
.cu.o:
	$(NV) -c $< -o $@
 
$(BINARY): $(OBJS) $(NVOBJS)
	$(CC) $(OPTS) $(OBJS) $(NVOBJS) -o $(BINARY) $(LIBS)
	@echo Binary created!!
 
clean:
	set nonomatch; rm -f $(BINARY) *.o

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

Human Conf Test * Time limit is exhausted. Please reload CAPTCHA.