Changeset 286


Ignore:
Timestamp:
Mar 27, 2006 6:24:59 PM (13 years ago)
Author:
lou
Message:

Remove CBC_ONLY_CLP build option, and general cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r284 r286  
    33# - Makefile.Cbc
    44
    5 # Define variables here to select the solvers that you want to incorporate into
    6 # the cbc build. Be sure that the solvers are available and that the
    7 # information in Makefile.location is correct for all selected solvers.
    8 # Check Makefile.Cbc to specify the optimisation level of the build.
     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.
    98
    10 # Compile-time configuration for Cbc. There are basically two options:
    11 # (1)
    12 # Build cbc to use only clp as the underlying lp solver. This is the most
    13 # efficient configuration if you wish to take full advantage of capabilities
    14 # supported by clp but not available through the standard OSI interface, and
    15 # you have no interest in experimenting with other solvers.
    16 # (2)
    17 # Build cbc so that it can use some mix of one or more OSI solvers, not
    18 # necessarily including clp. Use this option if you want to experiment with
    19 # other solvers.
     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.
    2031
    2132# To specify a solver, add the name to the list here. Use the name given in
     
    2435# CBC_SOLVERS := Clp Dylp
    2536
    26 CBC_SOLVERS := Clp 
     37CBC_SOLVERS := Clp
    2738
    2839# Regardless of the number of solvers specified, it's a good idea to set the
    29 # default solver. (All right, the real reason is it'll take too long to explain
    30 # what happens if you don't. Check the code in CbcMain if you must know.)
    31 # This must match one of the solver names given above, but all in lower case
    32 # letters (don't ask).
     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).
    3343
    3444cbcDefaultSolver := clp
    3545
     46# You should not need to make changes below this line.
    3647###############################################################################
    3748
     
    5768endif
    5869
    59 # Figure out the configuration based on the value of CBC_SOLVERS. We need to
    60 # generate appropriate defines for the compilation command.
     70$(warning Building $(MAKECMDGOALS) with solvers $(CBC_SOLVERS))
    6171
    62 CBC_DEFINES :=
     72# Generate appropriate defines for the compilation command from the value of
     73# CBC_SOLVERS and cbcDefaultSolver.
    6374
    64 ifeq ($(CBC_SOLVERS),Clp)
    65   CBC_ONLY_CLP := 1
    66   CBC_DEFINES := CBC_ONLY_CLP CBC_USE_CLP
    67 else
    68   CBC_ONLY_CLP := 0
    69   CBC_DEFINES := $(foreach solver,$(CBC_SOLVERS), \
    70       $(patsubst COIN_HAS_%,CBC_USE_%,\
    71         $(filter COIN_HAS_%,$($(solver)Define))))
    72 endif
     75CBC_DEFINES := $(foreach solver,$(CBC_SOLVERS), \
     76                 $(patsubst COIN_HAS_%,CBC_USE_%,\
     77                   $(filter COIN_HAS_%,$($(solver)Define))))
    7378CBC_DEFINES += CBC_DEFAULT_SOLVER="\"$(cbcDefaultSolver)\""
    74 export CBC_ONLY_CLP
     79
    7580export CBC_DEFINES
    7681export CBC_SOLVERS
     
    7883# $(warning CBC_DEFINES is $(CBC_DEFINES))
    7984
    80 $(warning Building cbc with solvers $(CBC_SOLVERS))
     85# Pull together the full dependency list for libCbc. You can't build libCbc
     86# without the Coin, Osi, and Cgl libraries. If Clp is included in CBC_SOLVERS,
     87# we'll need to build it too. Note that the current (06.03.22) Osi makefile
     88# will use Makefile.location to determine which solvers and OSI interfaces
     89# to build. This means that building Osi (which we need for libCbc) will
     90# trigger the builds of all the specified solvers. Oh well, we want them
     91# anyway.
    8192
    82 # Pull together the full dependency list for cbc. You can't build cbc without
    83 # the Coin, Osi, and Cgl libraries. Add Coin and Osi later, for technical
    84 # reasons.
     93libTgts := Coin Osi
    8594
    86 libTgts := Cgl
     95ifneq ($(filter Clp,$(CBC_SOLVERS)),)
     96  libTgts += Clp Osi/OsiClp
     97endif
    8798
    88 # This makefile fronts for two main programs down in the Test directory, cbc
    89 # and solve. solve will always want OsiClp and Vol (note: not OsiVol). Add them
    90 # here, if they're not already in CBC_SOLVERS, and add the list from
    91 # CBC_SOLVERS.
    92 
    93 libTgts += $(filter-out $(CBC_SOLVERS),Vol)
    94 libTgts += $(patsubst %,Osi%,$(CBC_SOLVERS))
    95 libTgts += $(filter-out $(libTgts),OsiClp)
    96 
    97 # Relocate the OsiXXX targets to the Osi directory, then prepend Coin and Osi.
    98 
    99 libTgts := Coin Osi $(patsubst Osi%,Osi/Osi%,$(libTgts))
     99libTgts += Cgl
    100100
    101101$(warning Complete dependency list is $(libTgts))
     
    108108        libdepend libCbc doc
    109109
     110# These targets are for libCbc.
     111
    110112default: install
    111 libCbc: library
    112113
    113114libCbc: library
    114 
    115 ifneq ($(filter COIN_libOsiCbc,$(CoinLibsDefined)),)
    116         (cd $(CoinDir)/Osi/OsiCbc && $(MAKE) -f Makefile.lightweight install)
    117 endif
    118115
    119116install library: libdepend
    120117        ${MAKE} -f Makefile.Cbc $@
    121118
    122 # Build the dependencies. OsiCbc is its own strange animal, pick it off
    123 # separately.
    124 
    125119libdepend:
    126120        $(foreach tgt,$(libTgts),(cd $(CoinDir)/$(tgt) && $(MAKE) install) ; )
    127 ifneq ($(filter COIN_libOsiCbc,$(CoinLibsDefined)),)
    128         (cd $(CoinDir)/Osi/OsiCbc && $(MAKE) -f Makefile.lightweight install)
    129 endif
    130121
    131 unitTest cbc:
    132         (cd Test && ${MAKE} unitTest)
     122# These targets are for the two main programs, cbc and solve. In each case,
     123# we'll do libCbc first, then go for the main program.
    133124
    134 solver:
    135         (cd Test && ${MAKE} solver)
     125unitTest cbc: install
     126        (cd Test && ${MAKE} cbc)
    136127
    137 solve:
     128solver solve: install
    138129        (cd Test && ${MAKE} solver)
    139130
Note: See TracChangeset for help on using the changeset viewer.