Blame view

Makefile 3.94 KB
97e7c58b   Salvador Abreu   move benchmark so...
1
SRC = src
ec6f4ebc   Salvador Abreu   Include fz/exampl...
2
VPATH = $(SRC):bench
965dadaa   Salvador Abreu   initial commit fr...
3
4
5
6
7
8
9
10
11
12
13

ARCH = $(shell uname -s)

ifeq ($(ARCH), SunOS)
  CC = cc
  CFLAGS = -g -m64 -xc99
else
  CC = gcc
  CFLAGS = -ggdb3 -O3 # -std=c99 -Wall
endif

97e7c58b   Salvador Abreu   move benchmark so...
14
CPPFLAGS = -I$(SRC) $(ALL_DEFINES)
965dadaa   Salvador Abreu   initial commit fr...
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

# -DFILTER_DOMAINS	perform an initial filtering on the domains
# -DCOMPACT_DOMAINS	use a bitmapped representation of domains
# -DINLINE_DOMAINS	bitmapped domains accessed directly
# -DUSE_VALUE		maintain a field with the value of the variable
# -DUSE_STORE		keep all domains in a compact store
# -DPACK_PROBLEM	use a compact (quasi-relocatable) problem definition
# -DREVISION_IS_VAR	revisions only contain the variable to revise against
# -DORDER_REVISIONS	order the revisions list(s)
#   -DCOUNT_REVISIONS	count and report number of revisions performed
#   -DDEBUG_REVISION	debug the insertion of revisions in their list(s)
# -DDEBUG_SEARCH	applies to all exhaustive searches
# -DDEBUG_VALUE		debug operations on values (domains)

# -DDISTRIBUTED_SOLVER	use one of the parallel/distributed algorithms
#   -DSPLITGO		simultaneous DFSs on disjoint parts of the domain
#			without backtracking
#   -DSPLITGO_MPI	distributed split&go
#     -DBIG		distributed split&go with neighbourhoods (UNAVAILABLE)

EXTRA_DEFINES =

eef94371   Vasco Pedro   Update to PaCCS v...
37
38
DEFINES = -DFAST # -DNDEBUG
DEFAULTS = -DREVISION_IS_VAR -DGROWABLE_POOL -DINDEX_IN_POOL -DSTORE_IN_POOL \
965dadaa   Salvador Abreu   initial commit fr...
39
	   -DNEW_ENTRANCE -DRANDOM_VICTIM -DDOMAIN_BOUNDS
eef94371   Vasco Pedro   Update to PaCCS v...
40
41
REQUIRED = -DDISTRIBUTED_SOLVER -DSPLITGO -DCOMPACT_DOMAINS -DCONSTRAINT_CLASS \
	   -DUSE_STORE -DPACK_PROBLEM
965dadaa   Salvador Abreu   initial commit fr...
42
43
44
45
46

ALL_DEFINES = $(REQUIRED) $(DEFAULTS) $(DEFINES) $(EXTRA_DEFINES)

# imbed version and svn's revision into the code
ifeq ($(VERSION),)
97e7c58b   Salvador Abreu   move benchmark so...
47
48
  ifneq ($(wildcard $(SRC)/VERSION), )
    VERSION = $(shell cat $(SRC)/VERSION)
965dadaa   Salvador Abreu   initial commit fr...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  else
    $(error could not determine code version (VERSION not set))
  endif
endif
override CPPFLAGS += -DVERSION="\"paccs $(VERSION)\""

FDC_FILES = util.c variables.c problem.c revisions.c options.c bound.c \
	    packed.c store.c misc.c $(FDC_OBJS)

FDC_OBJS = constraints.o list.o values.o

.INTERMEDIATE: constraints.o values.o

ifeq ($(filter -DUSE_MATCHING, $(ALL_DEFINES)), -DUSE_MATCHING)
  FDC_FILES += matching.c
endif

DFDC_FILES = dsearch-sg.c splitting.c variables2.c

