-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (19 loc) · 866 Bytes
/
Makefile
File metadata and controls
32 lines (19 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
SRC = ./src
INC = ./inc
OBJ = ./obj
CC = nvcc
# card code reference: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/
CFLAGS = -g -std=c++11 -lcuda --gpu-architecture=compute_60 --gpu-code=sm_60
SOURCES := $(wildcard $(SRC)/*.cu)
INCLUDES := $(wildcard $(SRC)/*.cuh)
OBJECTS := $(patsubst $(SRC)/%.cu, $(OBJ)/%.o, $(SOURCES))
MPIFLAGS = -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include -lpthread -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi
all:
nvcc $(CFLAGS) -c src/shapes.cu -dc -lcuda -o obj/shapes.o
nvcc $(CFLAGS) $(MPIFLAGS) -c src/stl_raytracer.cu -dc -lcuda -o obj/stl_raytracer.o
nvcc $(CFLAGS) obj/stl_raytracer.o obj/shapes.o -lm -lcudart $(MPIFLAGS) -o raytracer -I ./src/
.PHONY: clean
# *~ core $(INCDIR)/*~
clean:
rm -f $(OBJ)/*.o
rm raytracer