Debian Codegraph @

SYMPHONY/Applications/MCKP/Makefile.orig

raw
1 ##############################################################################
2 ##############################################################################
3 # #
4 # This file is part of a demonstration application for use with the #
5 # SYMPHONY MILP Solver Framework. This application is a solver for #
6 # multi-criteria knapsack. #
7 # #
8 # (c) Copyright 2005 Lehigh University. All Rights Reserved. #
9 # #
10 # This application was written by Ted Ralphs ([email protected]). #
11 # #
12 # This software is licensed under the Eclipse Public License. Please see #
13 # accompanying file for terms. #
14 # #
15 ##############################################################################
16 ##############################################################################
17
18 CC = g++
19 OPT = -g
20
21 # Automatically set the architecture
22
23 UNAME = $(shell uname -a)
24
25 ifeq ($(findstring Linux,${UNAME}),Linux)
26 ARCH = LINUX
27 else
28 ifeq ($(findstring alpha,${UNAME}),alpha)
29 ARCH = ALPHA
30 else
31 ifeq ($(findstring AIX,${UNAME}),AIX)
32 ARCH = RS6K
33 else
34 ifeq ($(findstring SunOS,${UNAME}),SunOS)
35 ifeq ($(findstring i86pc,${UNAME}),i86pc)
36 ARCH = X86SOL2
37 else
38 ifeq ($(findstring 5.,$(UNAME)),5.)
39 ARCH = SUN4SOL2
40 NP = $(shell mpstat | wc -l -gt -a)
41 ifeq ($(NP,ON)
42 ARCH = SUNMP
43 endif
44 endif
45 endif
46 else
47 ifeq ($(findstring CYGWIN,${UNAME}),CYGWIN)
48 ARCH = CYGWIN
49 endif
50 ifeq ($(findstring Darwin,${UNAME}),Darwin)
51 ARCH = DARWIN
52 endif
53 endif
54 endif
55 endif
56 endif
57
58 SYMPHONYROOT = ../..
59 COINROOT = ../../..
60 MCKPROOT = .
61
62 LP_SOLVER = OSI
63 OSI_INTERFACE = CLP
64
65 LPINCDIR = $(SYMPHONYROOT)/include
66 LPLIB = -lsym
67
68 ifeq ($(LP_SOLVER),CPLEX)
69 LPINCDIR += /usr/local/include/
70 LPLIBPATHS = /usr/local/lib/
71 LPLIBPATHS += $(SYMPHONYROOT)/lib/${ARCH}/$(LP_SOLVER)
72 LPLIB += -lcplex -sym_lp.hread
73 endif
74
75 ifeq ($(LP_SOLVER),OSL)
76 LPINCDIR += $(HOME)/OSL/osllib/include/
77 LPLIBPATHS = $(HOME)/OSL/osllib/lib
78 LPLIBPATHS += $(SYMPHONYROOT)/lib/${ARCH}/$(LP_SOLVER)
79 LPLIB += -losl
80 endif
81
82 ifeq ($(LP_SOLVER),OSI)
83 LPINCDIR += $(COINROOT)/include
84 LPLIBPATHS += $(COINROOT)/lib
85 LPLIBPATHS += $(SYMPHONYROOT)/lib/${ARCH}/$(LP_SOLVER)_$(OSI_INTERFACE)
86 ifeq ($(OSI_INTERFACE),CPLEX)
87 LPINCDIR += /usr/local/include/
88 LPLIBPATHS += /usr/local/lib/
89 LPLIB += -lOsiCpx -lcplex -sym_lp.hread
90 endif
91 ifeq ($(OSI_INTERFACE),OSL)
92 LPINCDIR += $(HOME)/OSL/osllib/include
93 LPLIBPATHS += $(HOME)/OSL/osllib/lib
94 LPLIB += -lOsiOsl -losl
95 endif
96 ifeq ($(OSI_INTERFACE),CLP)
97 LPINCDIR +=
98 LPLIBPATHS +=
99 LPLIB += -lOsiClp -lClp
100 endif
101 ifeq ($(OSI_INTERFACE),GLPK)
102 LPINCDIR += ${HOME}/GLPK/glpk-4.3/include
103 LPLIBPATHS += ${HOME}/GLPK/glpk-4.3/src
104 LPLIB += -lOsiGlpk -lglpk
105 endif
106 LPLIB += -lCgl -lOsi -lCoinUtils
107 endif
108
109 INCDIR = $(addprefix -I,${LPINCDIR})
110 LDFLAGS = $(addprefix -L,${LPLIBPATHS})
111
112 mckp : mckp_main.c
113
114 $(CC) $(OPT) $(LDFLAGS) $(INCDIR) $< -o $@ $(LPLIB)
115
116 clean :
117
118 rm mckp