-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
71 lines (53 loc) · 2.91 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
# Copyright (C) 2016 Peter Zaspel
#
# This file is part of hmglib.
#
# hmglib is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# hmglib is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with hmglib. If not, see <http://www.gnu.org/licenses/>.
# set directory for OpenBLAS installation
OPENBLAS_DIR = /users/staff/dmi-dmi/zaspel/opt/openblas
# set directory for Magma installation
MAGMA_DIR= /users/staff/dmi-dmi/zaspel/opt/magma
# set directory for GSL installation
GSL_DIR= /users/staff/dmi-dmi/zaspel/opt/gsl
# set GPU architecture
GPU_ARCH_SETTINGS=--gpu-architecture=sm_61
CFLAGS = -Xcompiler="-fPIC -DADD_" -O3 $(GPU_ARCH_SETTINGS) -DADD_
GSL_LIB = -I$(GSL_DIR)/include -L$(GSL_DIR)/lib -lgsl -lgslcblas -lm
MAGMA_LIB= -L$(MAGMA_DIR)/lib -lmagma -L$(OPENBLAS_DIR)/lib -lopenblas -lcusparse -lcudart -lcudadevrt
MAGMA_INC= -I$(MAGMA_DIR)/include
all: hmglib_test paper_convergence_test paper_benchmark
hmglib_test: hmglib_test.cu libhmglib.so
nvcc $(CFLAGS) $(MAGMA_INC) $(MAGMA_LIB) -L. -lhmglib -lcurand -lcublas device_code.o hmglib_test.cu -o hmglib_test
paper_convergence_test: paper_convergence_test.cu libhmglib.so
nvcc $(CFLAGS) $(GSL_LIB) $(MAGMA_INC) $(MAGMA_LIB) -L. -lhmglib -lcurand -lcublas paper_convergence_test.cu -o paper_convergence_test
paper_benchmark: paper_benchmark.cu libhmglib.so
nvcc $(CFLAGS) $(GSL_LIB) $(MAGMA_INC) $(MAGMA_LIB) -L. -lhmglib -lcurand -lcublas paper_benchmark.cu -o paper_benchmark
morton.o: morton.cu morton.h
nvcc $(CFLAGS) -c morton.cu -o morton.o
linear_algebra.o: linear_algebra.cu linear_algebra.h
nvcc $(CFLAGS) $(MAGMA_INC) -dc linear_algebra.cu -o linear_algebra.o
tree.o: tree.cu tree.h
nvcc $(CFLAGS) -c tree.cu -o tree.o
hmglib.o: hmglib.cu hmglib.h
nvcc $(CFLAGS) $(MAGMA_INC) -dc hmglib.cu -o hmglib.o
helper.o: helper.cu helper.h
nvcc $(CFLAGS) -G -dc helper.cu -o helper.o
libhmglib.so: morton.o tree.o linear_algebra.o hmglib.o helper.o device_code.o kernel_system_assembler.o
nvcc $(CFLAGS) $(MAGMA_LIB) -o libhmglib.so --shared morton.o tree.o linear_algebra.o hmglib.o helper.o kernel_system_assembler.o device_code.o
kernel_system_assembler.o: kernel_system_assembler.h system_assembler.h kernel_system_assembler.cu
nvcc $(CFLAGS) $(MAGMA_INC) -dc kernel_system_assembler.cu -o kernel_system_assembler.o
device_code.o: kernel_system_assembler.o linear_algebra.o hmglib.o helper.o
nvcc $(CFLAGS) $(MAGMA_LIB) -dlink linear_algebra.o hmglib.o helper.o kernel_system_assembler.o -o device_code.o
clean:
rm *.o *.so