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