-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile.bluewaters.gnu
68 lines (54 loc) · 2.35 KB
/
Makefile.bluewaters.gnu
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
##
# @section LICENSE
# Copyright (c) 2013-2016, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are pe
# rmitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials pr
# ovided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXP
# RESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERC
# HANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CO
# PYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, E
# XEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTIT
# UTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER C
# AUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INC
# LUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
##
CUDA_HOME = $(subst bin/nvcc,,$(shell which nvcc))
CC = cc
CFLAGS = -O3 -g
GFLAGS = $(CUDA_HOME)bin/nvcc -use_fast_math -arch=sm_35
INCDIR = -I$(CUDA_HOME)include
OBJECTS = command.o pmcl3d.o grid.o source.o mesh.o cerjan.o swap.o kernel.o io.o
LIB = -lm -ldl -L$(CUDA_HOME)lib64 -lcudart -lstdc++
pmcl3d: $(OBJECTS)
$(CC) $(CFLAGS) $(INCDIR) -o pmcl3d $(OBJECTS) $(LIB)
pmcl3d.o: pmcl3d.c
$(CC) $(CFLAGS) $(INCDIR) -c -o pmcl3d.o pmcl3d.c
command.o: command.c
$(CC) $(CFLAGS) $(INCDIR) -c -o command.o command.c
io.o: io.c
$(CC) $(CFLAGS) $(INCDIR) -c -o io.o io.c
grid.o: grid.c
$(CC) $(CFLAGS) $(INCDIR) -c -o grid.o grid.c
source.o: source.c
$(CC) $(CFLAGS) $(INCDIR) -c -o source.o source.c
mesh.o: mesh.c
$(CC) $(CFLAGS) $(INCDIR) -c -o mesh.o mesh.c
cerjan.o: cerjan.c
$(CC) $(CFLAGS) $(INCDIR) -c -o cerjan.o cerjan.c
swap.o: swap.c
$(CC) $(CFLAGS) $(INCDIR) -c -o swap.o swap.c
kernel.o: kernel.cu
$(GFLAGS) $(INCDIR) -c -o kernel.o kernel.cu
clean:
rm -f *.o pmcl3d