-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
73 lines (54 loc) · 1.46 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.DEFAULT: .f .for .c .C .cpp .cc .f90
.SUFFIXES: .f .for .c .C .cpp .cc .f90
O = .
F77 = ifort
F90 = ifort
CC = icc
CCC = icpc
NVCC = nvcc
TYPEDEF = #-DReal=double #-DFLOAT
#TYPEDEF = -DReal=float
NVCCINCLUDE = -I$(CUDA_ROOT)/samples/common/inc
CFLAGS = $(NVCCINCLUDE) $(TYPEDEF)
CFLAGS = $(NVCCINCLUDE) $(TYPEDEF)
FFLAGS = $(TYPEDEF)
NVCCFLAGS = -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_37,code=sm_37 -use_fast_math -O3 \
$(NVCCINCLUDE) $(TYPEDEF) -Xcompiler=\"-fPIC -pthread -fexceptions -m64\"
Link = $(CCC) $(CFLAGS)
LIBS = -L$(CUDA_LIB) -lcudart -lifcore
EXENAME = t1
OBJS = $(O)/main.o $(O)/pi.o $(O)/pi-omp.o $(O)/mainF.o \
$(O)/gpuprop.o $(O)/gpuinfo.o
$(EXENAME) : $(OBJS)
$(Link) -o $(EXENAME) $(OBJS) $(LIBS)
$(O)/%.o: %.c
cd $(O) ; $(CC) $(CFLAGS) -c $<
$(O)/%.o: %.cc
cd $(O) ; $(CCC) $(CFLAGS) -c $<
$(O)/%.o: %.cpp
cd $(O) ; $(CCC) $(CFLAGS) -c $<
$(O)/%.o: %.C
cd $(O) ; $(CCC) $(CFLAGS) -c $<
$(O)/%.o: %.F
cd $(O) ; $(F77) $(FFLAGS) -c $<
$(O)/%.o: %.for
cd $(O) ; $(F77) $(FFLAGS) -c $<
$(O)/%.o: %.f90
cd $(O) ; $(F90) $(FFLAGS) -c $<
$(O)/%.o: %.cu
cd $(O) ; $(NVCC) $(NVCCFLAGS) -c $<
dat:
rm -f *.dat
backup:
rm -f *~
clobber:
rm -f $(EXENAME).exe
clean:
rm -f *.o *.dat *~ *.exe *.exe.* $(EXENAME)
rm -f *.pc *.pcl *.*i *.mod depend *.linkinfo
depend :
g++ $(NVCCINCLUDE) -MM *.[cC] | perl dep.pl > $@
nvcc $(NVCCFLAGS) -M *.cu | perl dep.pl >> $@
include depend