-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (33 loc) · 927 Bytes
/
Makefile
File metadata and controls
46 lines (33 loc) · 927 Bytes
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
.SUFFIXES: .cu
CXX := g++
CC := gcc
AR := ar ruv
RANLIB := ranlib
# path to your CUDA installation
CUDAPATH := /usr/local/cuda
CUDAINCLUDE := -I$(CUDAPATH)/include
NVCC := $(CUDAPATH)/bin/nvcc
#use this for Fermi cards
NVCCFLAGS := -arch=sm_20
#use this for GTX280/290/295, or any GT200 architecture with DP support
# NVCCFLAGS := -arch=sm_13
NVCCFLAGS += -O4 -g $(CUDAINCLUDE) -I./ -Xptxas -v,-abi=no
# NVCCFLAGS += -maxrregcount=32
NVCCFLAGS += -Xcompiler="-Wall"
CUDA_LIBS = -L$(CUDAPATH)/lib64 -lcudart
CXXFLAGS += -Wall -g -O4
# LDFLAGS += -fopenmp
LDGPUGLAGS := $(LDFLAGS) $(CUDA_LIBS)
OBJS = grav_force_direct.cu_o
GRAVLIB = libSPHgrav.a
all: $(GRAVLIB)
$(GRAVLIB): $(OBJS)
/bin/rm -f $@
$(AR) $@ $(OBJS)
.cpp.o:
$(CXX) $(CXXFLAGS) -c $< -o $@
%.cu_o: %.cu
$(NVCC) $(NVCCFLAGS) -c $< -o $@
clean:
/bin/rm -rf *.cu_o $(GRAVLIB)
$(GRAVLIB): cutil.h cuVec3.h cuVector.h