Blame view

Makefile 4.08 KB
97e7c58b   Salvador Abreu   move benchmark so...
1
VPATH = src
ec6f4ebc   Salvador Abreu   Include fz/exampl...
2

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

CPPFLAGS = -I$(VPATH) $(ALL_DEFINES)
97e7c58b   Salvador Abreu   move benchmark so...
14

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 =

DEFINES = -DFAST # -DNDEBUG
eef94371   Vasco Pedro   Update to PaCCS v...
37
38
DEFAULTS = -DREVISION_IS_VAR -DGROWABLE_POOL -DINDEX_IN_POOL -DSTORE_IN_POOL \
	   -DNEW_ENTRANCE -DRANDOM_VICTIM -DDOMAIN_BOUNDS
965dadaa   Salvador Abreu   initial commit fr...
39
REQUIRED = -DDISTRIBUTED_SOLVER -DSPLITGO -DCOMPACT_DOMAINS -DCONSTRAINT_CLASS \
eef94371   Vasco Pedro   Update to PaCCS v...
40
41
	   -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),)
  ifneq ($(wildcard $(VPATH)/VERSION), )
97e7c58b   Salvador Abreu   move benchmark so...
47
48
    VERSION = $(shell cat $(VPATH)/VERSION)
  else
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
    $(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


FDC_BINS = \
ec6f4ebc   Salvador Abreu   Include fz/exampl...
77
78
79
80
	all \
	bibd \
	c-exactly \
	change \
cb777d8b   Salvador Abreu   targets now autom...
81
82
	costas \
	golfers \
965dadaa   Salvador Abreu   initial commit fr...
83
84
85
86
87
	golomb \
	graphs \
	k-queens \
	langford \
	magic-seq \
cb777d8b   Salvador Abreu   targets now autom...
88
	magic-square \
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
	money \
	partition \
	qap \
	queens \
	queens2 \
	sudoku \
	test-setup \
	times \
	trivial \
	x

DFDC_BINS = $(FDC_BINS:=-mpi)


none:
	@echo "choose one from: queens costas golomb langford qap ..."


$(FDC_BINS) : $(FDC_FILES) $(DFDC_FILES) $(AGENTS_C)

$(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
97e7c58b   Salvador Abreu   move benchmark so...
115
%-mpi: override DEFINES += -DSPLITGO_MPI
965dadaa   Salvador Abreu   initial commit fr...
116
%-mpi: override DEFAULTS += -DSTEAL_WORK=2
97e7c58b   Salvador Abreu   move benchmark so...
117
%-mpi: override CC = mpicc
965dadaa   Salvador Abreu   initial commit fr...
118
119
120
121
%-mpi: LDLIBS = -lrt

%-mpi: %.c $(FDC_FILES) $(DFDC_FILES) $(MPI_AGENTS_C)
	$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
eef94371   Vasco Pedro   Update to PaCCS v...
122
123


965dadaa   Salvador Abreu   initial commit fr...
124
125
126
127
128
129
130
131
132
133
134
135
ifeq ($(DEBUG), 1)
  CFLAGS := -g $(CFLAGS)
  CPPFLAGS := -DDEBUG_VALUE -DDEBUG_REVISION -DDEBUG_SEARCH $(CPPFLAGS)
endif


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

list.o: $(VPATH)/list.c $(VPATH)/list.h

values.o: values.h values-bitmap.c values-intervals.c fdc_int.h
eef94371   Vasco Pedro   Update to PaCCS v...
136

965dadaa   Salvador Abreu   initial commit fr...
137
138
139
140
141
142
143
144
145
146

costas costas-mpi : override DEFAULTS += -DCONSTRAINT_TEMPS

qap qap-mpi : override DEFAULTS += \
  -DDOMAIN_BITS=256 -DCONSTRAINT_TEMPS -DQAP_MODEL_B

magic-square magic-square-mpi : override DEFAULTS += -DCONSTRAINT_TEMPS

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