1 | These are quick install instructions mainly intended for UNIX-like systems |
---|
2 | (including Linux, OS X, AIX, Cygwin and MSys). Additional details for building |
---|
3 | this and other COIN projects are available at |
---|
4 | |
---|
5 | https://projects.coin-or.org/BuildTools |
---|
6 | |
---|
7 | You can find instructions for building with Microsoft Visual Studio under |
---|
8 | Windows at |
---|
9 | |
---|
10 | https://projects.coin-or.org/MSVisualStudio |
---|
11 | |
---|
12 | ********************************************************************** |
---|
13 | *** DOWNLOAD *** |
---|
14 | ********************************************************************** |
---|
15 | |
---|
16 | For the most recent information on how to install Cbc binaries, please |
---|
17 | see the Cbc Wiki: https://projects.coin-or.org/Cbc |
---|
18 | |
---|
19 | If you would like to build from source, you can obtain the source code for the |
---|
20 | Cbc package in three ways: |
---|
21 | |
---|
22 | 1. Obtain the source directly from the COIN-OR subversion repository |
---|
23 | (recommended). For this you needs the program 'svn' installed on your |
---|
24 | machine, and output of "svn --version" must contain "handles 'https' |
---|
25 | scheme". On Windows, it is recommended to get the source with the SVN |
---|
26 | client TortoiseSVN (http://tortoisesvn.net). |
---|
27 | |
---|
28 | Assuming that you want to download a stable version 2.9, as an example, |
---|
29 | you would execute the command |
---|
30 | |
---|
31 | svn co https://projects.coin-or.org/svn/Cbc/stable/2.9 Cbc-2.9 |
---|
32 | |
---|
33 | You can similarly get source for the latest release or the trunk |
---|
34 | (development) version. |
---|
35 | |
---|
36 | 2. Obtain the source from Github using git. Assuming that you want to |
---|
37 | download stable version 2.9, as an example, you would execute |
---|
38 | the command |
---|
39 | |
---|
40 | git clone --branch=stable/2.9 https://github.com/coin-or/Cbc Cbc-2.9 |
---|
41 | |
---|
42 | With git, you additionally, need to fetch the dependencies. To do so, |
---|
43 | execute |
---|
44 | |
---|
45 | cd Cbc-2.9 |
---|
46 | git clone --branch=stable/0.8 https://github.com/coin-or-tools/BuildTools |
---|
47 | BuildTools/get.dependencies fetch |
---|
48 | |
---|
49 | 3. Download the tarball from http://www.coin-or.org/download/source/Cbc |
---|
50 | and extract it. For example, for the release 2.7.0 you type |
---|
51 | |
---|
52 | gunzip Cbc-2.7.0.tgz |
---|
53 | tar xvf Cbc-2.7.0.tar |
---|
54 | |
---|
55 | ********************************************************************** |
---|
56 | *** CONFIGURATION *** |
---|
57 | ********************************************************************** |
---|
58 | |
---|
59 | Go into the directory that you just downloaded or extracted (e.g., Cbc-2.7.0). |
---|
60 | Then create a build directory and configure the package by typing |
---|
61 | |
---|
62 | mkdir build |
---|
63 | cd build |
---|
64 | ../configure |
---|
65 | |
---|
66 | Note that you might have to specify additional options, in case you |
---|
67 | don't want to use the default choices that configure makes (e.g., |
---|
68 | compilers). Please visit |
---|
69 | |
---|
70 | https://projects.coin-or.org/BuildTools/ |
---|
71 | |
---|
72 | and the Cbc Trac page |
---|
73 | |
---|
74 | https://projects.coin-or.org/Cbc |
---|
75 | |
---|
76 | for more information. |
---|
77 | |
---|
78 | If everything went fine, you will see at the end of the output |
---|
79 | |
---|
80 | "Main configuration of Cbc successful" |
---|
81 | |
---|
82 | ********************************************************************** |
---|
83 | *** COMPILATION AND INSTALLATION *** |
---|
84 | ********************************************************************** |
---|
85 | |
---|
86 | In the directory where you ran the configure script: |
---|
87 | |
---|
88 | 1. Compile the code by typing |
---|
89 | |
---|
90 | make |
---|
91 | |
---|
92 | 2. To test if the code works, you can type |
---|
93 | |
---|
94 | make test |
---|
95 | |
---|
96 | 3. To install the code, you type |
---|
97 | |
---|
98 | make install |
---|
99 | |
---|
100 | After this, you will find the executables, libraries and header |
---|
101 | files in the "bin", "lib" and "include" subdirectory, respectively. |
---|
102 | |
---|
103 | More information on the compilation and installation can be found at |
---|
104 | |
---|
105 | https://projects.coin-or.org/BuildTools/ |
---|
106 | |
---|
107 | ********************************************************************** |
---|
108 | *** USING CBC *** |
---|
109 | ********************************************************************** |
---|
110 | |
---|
111 | After installing Cbc, you will have an executable named "cbc" (Unix-like |
---|
112 | environments) or "cbc.exe" (Windows). We will call it "cbc" from here on. |
---|
113 | |
---|
114 | The executable "cbc" takes various options. First, run the program in |
---|
115 | interactive mode by typing just "cbc" on the command line with no arguments. |
---|
116 | You will see the prompt |
---|
117 | |
---|
118 | CoinSolver takes input from arguments ( - switches to stdin) |
---|
119 | Enter ? for list of commands or help |
---|
120 | Coin: |
---|
121 | |
---|
122 | Type ? to get some idea of what you can do. The executable can also be run in |
---|
123 | batch mode. To simply solve a given instance with default parameter settings, type |
---|
124 | |
---|
125 | cbc <file> |
---|
126 | |
---|
127 | By typing a sequence of interactive commands on the command line |
---|
128 | with each command preceded by a "-", you can run set parameters and chane other options. For example, typing |
---|
129 | |
---|
130 | cbc <file> -cuts root -solve |
---|
131 | |
---|
132 | will import file and solve the problem, generating cuts only at the root node. |
---|
133 | On Linux, the cbc interactive solver can do file completion and line editing |
---|
134 | if built from source with that option enabled. |
---|
135 | |
---|
136 | With the installed libraries, you can also link your own code with the |
---|
137 | installed libraries. You can find examples in the |
---|
138 | |
---|
139 | Cbc/examples/ |
---|
140 | |
---|
141 | To build these examples, go into the directory build/Cbc/examples and type |
---|
142 | |
---|
143 | make sample1 |
---|
144 | |
---|
145 | to build the executable corresponding to sample1.cpp. The two simplest samples |
---|
146 | are: |
---|
147 | |
---|
148 | sample.cpp This is a simple program to read an mps file.and solve the |
---|
149 | integer problem. |
---|
150 | |
---|
151 | sample2.cpp. This is the benchmark driver for the competition. It overrides |
---|
152 | the default branching methods and adds a (mildly useless) |
---|
153 | heuristic. It is intended to show you how to add your |
---|
154 | own methods. See CbcCompareUser.hpp for how to modify |
---|
155 | choice of node from tree. See CbcBranchUser.?pp for |
---|
156 | how to modify which variable is chosen at a node. For |
---|
157 | more complex stuff such as new types of branches see |
---|
158 | CbcBranchBase and CbcBranchActual in directory Cbc. |
---|
159 | To see how to add heuristics see CbcHeuristicUser.?pp. |
---|
160 | |
---|
161 | To add cut generators - define them as in Cgl and then just |
---|
162 | add them as in sample2.cpp |
---|
163 | |
---|
164 | The script "runtimes" in Samples directory will |
---|
165 | run some or all of test set. The version checked in |
---|
166 | does some - just take off # to run. An optional time |
---|
167 | in minutes can be passed. |
---|
168 | |
---|