source: trunk/Makefile @ 296

Last change on this file since 296 was 296, checked in by ladanyi, 14 years ago

change warning to info

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1# Look at and if necessary edit the following files:
2# - ../Makefiles/Makefile.location
3# - Makefile.Cbc
4
5# Makefile.location specifies the components of COIN that are locally
6# available. Makefile.Cbc is where you specify compiler optimisation level and
7# library type.
8
9# From this makefile you can build three primary targets:
10# * libCbc, the cbc branch-and-cut library
11# * solve, a main program which is tailored to work with the clp solver
12# * cbc, a main program which is capable of using solvers other than clp
13
14# libCbc generally uses the OSI interface to consult the underlying solver. It
15# contains some code that is specific to OsiClp, but it will work with any OSI
16# solver that supports the required functionality. Using solvers other than clp
17# should be considered a work in progress. If all you want to do is solve a few
18# MIP problems, you probably want to leave CBC_SOLVERS = Clp (the default) and
19# build the `solve' main program.
20
21# If you want to experiment with other solvers, adjust CBC_SOLVERS below and
22# build the `cbc' main program.  Be sure that the solvers are available and
23# that the information in Makefile.location is correct for all specified
24# solvers. As far as libCbc is concerned, the only thing that matters is
25# presence or absence of clp. The `cbc' main program will create a set of OSI
26# solver prototypes to match the list in CBC_SOLVERS. You can change solvers at
27# run time.  The command `cbc -miplib' will exercise all specified solvers on
28# the miplib examples. The -miplib option uses OsiCbc. If you want to
29# completely exclude clp from the build, you should also examine and edit
30# Osi/OsiCbc/Makefile.
31
32# To specify a solver, add the name to the list here. Use the name given in
33# Makefile.location, without the COIN_lib prefix, e.g., Clp, Cpx, Dylp, Glpk,
34# etc. The default build uses Clp only. To use Clp and Dylp, you would say
35# CBC_SOLVERS := Clp Dylp
36
37CBC_SOLVERS := Clp
38
39# Regardless of the number of solvers specified, it's a good idea to set the
40# default solver. (Check the code in CbcMain if you must know what will happen
41# if you don't.) This must match one of the solver names given above, but all
42# in lower case letters (don't ask).
43
44cbcDefaultSolver := clp
45
46# You should not need to make changes below this line.
47###############################################################################
48
49# Bring on the boilerplate. Makefile.coin will bring in Makefile.<O/S> and
50# Makefile.location.
51
52export CoinDir := $(shell cd ..; pwd)
53export MakefileDir := $(CoinDir)/Makefiles
54include ${MakefileDir}/Makefile.coin
55
56# First check that all solvers specified by the user have been configured in
57# Makefile.location.
58
59cbcMissingSolvers := $(filter-out \
60        $(patsubst COIN_libOsi%,%,$(CoinLibsDefined)),$(CBC_SOLVERS))
61
62ifneq ($(cbcMissingSolvers),)
63  $(foreach solver,$(cbcMissingSolvers), \
64    $(warning $(solver) is not configured in Makefiles/Makefile.location.) \
65    $(warning Probably the line 'CoinLibsDefined += COIN_lib$(solver)' is \
66      commented out))
67  $(error Please correct Makefile.location and try again.)
68endif
69
70$(info Building $(MAKECMDGOALS) with solvers $(CBC_SOLVERS))
71
72# Generate appropriate defines for the compilation command from the value of
73# CBC_SOLVERS and cbcDefaultSolver.
74
75CBC_DEFINES := $(foreach solver,$(CBC_SOLVERS), \
76                 $(patsubst COIN_HAS_%,CBC_USE_%,\
77                   $(filter COIN_HAS_%,$($(solver)Define))))
78CBC_DEFINES += CBC_DEFAULT_SOLVER="\"$(cbcDefaultSolver)\""
79
80export CBC_DEFINES
81export CBC_SOLVERS
82
83# $(warning CBC_DEFINES is $(CBC_DEFINES))
84
85# Pull together a dependency list for libCbc. You can't build libCbc without
86# the Coin, Osi, and Cgl libraries.  The current (06.03.22) Osi makefile will
87# use the set of solvers enabled in Makefile.location to determine which OSI
88# interfaces to build. To make a long story short, since you can't add a solver
89# to CBC_SOLVERS unless it's enabled in Makefile.location, we don't need to
90# explicitly trigger a build for solver XXX, or for interface OsiXXX. Nor can
91# we suppress the build of OsiCbc. (But note that disabling OsiCbc in
92# Makefile.location will exclude it from the link of the cbc main program.) If
93# this behaviour ever changes, the target list here will need to be upgraded to
94# include XXX and OsiXXX for solvers XXX in CBC_SOLVERS.
95
96libTgts := Coin Osi Cgl
97
98# $(warning Dependency list is $(libTgts))
99
100###############################################################################
101
102.DELETE_ON_ERROR:
103
104.PHONY: default install clean library unitTest cbc solver solve \
105        libdepend libCbc doc
106
107# These targets are for libCbc.
108
109default: install
110
111libCbc: library
112
113install library: libdepend
114        ${MAKE} -f Makefile.Cbc $@
115
116libdepend:
117        $(foreach tgt,$(libTgts),(cd $(CoinDir)/$(tgt) && $(MAKE) install) ; )
118
119# These targets are for the two main programs, cbc and solve. In each case,
120# we'll do libCbc first, then go for the main program.
121
122unitTest cbc: install
123        (cd Test && ${MAKE} cbc)
124
125solver solve: install
126        (cd Test && ${MAKE} solver)
127
128clean:
129        @rm -rf Junk
130        @rm -rf $(UNAME)*
131        @rm -rf dep
132        @rm -rf Test/Junk
133        @rm -rf Test/$(UNAME)*
134        @rm -rf Test/dep
135        @rm -f cbc
136        @rm -f solve
137
138doc:
139        doxygen $(MakefileDir)/doxygen.conf
Note: See TracBrowser for help on using the repository browser.