-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
42 lines (31 loc) · 1021 Bytes
/
makefile
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
33
34
35
36
37
38
39
40
41
42
#find MPI path
MPIC++ = $(shell which mpiCC)
MPI_ROOT = $(dir $(MPIC++))
CC = mpicc
NVCC = nvcc
CFLAGS =
#NVFLAGS = -Xcompiler -O2 -lm -arch=sm_20
NVFLAGS = -gencode=arch=compute_13,code=\"sm_13,compute_13\" -c -O3 \
-I$(MPI_ROOT)/../include
NVLIBS = -L/usr/local/cuda/lib64 -lcudart -lcuda
GCC=gcc
GCCFLAGS=-g -Wall -std=c99
EXEC=rtt
DEPS=my_mpi.h sockettome.h
SOURCES=myrtt.c my_mpi.c sockettome.c
OBJECTS=$(SOURCES:.c=.o)
all: interp_gpu interp_serial $(SOURCES) $(EXEC)
clean:
rm -f interp interp_gpu.o $(OBJECTS) interp_serial interp_serial.o
interp_gpu.o: interp_gpu.cu
$(NVCC) $(NVFLAGS) -c interp_gpu.cu interp_gpu.o
interp_gpu: interp_gpu.o
$(CC) $(NVLIBS) -o interp_gpu interp_gpu.o
%.o: %.c $(DEPS)
$(GCC) $(GCCFLAGS) -c -o $@ $<
interp_serial.o: interp_serial.c
$(GCC) $(GCCFLAGS) -c interp_serial.c -o interp_serial.o
interp_serial: interp_serial.o
$(GCC) $(GCCFLAGS) interp_serial.o -o interp_serial
$(EXEC): $(OBJECTS)
$(GCC) $(OBJECTS) -o $@