AGENTS_C = agents-splitgo.c

ifeq ($(findstring -DBIG, $(DEFINES) $(EXTRA_DEFINES)), -DBIG)
  MPI_AGENTS_C = agents-splitgo-mpi-big.c
else
  MPI_AGENTS_C = agents-splitgo-mpi.c
endif


ec6f4ebc   Salvador Abreu   Include fz/exampl...
77
78
79
80
FDC_SRCS = $(subst bench/,,$(wildcard bench/*.c))
FDC_NAMES = $(subst .c,,$(FDC_SRCS))
FDC_BINS = $(FDC_NAMES) x

cb777d8b   Salvador Abreu   targets now autom...
81
82
DFDC_BINS = $(FDC_BINS:=-mpi)

965dadaa   Salvador Abreu   initial commit fr...
83
84
85
86
87

none:
	@echo "choose one from: $(FDC_NAMES) ..."


cb777d8b   Salvador Abreu   targets now autom...
88
$(FDC_BINS) : $(FDC_FILES) $(DFDC_FILES) $(AGENTS_C)
965dadaa   Salvador Abreu   initial commit fr...
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

$(FDC_BINS) : override DEFAULTS += -DSTEAL_WORK=1
$(FDC_BINS) : override AGENTS_C = agents-splitgo.c
$(FDC_BINS) : override CFLAGS += -pthread


%-mpi: override AGENTS_C = agents-splitgo-mpi.c
%-mpi: override DEFINES += -DSPLITGO_MPI
%-mpi: override DEFAULTS += -DSTEAL_WORK=2
%-mpi: override CC = mpicc
%-mpi: LDLIBS = -lrt

%-mpi: %.c $(FDC_FILES) $(DFDC_FILES) $(MPI_AGENTS_C)
	$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@


ifeq ($(DEBUG), 1)
  CFLAGS := -g $(CFLAGS)
  CPPFLAGS := -DDEBUG_VALUE -DDEBUG_REVISION -DDEBUG_SEARCH $(CPPFLAGS)
endif


constraints.o: fdc_int.h constraints.h
constraints.o: $(SRC)/constraints/*.c

list.o: $(SRC)/list.c $(SRC)/list.h
97e7c58b   Salvador Abreu   move benchmark so...
115

965dadaa   Salvador Abreu   initial commit fr...
116
values.o: values.h values-bitmap.c values-intervals.c fdc_int.h
97e7c58b   Salvador Abreu   move benchmark so...
117

965dadaa   Salvador Abreu   initial commit fr...
118
119
120
121

costas costas-mpi : override DEFAULTS += -DCONSTRAINT_TEMPS

qap qap-mpi : override DEFAULTS += \
eef94371   Vasco Pedro   Update to PaCCS v...
122
123
  -DDOMAIN_BITS=256 -DCONSTRAINT_TEMPS -DQAP_MODEL_B

965dadaa   Salvador Abreu   initial commit fr...
124
125
126
127
128
129
130
131
132
133
134
135
magic-square magic-square-mpi : override DEFAULTS += -DCONSTRAINT_TEMPS

graphs graphs-mpi : override DEFAULTS += -DUSE_MATCHING -DCONSTRAINT_TEMPS
graphs graphs-mpi : matching.c

partition partition-mpi : override DEFAULTS += -DCONSTRAINT_TEMPS

golomb golomb-mpi : override DEFAULTS += -DDOMAIN_BOUNDS

langford langford-mpi : override DEFAULTS += \
  -UDOMAIN_BOUNDS -DINLINE_DOMAINS -DCONSTRAINT_TEMPS -DDISABLE_ENTAILED

eef94371   Vasco Pedro   Update to PaCCS v...
136

965dadaa   Salvador Abreu   initial commit fr...
137
138
139
140
141
clean:
	rm -f $(FDC_OBJS) $(FDC_BINS) $(DFDC_BINS)

fresh:
	rm -f constraints.o values.o