forked from ahwkuepper/mcluster
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
47 lines (35 loc) · 1.37 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
IGNORE:
FC = gfortran -O2 #-ffast-math
#FC = gfortran-mp-4.4 -O2 #-ffast-math
#use of -ffast-math may cause problems on some machines
LFLAGS = const_bse.h zdata.h
CC = gcc -O2 -fopenmp -Wall #-ffast-math
#use "-D NOOMP" and remove "-fopenmp" for compilation without OpenMP
#CFLAGS = -L/opt/local/lib/gcc44/ -lgfortran
CFLAGS = -L/usr/lib/ -lgfortran
CUFLAGS= -O3 -D WITH_CUDA5
CUDA_PATH = /usr/local/cuda
SDK_PATH=$(CUDA_PATH)/samples
.f.o:
$(FC) -c $<
SOURCE = \
deltat.f evolv1.f hrdiag.f kick.f mlwind.f mrenv.f \
ran3.f star.f zcnsts.f zfuncs.f\
comenv.f corerd.f dgcore.f evolv2.f gntage.f \
instar.f mix.f rl.f
OBJECTS = $(SOURCE:.f=.o)
mcluster_sse: $(OBJECTS) $(LFLAGS)
$(CC) -c main.c -D SSE -lm
$(CC) $(OBJECTS) main.o -o mcluster_sse -lm $(CFLAGS)
mcluster_ssegpu: $(OBJECTS) $(LFLAGS) gpupot.gpu.o main.c
$(CC) -c main.c -D SSE -D GPU -lm -I$(CUDA_PATH)/include
$(CC) $(OBJECTS) main.o gpupot.gpu.o -o mcluster_gpu -L$(CUDA_PATH)/lib64 -lcudart -lstdc++ -lm $(CFLAGS)
mcluster_gpu: gpupot.gpu.o main.c
$(CC) -c main.c -D GPU -I$(CUDA_PATH)/include
$(CC) main.o gpupot.gpu.o -o mcluster_gpu -L$(CUDA_PATH)/lib64 -lcudart -lstdc++ -lm
mcluster:
$(CC) -o mcluster main.c -lm
gpupot.gpu.o: gpupot.gpu.cu cuda_pointer.h
nvcc -c $(CUFLAGS) -Xcompiler "-fPIC -O3 -Wall" -I$(SDK_PATH)/common/inc -I. gpupot.gpu.cu
clean:
rm -f *.o mcluster_sse mcluster mcluster_gpu