-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
100 lines (86 loc) · 5.2 KB
/
Copy pathmakefile
File metadata and controls
100 lines (86 loc) · 5.2 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
##############################################################################
################################ makefile ####################################
##############################################################################
# #
# makefile of SDDPBlock #
# #
# Note that $(SMS++INC) is assumed to include any -I directive #
# corresponding to external libraries needed by SMS++, at least to the #
# extent in which they are needed by the parts of SMS++ used by SDDPBlock. #
# #
# Input: $(CC) = compiler command #
# $(SW) = compiler options #
# $(SMS++INC) = the -I$( core SMS++ directory ) #
# $(SMS++OBJ) = the libSMS++ library itself #
# $(StcBlkH) = the .h files to include for StochasticBlock #
# $(StcBlkINC) = the -I$( StochasticBlock source directory ) #
# $(libStOptINC) = the -I$(include directories) for libStOpt #
# $(SDDPBkSDR) = the directory where the source is #
# #
# Output: $(SDDPBkOBJ) = the final object(s) / library #
# $(SDDPBkH) = the .h files to include #
# $(SDDPBkINC) = the -I$( source directory ) #
# #
# Antonio Frangioni #
# Dipartimento di Informatica #
# Universita' di Pisa #
# #
##############################################################################
# macros to be exported - - - - - - - - - - - - - - - - - - - - - - - - - - -
SDDPBkOBJ = $(SDDPBkSDR)/obj/SDDPBlock.o $(SDDPBkSDR)/obj/SDDPSolver.o \
$(SDDPBkSDR)/obj/SDDPGreedySolver.o \
$(SDDPBkSDR)/obj/ParallelSDDPSolver.o \
$(SDDPBkSDR)/obj/CutProcessing.o
# note: USE_MPI mirrors the (default ON) CMake option of the same name: StOpt
# is built with MPI, so whoever drives an SDDP solve must initialize MPI.
# -fopenmp mirrors the OpenMP::OpenMP_CXX PUBLIC link of the CMake build: the
# StOpt SDDP drivers are header-only templates, hence they parallelize (and
# the omp critical sections of ParallelSDDPSolver exist at all) only if the
# code that includes them is compiled with OpenMP enabled
SDDPBkINC = -I$(SDDPBkSDR)/include -DUSE_MPI -fopenmp
SDDPBkH = $(SDDPBkSDR)/include/SDDPBlock.h \
$(SDDPBkSDR)/include/ScenarioSet.h \
$(SDDPBkSDR)/include/ScenarioSimulator.h \
$(SDDPBkSDR)/include/SDDPSolver.h \
$(SDDPBkSDR)/include/SDDPGreedySolver.h \
$(SDDPBkSDR)/include/ParallelSDDPSolver.h \
$(SDDPBkSDR)/include/CutProcessing.h
# clean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clean::
rm -f $(SDDPBkOBJ) $(MILPBSDR)/*~
# dependencies: every .o from its .cpp + every recursively included .h- - - -
$(SDDPBkSDR)/obj/SDDPBlock.o: $(SDDPBkSDR)/src/SDDPBlock.cpp \
$(SDDPBkSDR)/include/SDDPBlock.h \
$(SDDPBkSDR)/include/ScenarioSet.h \
$(SDDPBkSDR)/include/ScenarioSimulator.h $(StcBlkH) $(SMS++OBJ)
$(CC) -c $(SDDPBkSDR)/src/SDDPBlock.cpp -o $@ $(SDDPBkINC) \
$(StcBlkINC) $(SMS++INC) $(SW)
$(SDDPBkSDR)/obj/SDDPSolver.o: $(SDDPBkSDR)/src/SDDPSolver.cpp \
$(SDDPBkSDR)/include/SDDPSolver.h $(SDDPBkSDR)/include/SDDPBlock.h \
$(SDDPBkSDR)/include/ScenarioSet.h \
$(SDDPBkSDR)/include/ScenarioSimulator.h $(StcBlkH) $(SMS++OBJ)
$(CC) -c $(SDDPBkSDR)/src/SDDPSolver.cpp -o $@ $(SDDPBkINC) \
$(StcBlkINC) $(libStOptINC) $(SMS++INC) $(SW)
$(SDDPBkSDR)/obj/SDDPGreedySolver.o: $(SDDPBkSDR)/src/SDDPGreedySolver.cpp \
$(SDDPBkSDR)/include/SDDPGreedySolver.h \
$(SDDPBkSDR)/include/SDDPBlock.h \
$(SDDPBkSDR)/include/ScenarioSet.h \
$(SDDPBkSDR)/include/ScenarioSimulator.h $(StcBlkH) $(SMS++OBJ)
$(CC) -c $(SDDPBkSDR)/src/SDDPGreedySolver.cpp -o $@ $(SDDPBkINC) \
$(StcBlkINC) $(SMS++INC) $(SW)
$(SDDPBkSDR)/obj/ParallelSDDPSolver.o: \
$(SDDPBkSDR)/src/ParallelSDDPSolver.cpp \
$(SDDPBkSDR)/include/ParallelSDDPSolver.h \
$(SDDPBkSDR)/include/SDDPSolver.h $(SDDPBkSDR)/include/SDDPBlock.h \
$(SDDPBkSDR)/include/ScenarioSet.h \
$(SDDPBkSDR)/include/ScenarioSimulator.h $(StcBlkH) $(SMS++OBJ)
$(CC) -c $(SDDPBkSDR)/src/ParallelSDDPSolver.cpp -o $@ $(SDDPBkINC) \
$(StcBlkINC) $(libStOptINC) $(SMS++INC) $(SW)
$(SDDPBkSDR)/obj/CutProcessing.o: $(SDDPBkSDR)/src/CutProcessing.cpp \
$(SDDPBkSDR)/include/CutProcessing.h \
$(SDDPBkSDR)/include/SDDPBlock.h \
$(SDDPBkSDR)/include/ScenarioSet.h \
$(SDDPBkSDR)/include/ScenarioSimulator.h $(StcBlkH) $(SMS++OBJ)
$(CC) -c $(SDDPBkSDR)/src/CutProcessing.cpp -o $@ $(SDDPBkINC) \
$(StcBlkINC) $(SMS++INC) $(SW)
########################## End of makefile ###################################