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