source: trunk/INSTALL @ 2574

Last change on this file since 2574 was 2532, checked in by stefan, 7 months ago

update README and INSTALL

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