1##############################################################################
2##############################################################################
3#                                                                            #
4# This file is part of the SYMPHONY Branch, Cut, and Price Library.          #
5#                                                                            #
6# SYMPHONY was jointly developed by Ted Ralphs (ted@lehigh.edu) and          #
7# Laci Ladanyi (ladanyi@us.ibm.com).                                         #
8#                                                                            #
9# (c) Copyright 2005-2006 Ted Ralphs. All Rights Reserved.                   #
10#                                                                            #
11# This software is licensed under the Eclipse Public License. Please see     #
12# accompanying file for terms.                                               #
13#                                                                            #
14##############################################################################
15##############################################################################
16
17##############################################################################
18##############################################################################
19#
20# This makefile is for Microsoft Visual C++ usage only! In order to compile
21# this application, simply type the following command:
22#
23# nmake /f sym.mak
24#
25# The executable "symphony.exe" for this application will be created in
26# .\Debug directory. By default, SYMPHONY is set up to use the CLP
27# optimization solver via COIN_OSI's CLP interface and to use the CGL cuts.
28# However, you are free to  specify your own settings for the executable via
29# the following variables.
30# (you can download nmake.exe from  "http://download.microsoft.com/download/
31# vc15/Patch/1.52/W95/EN-US/Nmake15.exe" if you need that.)
32# Note that the options here are for the compiler that comes with MSVC++
33# Version 8. They may not work with earlier versions.
34##############################################################################
35
36##############################################################################
37# The SYMPHONYROOT environment variable specifies the root directory for the
38# source code. If this file is not in the SYMPHONY root directory, change this
39# variable to the correct path.
40##############################################################################
41
42SYMPHONYROOT=..\
43
44##############################################################################
45# COINROOT is the path to the root directory of the COIN libraries. Many of
46# the new features of COIN require the COIN libraries to be installed.
47##############################################################################
48
49COINROOT = ..\..\
50
51##############################################################################
52# OUTDIR variable specifies where to create the executable file,
53# "symphony.exe", the corresponding objects and the dependencies.
54##############################################################################
55
56OUTDIR=.\Debug
57
58##############################################################################
59##############################################################################
60# LP solver dependent definitions
61##############################################################################
62##############################################################################
63
64##############################################################################
65##############################################################################
66#You must define an LP solver in order to use the software. By default, this
67# option is set to OsI_CLP. See the corresponding "LPINCDIR" and "LPLIB"
68# variables used to put the lp solver include files and the libraries on path
69# and make the necessary changes if you require.
70##############################################################################
71##############################################################################
72
73##############################################################################
74# CPLEX definitions
75##############################################################################
76
77# Uncomment the line below if you want to use CPLEX and specify the
78# corresponding paths to the solver files and libraries.
79
80#LP_SOLVER = CPLEX
81!IF "$(LP_SOLVER)" == "CPLEX"
82LPINCDIR = "C:\ILOG\cplex81\include\ilcplex"
83LPLIB = "C:\ILOG\cplex81\lib\msvc6\stat_sta\cplex81.lib"
84!ENDIF
85
86##############################################################################
87# OSL definitions
88##############################################################################
89
90# Uncomment the line below if you want to use OSL and specify the
91# corresponding paths to the solver files and libraries.
92
93#LP_SOLVER = OSL
94!IF "$(LP_SOLVER)" == "OSL"
95LPINCDIR = "C:\Program Files\IbmOslV3Lib\osllib\include"
96LPLIB = "C:\Program Files\IbmOslV3Lib\osllib\lib\oslmd6030.lib"
97!ENDIF
98
99##############################################################################
100# OSI definitions
101##############################################################################
102
103# Uncomment the line below if you want to use OSI interface and specify the
104# corresponding paths to the solver files and libraries.
105
106LP_SOLVER = OSI
107OSI_INTERFACE = CLP
108
109!IF "$(LP_SOLVER)" == "OSI"
110LPINCDIR = \
111	"$(COINROOT)\CoinUtils\src" /I\
112	"$(COINROOT)\Osi\src"
113LPLIB = \
114	"$(COINROOT)\CoinUtils\MSVisualStudio\v8\libCoinUtils\Debug\libCoinUtils.lib" \
115	"$(COINROOT)\Osi\MSVisualStudio\v8\libOsi\Debug\libOsi.lib"
116!ENDIF
117
118
119!IF "$(OSI_INTERFACE)" == "CPLEX"
120LPINCDIR = $(LPINCDIR) /I\
121	"C:\ILOG\cplex81\include\ilcplex" /I\
122	"$(COINROOT)\Osi\src\OsiCpx"
123LPLIB = $(LPLIB) \
124	"C:\ILOG\cplex81\lib\msvc6\stat_sta\cplex81.lib" \
125	"$(COINROOT)\Osi\MSVisualStudio\v8\libOsiCpx\Debug\libOsiCpx.lib"
126!ENDIF
127
128
129!IF "$(OSI_INTERFACE)" == "OSL"
130LPINCDIR = $(LPINCDIR) /I\
131	"C:\Program Files\IbmOslV3Lib\osllib\include" /I\
132	"$(COINROOT)\Osi\src\OsiOsl"
133LPLIB = $(LPLIB) \
134	"C:\Program Files\IbmOslV3Lib\osllib\lib\oslmd6030.lib" \
135        "$(COINROOT)\Osi\MSVisualStudio\v8\libOsiOsl\Debug\libOsiOsl.lib"
136!ENDIF
137
138
139!IF "$(OSI_INTERFACE)" == "CLP"
140LPINCDIR = $(LPINCDIR) /I\
141	"$(COINROOT)\Clp\src" /I\
142	"$(COINROOT)\Osi\src\OsiClp"
143LPLIB = $(LPLIB) \
144	"$(COINROOT)\Clp\MSVisualStudio\v8\libClp\Debug\libClp.lib" \
145	"$(COINROOT)\Osi\MSVisualStudio\v8\libOsiClp\Debug\libOsiClp.lib"
146!ENDIF
147
148!IF "$(OSI_INTERFACE)" == "XPRESS"
149LPINCDIR = $(LPINCDIR) /I\
150	"C:\" /I\
151	"$(COINROOT)\Osi\src\OsiXpr"
152LPLIB = $(LPLIB) \
153	"C:\" \
154	"$(COINROOT)\Osi\MSVisualStudio\v8\libOsiXpr\Debug\libOsiXpr.lib"
155!ENDIF
156
157!IF "$(OSI_INTERFACE)" == "SOPLEX"
158LPINCDIR = $(LPINCDIR) /I\
159	"C:\" /I\
160	"$(COINROOT)\Osi\src\OsiSpx"
161LPLIB = $(LPLIB) \
162	"C:\" \
163	"$(COINROOT)\Osi\MSVisualStudio\v8\libOsiSpx\Debug\libOsiSpx.lib"
164!ENDIF
165
166!IF "$(OSI_INTERFACE)" == "DYLP"
167LPINCDIR = $(LPINCDIR) /I\
168	"C:\" /I\
169	"$(COINROOT)\Osi\src\OsiDylp"
170LPLIB = $(LPLIB) \
171	"C:\" \
172	"$(COINROOT)\Osi\MSVisualStudio\v8\libOsiDylp\Debug\libOsiDylp.lib"
173!ENDIF
174
175
176!IF "$(OSI_INTERFACE)" == "GLPK"
177LPINCDIR = $(LPINCDIR) /I\
178	"C:\GLPK\glpk-4.0\include" /I\
179	"$(COINROOT)\Osi\src\OsiGlpk"
180LPLIB = $(LPLIB) \
181	"C:\GLPK\glpk-4.0\glpk.lib" \
182	"$(COINROOT)\Osi\MSVisualStudio\v8\libOsiGlpk\Debug\libOsiGlpk.lib"
183!ENDIF
184
185
186##############################################################################
187# Besides the above variables, you have to set your environment path to solver
188# specific dynamic libraries if there exists any. For instance, you have to
189# set your path to where "cplex81.dll" is, something like:
190#
191#              "set path = %path%;C:\ILOG\cplex81\bin\msvc6 "
192#
193# if you are using CPLEX 8.1 and Visual C++ 6.
194##############################################################################
195
196##############################################################################
197# SOLVER definition for SYMPHONY
198##############################################################################
199
200!IF "$(LP_SOLVER)" == "OSI"
201DEFINITIONS ="__$(LP_SOLVER)_$(OSI_INTERFACE)__"
202!ELSE
203DEFINITIONS ="__$(LP_SOLVER)__"
204!ENDIF
205
206##############################################################################
207# GLPMPL definitions. The user should set "USE_GLPMPL" variable to "TRUE" and
208# specify the paths for "glpk" files if she wants to read in glpmpl files.
209# Note that, the user has to also set the paths to GLPK packages.
210##############################################################################
211
212USE_GLPMPL = FALSE
213
214!IF "$(USE_GLPMPL)" == "TRUE"
215LPINCDIR = $(LPINCDIR) /I\
216	"C:\GLPK\glpk-4.0\include" /I\
217	"$(COINROOT)\Osi\src\OsiGlpk\include"
218LPLIB = $(LPLIB) \
219	"C:\GLPK\glpk-4.0\glpk.lib" \
220	"$(COINROOT)\Osi\MSVisualStudio\v8\libOsiGlpk\Debug\libOsiGlpk.lib"
221!ENDIF
222
223
224!IF "$(USE_GLPMPL)" == "TRUE"
225DEFINITIONS = $(DEFINITIONS) /D "USE_GLPMPL"
226!ENDIF
227
228##############################################################################
229##############################################################################
230# Generate generic cutting planes. If you are using the OSI interface, you
231# can now add generic cutting planes from the CGL by setting the flag below.
232# Which cutting planes are added can be controlled by SYMPHONY parameters (see
233# the user's manual
234##############################################################################
235##############################################################################
236
237USE_CGL_CUTS = TRUE
238
239!IF "$(USE_CGL_CUTS)" == "TRUE"
240LPINCDIR = $(LPINCDIR) /I "$(COINROOT)\Cgl\include"
241LPLIB = $(LPLIB) "$(COINROOT)\Cgl\MSVisualStudio\v8\libCgl\Debug\libCgl.lib"
242DEFINITIONS= $(DEFINITIONS) /D "USE_CGL_CUTS"
243!ENDIF
244
245##############################################################################
246# If you wish to compile and use the SYMPHONY callable library through the
247# SYMPHONY OSI interface, set USE_OSI_INTERFACE to TRUE below. Note that
248# you must have COIN installed to use this capability. See below to set the
249# path to the COIN directories.
250##############################################################################
251
252USE_OSI_INTERFACE = FALSE
253
254!IF "$(USE_OSI_INTERFACE)" == "TRUE"
255ALL_INCDIR = $(LPINCDIR) /I "$(COINROOT)\Osi\src\OsiSym\include"
256ALL_LIB = $(LPLIB) "$(COINROOT)\Osi\MSVisualStudio\v8\libOsiSym\Debug\libOsiSym.lib"
257!ELSE
258ALL_INCDIR = $(LPINCDIR)
259ALL_LIB = $(LPLIB)
260!ENDIF
261
262##############################################################################
263##############################################################################
264#
265# Compiling and Linking...
266#
267##############################################################################
268##############################################################################
269
270ALL_LIB = $(ALL_LIB) ".\Debug\libSymphony.lib"
271
272DEFINITIONS = $(DEFINITIONS) /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" \
273	/D "COMPILE_IN_CG" /D "COMPILE_IN_CP" /D "COMPILE_IN_LP" \
274	/D "COMPILE_IN_TM"
275
276ALL_INCDIR = $(ALL_INCDIR) /I "$(SYMPHONYROOT)\include" \
277/I "$(COINROOT)\BuildTools\headers" \
278/I "$(COINROOT)\Cgl\src" \
279/I "$(COINROOT)\Cgl\src\CglAllDifferent" \
280/I "$(COINROOT)\Cgl\src\CglClique" \
281/I "$(COINROOT)\Cgl\src\CglDuplicateRow" \
282/I "$(COINROOT)\Cgl\src\CglFlowCover" \
283/I "$(COINROOT)\Cgl\src\CglGomory" \
284/I "$(COINROOT)\Cgl\src\CglKnapsackCover" \
285/I "$(COINROOT)\Cgl\src\CglLandP" \
286/I "$(COINROOT)\Cgl\src\CglLiftAndProject" \
287/I "$(COINROOT)\Cgl\src\CglMixedIntegerRounding" \
288/I "$(COINROOT)\Cgl\src\CglMixedIntegerRounding2" \
289/I "$(COINROOT)\Cgl\src\CglOddHole" \
290/I "$(COINROOT)\Cgl\src\CglPreProcess" \
291/I "$(COINROOT)\Cgl\src\CglProbing" \
292/I "$(COINROOT)\Cgl\src\CglRedSplit" \
293/I "$(COINROOT)\Cgl\src\CglSimpleRounding" \
294/I "$(COINROOT)\Cgl\src\CglTwoMir" \
295/I "$(COINROOT)\CoinUtils\src"
296
297.SILENT:
298
299CPP=cl.exe
300CPPFLAGS= /I $(ALL_INCDIR) /D $(DEFINITIONS) \
301/D "_CRT_SECURE_NO_DEPRECATE" /D "_VC80_UPGRADE=0x0600" \
302/D "_MBCS" /Gm /EHsc /RTC1 /MTd /Fp"$(OUTDIR)/symphony.pch" /Fo"$(OUTDIR)\\" \
303/Fd"$(OUTDIR)\sym.pdb" /W2 /nologo /c /ZI /TP /errorReport:prompt
304
305CFLAGS= /I $(ALL_INCDIR) /D $(DEFINITIONS) \
306/D "_CRT_SECURE_NO_DEPRECATE" /D "_VC80_UPGRADE=0x0600" \
307/D "_MBCS" /Gm /EHsc /RTC1 /MTd /Fp"$(OUTDIR)/symphony.pch" /Fo"$(OUTDIR)" \
308/Fd"$(OUTDIR)\sym.pdb" /W2 /nologo /c /ZI /errorReport:prompt
309
310.c.obj:
311	$(CPP) $(CPPFLAGS) "$*.c"
312
313.c.cobj:
314	$(CPP) $(CFLAGS) "$*.c"
315
316ALL : "$(OUTDIR)" "LIB_MESSAGE" sym_lib "SYMPHONY_MESSAGE" "OBJECTS" sym_exe
317
318CLEAN:
319	del /Q $(OUTDIR)\*.obj
320	del /Q $(OUTDIR)\symphony.exe
321	del /Q $(OUTDIR)\libSymphony.lib
322	del /Q $(OUTDIR)\sym.idb
323	del /Q $(OUTDIR)\sym.pdb
324	del /Q $(OUTDIR)\sym.pch
325
326"$(OUTDIR)" :
327    if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
328
329LIB_MESSAGE:
330	echo Creating SYMPHONY library...
331
332SYMPHONY_MESSAGE:
333	echo Compiling SYMPHONY main function...
334
335sym_lib : \
336	$(SYMPHONYROOT)\src\Common\pack_array.obj \
337	$(SYMPHONYROOT)\src\Common\pack_cut.obj \
338	$(SYMPHONYROOT)\src\Common\proccomm.obj \
339	$(SYMPHONYROOT)\src\Common\sym_qsort.obj \
340	$(SYMPHONYROOT)\src\Common\timemeas.obj \
341	$(SYMPHONYROOT)\src\CutGen\cg_func.obj \
342	$(SYMPHONYROOT)\src\CutGen\cg_wrapper.obj \
343	$(SYMPHONYROOT)\src\CutPool\cp_func.obj \
344	$(SYMPHONYROOT)\src\CutPool\cp_proccomm.obj \
345	$(SYMPHONYROOT)\src\CutPool\cp_wrapper.obj \
346	$(SYMPHONYROOT)\src\LP\lp_branch.obj \
347	$(SYMPHONYROOT)\src\LP\lp_free.obj \
348	$(SYMPHONYROOT)\src\LP\lp_genfunc.obj \
349	$(SYMPHONYROOT)\src\LP\lp_proccomm.obj \
350	$(SYMPHONYROOT)\src\LP\lp_rowfunc.obj \
351	$(SYMPHONYROOT)\src\LP\lp_solver.obj \
352	$(SYMPHONYROOT)\src\LP\lp_varfunc.obj \
353	$(SYMPHONYROOT)\src\LP\lp_wrapper.obj \
354	$(SYMPHONYROOT)\src\Master\master.obj \
355	$(SYMPHONYROOT)\src\Master\master_func.obj \
356	$(SYMPHONYROOT)\src\Master\master_io.obj \
357	$(SYMPHONYROOT)\src\Master\master_wrapper.obj \
358	$(SYMPHONYROOT)\src\TreeManager\tm_func.obj \
359	$(SYMPHONYROOT)\src\TreeManager\tm_proccomm.obj \
360	$(SYMPHONYROOT)\src\PrimalHeuristics\feasibility_pump.obj \
361	$(SYMPHONYROOT)\src\PrimalHeuristics\sp.obj \
362	$(SYMPHONYROOT)\src\Preprocessor\preprocessor_basic.obj \
363	$(SYMPHONYROOT)\src\Preprocessor\preprocessor.obj
364	lib.exe /nologo /out:$(OUTDIR)\libSymphony.lib $(OUTDIR)\*.obj
365	echo "libSymphony.lib" created successfully...
366	echo ...
367
368LINK_OBJECTS = $(OUTDIR)\main.obj
369
370OBJECTS : \
371	$(SYMPHONYROOT)\src\Master\main.obj
372	echo main compiled successfully...
373	echo ...
374
375sym_exe : $(LINK_OBJECTS) $(OUTDIR)\libSymphony.lib
376	echo Linking...
377	$(CPP) /nologo /W3 /Fe"$(OUTDIR)\symphony.exe" \
378	$(ALL_LIB) $**
379	echo "symphony.exe" created successfully...
380