Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CC := gcc
CFLAGS := -std=c++11 -c -Wall
NVCC := /usr/local/cuda/bin/nvcc
NVCCGENCODEFLAGS := -arch=compute_30 -code=sm_30,compute_30
NVCCFLAGS := $(NVCCGENCODEFLAGS) -c
NVCCLINKFLAGS := $(NVCCGENCODEFLAGS) -o
CUDAPATH := /usr/local/cuda
CUDALIBPATH := -L$(CUDAPATH)/lib64
LIBPATH := -L/usr/lib -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu
GLPATH := /usr/include
LIBS := -lGLEW -lglfw3 -lGL -lGLU -lcuda -lcudart
INCLUDES := -I$(CUDAPATH)/include -I$(GLPATH)
all: CUDANN
CUDANN: Main.o Display.o FileUtil.o Timer.o NeuralNetwork.o
$(NVCC) $(NVCCLINKFLAGS) $(CUDANN) Main.o Display.o FileUtil.o Timer.o NeuralNetwork.o $(LIBPATH) $(CUDALIBPATH) $(LIBS)
Main.o: Main.cpp
$(CC) $(CFLAGS) $(INCLUDES) Main.cpp
Display.o: Display.cpp
$(CC) $(CFLAGS) $(INCLUDES) Display.cpp
FileUtil.o: FileUtil.cpp
$(CC) $(CFLAGS) $(INCLUDES) FileUtil.cpp
Timer.o: Timer.cpp
$(CC) $(CFLAGS) $(INCLUDES) Timer.cpp
NeuralNetwork.o: NeuralNetwork.cu
$(BIN)/$(NVCC) $(NVCCFLAGS) $(INCLUDES) NeuralNetwork.cu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment