1 # chemin des librairies
6 PATH_LIB = $(PATH_GCC)/lib/
7 PATH_SRC = $(PATH_GCC)/src/
8 PATH_EXEC = $(PATH_GCC)/exec/
10 # repertoires pour les headers
11 PATH_INCLUDE = $(PATH_GCC)/src/
15 NVCC = nvcc #/usr/local/cuda/bin/nvcc
18 # options de compilation
20 # -g : debug (ex : gdb sas)
21 # -pg : profile memoire et cpu pour chaque fonctions (ex : gprof name | less)
22 # -O3 : optimisation code -O0 (rien) ~ -O3 (maxi)
23 # -fstrict-aliasing : aligne la memoire sur 32 bits
26 OPTION_CC1 = -Wall -O3 -static #-pg #-g -fprofile-arcs -ftest-coverage
27 OPTION_CC2 = $(OPTION_CC1) -funroll-all-loops -fstrict-aliasing
29 OPTION_CC = $(OPTION_CC2) -I$(PATH_INCLUDE) -I$(PATH_SRC)
32 # librairies pour la compilation
34 LIBSNV = -L/cm/shared/apps/cuda31/toolkit/3.1/lib64/ -lcuda -lcudart
35 #LIBSNV = -L/usr/local/cuda/lib64 -lcuda -lcudart
37 # sources utiles a la compilation des main
38 SRCS = lib_alloc.c lib_images.c lib_math.c lib_snake_common.c lib_contour.c
40 SRCS_NV = lib_test_gpu.cu lib_snake_2_gpu.cu lib_gpu.cu snake2D_gpu.cu
42 OBJS = $(SRCS:%.c=$(PATH_LIB)%.o) $(SRCS_NV:%.cu=$(PATH_LIB)%.o)
44 # dependances supplementaires
45 DEPS = $(PATH_SRC)/constantes.h $(PATH_SRC)/structures.h $(PATH_GCC)/makefile
47 @echo "cibles : snake2D doc clean"
52 -rm -rf $(PATH_GCC)/docs/
58 $(PATH_LIB)%_gpu.o : $(PATH_SRC)%_gpu.cu
59 $(NVCC) -arch=sm_13 --use_fast_math -c $< -o $@
61 $(PATH_LIB)%.o : $(PATH_SRC)%.c $(DEPS)
62 $(CC) $(OPTION_CC) -c $< -o $@
66 $(PATH_EXEC)SNAKE2D : $(PATH_SRC)snake2D_gpu.cu $(OBJS) $(DEPS)
67 $(CXX) $(OBJS) $(LIBSNV) \
68 -o $(PATH_EXEC)SNAKE2D
72 snake2D : $(PATH_EXEC)SNAKE2D
74 @echo "***** fin compil snake2D *****"
82 @echo "***** fin compil doc *****"