-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
57 lines (41 loc) · 1.12 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
# makefile
CPPSRC=ham.cpp\
ham2D.cpp\
hamsparse.cpp\
hamsparse2D_CSR.cpp\
hamsparse2D.cpp\
bare-ham.cpp\
ham-mom.cpp\
nonp-ham.cpp\
helpers.cpp\
ham-spin.cpp\
SparseMatrix_CCS.cpp\
CUDASRC=
OBJ=$(CPPSRC:.cpp=.o) $(CUDASRC:.cu=.o)
EXE=main
CC=gcc
CXX=g++
CFLAGS=-g -Wall -O2 -march=native -std=c++11 -Wno-sign-compare -fopenmp # -DNDEBUG
CPPFLAGS=$(CFLAGS)
LDFLAGS=-g -O2 -Wall -march=native -fopenmp
NVFLAGS=-g -O2 --ptxas-options=-v -arch=sm_13
INCLUDE=
LIBS=-lblas -llapack -larpack -lhdf5
%.o: %.c
$(CC) -c $(CFLAGS) $(INCLUDE) $(@:.o=.c) -o $@
%.o: %.cpp
$(CXX) -c $(CPPFLAGS) $(INCLUDE) $(@:.o=.cpp) -o $@
%.o: %.cu
nvcc -c $(NVFLAGS) $(INCLUDE) $(@:.o=.cu) -o $@
# nvcc -cuda $(NVFLAGS) $(INCLUDE) $(@:.o=.cu) -o $(@:.o=.cu.ii)
# $(CXX) -c $(CPPFLAGS) $(INCLUDE) $(@:.o=.cu.ii) -o $@
all: main main2D
main2D: $(OBJ) main2D.o
$(CXX) $(LDFLAGS) -o main2D $(OBJ) main2D.o $(LIBS)
main: $(OBJ) main.o
$(CXX) $(LDFLAGS) -o main $(OBJ) main.o $(LIBS)
doc: $(CPPSRC) doc-config
doxygen doc-config
.PHONY: clean
clean:
rm -f $(OBJ) main.o main2D.o