-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
139 lines (100 loc) · 4.63 KB
/
Copy pathmakefile
File metadata and controls
139 lines (100 loc) · 4.63 KB
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
48
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
77
78
79
80
81
82
83
84
85
86
87
88
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
##############################################################################
################################ makefile ####################################
##############################################################################
# #
# makefile of test (for UCBlock) #
# #
# Antonio Frangioni #
# Dipartimento di Informatica #
# Universita' di Pisa #
# #
##############################################################################
# module name
NAME = UCBlock_test
# basic directory
DIR = .
# common stuff
include ../makefile_common
# define & include the necessary modules- - - - - - - - - - - - - - - - - - -
# if a module is not used in the current configuration, just comment out the
# corresponding include line
# each module outputs some macros to be used here:
# *OBJ is the final object(s) / library
# *LIB is the external libraries + -L< libdirs >
# *H is the list of all include files
# *INC is the -I< include directories >
# define input macros for SMS++ complete makefile, then include it
SMS++SDR = ../../SMS++
include $(SMS++SDR)/lib/makefile-c
# BundleSolver
BNDSLVSDR = ../../BundleSolver
include $(BNDSLVSDR)/makefile-s
# LagrangianDualSolver
LgDSLVSDR = ../../LagrangianDualSolver
include $(LgDSLVSDR)/makefile
# BranchAndXSolver
BAXSLVSDR = ../../BranchAndXSolver
include $(BAXSLVSDR)/makefile
# not necessary, BundleSolver does that already
# MILPSolver
#MILPSSDR = ../../MILPSolver
#include $(MILPSSDR)/makefile-c
# define input macros for UCBlock makefile, then include it
UCBckDIR = ../../UCBlock
include $(UCBckDIR)/lib/makefile
# FrankWolfeSolver, for the Frank-Wolfe tester only ("make fw"); its objects
# are not in MOBJ, so the tester of the Block does not link it
FWSlvSDR = ../../FrankWolfeSolver
include $(FWSlvSDR)/makefile-s
# main module (linking phase) - - - - - - - - - - - - - - - - - - - - - - - -
# object files
MOBJ = $(BNDSLVOBJ) $(LgDSLVOBJ) $(BAXSLVOBJ) $(UCBckOBJ) $(SMS++OBJ) $(CMMNUOBJ)
# libraries
MLIB = $(SMS++LIB) $(BNDSLVLIB) $(LgDSLVLIB) $(BAXSLVLIB) $(UCBckLIB)
$(DIR)/$(NAME): $(MOBJ) $(DIR)/test.o
$(CC) -o $(DIR)/$(NAME) $^ $(MLIB) $(SW)
# dependencies: every .o from its .cpp + every recursively included .h- - - -
# include directives
MINC = $(SMS++INC) $(BNDSLVINC) $(LgDSLVINC) $(BAXSLVINC) $(UCBckINC) $(CMMNUINC)
# includes
MH = $(SMS++H) $(BNDSLVH) $(LgDSLVH) $(BAXSLVH) $(UCBckH) $(CMMNUH)
# compile command
$(DIR)/test.o: $(DIR)/test.cpp $(MH)
$(CC) -c $(DIR)/test.cpp -o $@ $(MINC) $(SW)
# the dynamic programming solver of the unit against a :MILPSolver- - - - - -
tudps: SW = $(SW_RELEASE)
tudps: $(DIR)/TUDPS_test
$(DIR)/TUDPS_test: $(MOBJ) $(DIR)/test_tudps.o
$(CC) -o $@ $(DIR)/test_tudps.o $(MOBJ) $(MLIB) $(SW)
$(DIR)/test_tudps.o: $(DIR)/test_tudps.cpp $(MH)
$(CC) -c $(DIR)/test_tudps.cpp -o $@ $(MINC) $(SW)
# the generator of the scenarios of this Block- - - - - - - - - - - - - - - -
# it reads a unit commitment instance and writes both the scenario set and the
# TwoStageStochasticBlock that the battery of the reduction then solves; the
# StochasticBlock module is only linked by it
StcBlkSDR = ../../StochasticBlock
include $(StcBlkSDR)/makefile
scenarios: SW = $(SW_RELEASE)
scenarios: $(DIR)/UCScenarioGenerator
$(DIR)/UCScenarioGenerator: $(MOBJ) $(StcBlkOBJ) $(DIR)/UCScenarioGenerator.o
$(CC) -o $@ $(DIR)/UCScenarioGenerator.o $(MOBJ) $(StcBlkOBJ) $(MLIB) \
$(StcBlkLIB) $(SW)
$(DIR)/UCScenarioGenerator.o: $(DIR)/UCScenarioGenerator.cpp $(MH) $(StcBlkH)
$(CC) -c $(DIR)/UCScenarioGenerator.cpp -o $@ $(MINC) $(StcBlkINC) $(SW)
.PHONY: scenarios
clean::
rm -f $(DIR)/UCScenarioGenerator
# the Frank-Wolfe decomposition on this Block- - - - - - - - - - - - - - - - -
# the generic tester lives in the root of the suites, since the leaf Block it
# reads is whichever one the -fw configurations name
fw: SW = $(SW_RELEASE)
fw: $(DIR)/UCBlock_FW_test
$(DIR)/UCBlock_FW_test: $(MOBJ) $(FWSlvOBJ) $(DIR)/fw_test.o
$(CC) -o $@ $(DIR)/fw_test.o $(MOBJ) $(FWSlvOBJ) $(MLIB) $(FWSlvLIB) \
$(SW)
$(DIR)/fw_test.o: ../fw_test.cpp $(MH) $(FWSlvH)
$(CC) -c ../fw_test.cpp -o $@ $(MINC) $(FWSlvINC) $(SW)
.PHONY: tudps fw
clean::
rm -f $(DIR)/TUDPS_test $(DIR)/UCBlock_FW_test
############################ End of makefile #################################