-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
135 lines (101 loc) · 4.24 KB
/
Makefile
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
# System architecture
SYSTEM = x86-64_linux
# Static library format for Cplex
LIBFORMAT = static_pic
# Source code folder
SRC = src
INCLUDE = include
# Machine hostname
MACHINE = $(shell hostname)
# Library type(STATIC or DYNAMIC)
MERGE = DYNAMIC
##### Folders
# Temp folders
TMP_GIRP = ./tmp/GIRP
TMP_STATIC = ./tmp/lib/static
# Perm folders
DAT_DOXYFILE = ./dat/doxyfile
DAT_INSTANCES = ./dat/instances
DAT_LP_MODELS = ./dat/lp_models
DAT_RESULTS = ./dat/results
# Cplex directory
CPLEXDIR = /opt/ibm/ILOG/CPLEX_Studio1261/cplex
# Concert directory
CONCERTDIR = /opt/ibm/ILOG/CPLEX_Studio1261/concert
# Boost directory
BOOST_ROOT = /opt/boost
# Compiler
CCC = g++-4.8
# Compilation parameters (Add afterward: --coverage -pg -ftree-vectorize -mfpmath=sse -march=native)
CCOPT = -std=gnu++0x -O3 -ftree-vectorize -mfpmath=sse -march=native -march=native -flto -g -m64 -fPIC -fexceptions -DNDEBUG -DIL_STD
# Cplex static libraries directory
CPLEXLIBDIR = $(CPLEXDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
# Concert static libraries directory
CONCERTLIBDIR = $(CONCERTDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
# Include libraries identifiers
CCLNFLAGS = -L$(CPLEXLIBDIR) -lilocplex -lcplex -L$(CONCERTLIBDIR) -lconcert -lm -pthread
# Cplex header's directory
CPLEXINCDIR = $(CPLEXDIR)/include
# Concert header's directory
CONCERTINCDIR = $(CONCERTDIR)/include
# Header's include path
CCFLAGS = $(CCOPT) -I$(CPLEXINCDIR) -I$(CONCERTINCDIR) -I$(BOOST_ROOT)
# Executable name
CPP_EX = UrApHMP
# Compiling
all:
mkdir -p $(TMP_GIRP)
mkdir -p $(TMP_STATIC)
mkdir -p $(DAT_DOXYFILE)
mkdir -p $(DAT_INSTANCES)
mkdir -p $(DAT_LP_MODELS)
mkdir -p $(DAT_RESULTS)
make -j8 $(CPP_EX);
# Executing
execute: $(CPP_EX)
./$(CPP_EX)
# Cleaning
clean:
# /bin/rm -rf $(CPP_EX)
/bin/rm -rf ./tmp
/bin/rm -rf ./dat
########################## FRAMEWORK OBJECT's ######################################################
# CONFIG
# $(TMP_GIRP)/FWConfig.o: $(SRC)/framework/config/FWConfig.cpp $(SRC)/framework/config/FWConfig.h
# $(CCC) -c $(CCFLAGS) $(SRC)/framework/config/FWConfig.cpp -o $(TMP_GIRP)/FWConfig.o
# $(TMP_GIRP)/FWManager.o: $(SRC)/framework/config/FWManager.cpp $(SRC)/framework/config/FWManager.h
# $(CCC) -c $(CCFLAGS) $(SRC)/framework/config/FWManager.cpp -o $(TMP_GIRP)/FWManager.o
########################## GENERATING OBJECT's ######################################################
# CONFIGURATION - INSTANCES
$(TMP_GIRP)/UrApHMP.o: $(SRC)/UrApHMP.cpp $(INCLUDE)/UrApHMP.h
$(CCC) -c $(CCFLAGS) $(SRC)/UrApHMP.cpp -o $(TMP_GIRP)/UrApHMP.o
# STRUCTURE - SOLUTION
$(TMP_GIRP)/solution.o: $(SRC)/solution.cpp $(INCLUDE)/solution.h
$(CCC) -c $(CCFLAGS) $(SRC)/solution.cpp -o $(TMP_GIRP)/solution.o
# STRUCTURE - CHRONO
$(TMP_GIRP)/FWChrono.o: $(SRC)/FWChrono.cpp $(INCLUDE)/FWChrono.h
$(CCC) -c $(CCFLAGS) $(SRC)/FWChrono.cpp -o $(TMP_GIRP)/FWChrono.o
# EXACT
$(TMP_GIRP)/model.o: $(SRC)/model.cpp $(INCLUDE)/model.h
$(CCC) -c $(CCFLAGS) $(SRC)/model.cpp -o $(TMP_GIRP)/model.o
$(TMP_GIRP)/model2.o: $(SRC)/model2.cpp $(INCLUDE)/model2.h
$(CCC) -c $(CCFLAGS) $(SRC)/model2.cpp -o $(TMP_GIRP)/model2.o
$(TMP_GIRP)/solver.o: $(SRC)/solver.cpp $(INCLUDE)/solver.h
$(CCC) -c $(CCFLAGS) $(SRC)/solver.cpp -o $(TMP_GIRP)/solver.o
# MAIN
$(TMP_GIRP)/main.o: $(SRC)/main.cpp
$(CCC) -c $(CCFLAGS) $(SRC)/main.cpp -o $(TMP_GIRP)/main.o
########################## OBJECT's LIBRARIES #######################################################
# CONFIGURATION
$(TMP_GIRP)/Configuration.o: $(TMP_GIRP)/UrApHMP.o
gcc -Wl,-r $(TMP_GIRP)/UrApHMP.o -o $(TMP_GIRP)/Configuration.o -nostdlib
# STRUCTURE
$(TMP_GIRP)/Structure.o: $(TMP_GIRP)/solution.o $(TMP_GIRP)/FWChrono.o
gcc -Wl,-r $(TMP_GIRP)/solution.o $(TMP_GIRP)/FWChrono.o -o $(TMP_GIRP)/Structure.o -nostdlib
# EXACT
$(TMP_GIRP)/Exact.o: $(TMP_GIRP)/model.o $(TMP_GIRP)/model2.o $(TMP_GIRP)/solver.o
gcc -Wl,-r $(TMP_GIRP)/model.o $(TMP_GIRP)/model2.o $(TMP_GIRP)/solver.o -o $(TMP_GIRP)/Exact.o -nostdlib
########################## LINKANDO TUDO ########################################################
$(CPP_EX): $(TMP_GIRP)/Exact.o $(TMP_GIRP)/Configuration.o $(TMP_GIRP)/Structure.o $(TMP_GIRP)/main.o
$(CCC) $(CCFLAGS) $(TMP_GIRP)/Exact.o $(TMP_GIRP)/Configuration.o $(TMP_GIRP)/Structure.o $(TMP_GIRP)/main.o -L$(TMP_STATIC) -o $(CPP_EX) $(CCLNFLAGS)
#endif