forked from coin-or/SYMPHONY.old
-
Notifications
You must be signed in to change notification settings - Fork 2
/
INSTALL
353 lines (268 loc) · 12.5 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
## BUILDING AND INSTALLING
These instructions are for building and installing SYMPHONY from source. For
instructions on how to obtain pre-built binaries, please see the README file.
The instructions here are for the standard build. For a more detailed
explanation of the build options and for building in parallel, see the
SYMPHONY [manual](
IMPORTANT: The build instructions have changed significantly. In most case,
you do not need to clone this repository first! Please follow the instructions
for your platform below.
### Building on Linux
Most Linux distributions come with all the required tools installed. To obtain
the source code, the first step is to get the installer that will then
fetch the source for SYMPHONY and all its dependencies. *You do not need to
clone SYMPHONY first, just do the following!* Open a terminal and execute
```
git clone https://www.github.com/coin-or/COIN-OR-OptimizationSuite
```
Next, to check out source code for and build all the necessary projects
(including dependencies), execute the script in the `COIN-OR-OptimizationSuite`
subdirectory. To execute the script, do
```
cd COIN-OR-OptimizationSuite
chmod u+x coin.install.sh
./coin.install.sh
```
(Note: The `chmod` command is only needed if the execute permission is not
automatically set by git on cloning). Once you run the script,
you will be prompted interactively to select a project to fetch and build. The
rest should happen automagically. Alternatively, the following command-line
incantation will execute the procedure non-interactively.
```
./coin.install.sh fetch build --no-prompt --main-proj=SYMPHONY
```
Options that would have been passed to the `configure` script under the old
build system can simply be added to the command-line. For example, to build
with debugging symbols, do
```
./coin.install.sh fetch build --no-prompt --main-proj=SYMPHONY --enable-debug
```
To get help with additional options available in running the script, do
```
./coin/install.sh --help
```
The above procedures will build all required dependencies and SYMPHONY itself.
Afterwards, the binaries will be installed in the directory `Mibs/build/bin`
and the libraries in the directory `SYMPHONY/build/lib`. If you wish to
install in a different directory, such as `/usr/local`, then run the command
```
./coin.install.sh install --no-prompt --main-proj=SYMPHONY --prefix=/path/to/install/dir
```
After installation, you will also need to add `/path/to/install/dir/bin` to your
`PATH` variable in your `.bashrc` and also add `/path/to/install/dir/lib`
to your `LD_LIBRARY_PATH` if you want to link to COIN libraries.
### Building on Windows (MSys2/CYGWIN and MinGW/MSVC)
By far, the easiest way to build on Windows is with the GNU autotools and the
GCC compilers. The first step is to install either
* [Msys2](https://msys2.github.io/)
* [CYGWIN](http://cygwin.org/)
* [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
If you don't already have CYGWIN installed and don't want to fool around with
WSL (which is a great option if you already know your way around Unix), it is
recommended to use MSys2, since it provides a minimal toolset that is easy to
install. To get MSys2, either download the installer
[here](https://msys2.github.io/) or download and unzip MSys2 base from
[here](http://kent.dl.sourceforge.net/project/msys2/Base/x86_64/msys2-base-x86_64-20150512.tar.xz)
(this is an out-of-date version, there may be a better place to get an archive
version).
Following any of the above steps, you should have the `bash` command
(with Msys2, be sure to run `msys2_shell.bat`
or manually add `msys64\usr\bin`, `msys64\mingw32\bin`, and
`msys64\mingw64\bin` to your Windows path).
Once you have bash installed and in your `PATH`, open a Windows terminal and
type
```
bash
pacman -S make wget tar patch dos2unix diffutils git svn
```
To obtain the source code, the first step is to get the installer that will then
fetch the source for SYMPHONY and all its dependencies. *You do not need to
clone SYMPHONY first, just do the following!* Open a terminal and execute
```
git clone https://www.github.com/coin-or/COIN-OR-OptimizationSuite
```
Next, to check out source code for and build all the necessary projects
(including dependencies), execute the script in the `COIN-OR-OptimizationSuite`
subdirectory. To execute the script, do
```
cd COIN-OR-OptimizationSuite
chmod u+x coi.install.sh
./coin.install.sh
```
(Note: The `chmod` command is only needed if the execute permission is not
automatically set by git on cloning). Once you run the script,
you will be prompted interactively to select a project to fetch and build. the
rest should happen automagically. Alternatively, the following command-line
incantation will execute the procedure non-interactively.
```
./coin.install.sh fetch build --no-prompt --main-proj=SYMPHONY
```
Options that would have been passed to the `configure` script under the old
build system can simply be added to the command-line. For example, to build
with debugging symbols, do
```
./coin.install.sh fetch build --no-prompt --main-proj=SYMPHONY --enable-debug
```
To get help with additional options available in running the script, do
```
./coin/install.sh --help
```
To use the resulting binaries and/or libraries, you will need to add the
full path of the directory `build\bin` to your Windows executable
search `PATH`, or, alternatively, copy the conents of the build directory to
`C:\Program Files (x86)\SYMPHONY` and add the directory
`C:\Program Files (x86)\SYMPHONY\bin`
to your Windows executable search `PATH`. You may also consider adding
`C:\Program Files (x86)\SYMPHONY\lib` to the `LIB` path and
`C:\Program Files (x86)\SYMPHONY\include` to the `INCLUDE` path.
It is possible to use almost the exact same commands to build with the Visual
Studio compilers. Before doing any of the above commands in the Windows
terminal, first run the `vcvarsall.bat` script for your version of Visual
Studio. Note that you will also need a compatible Fortran compiler if you want
to build any projects requiring Fortran (`ifort` is recommended, but not
free). Then follow all the steps above, but replace the `build` command
with
```
./coin.install.sh fetch build --no-prompt --main-proj=SYMPHONY --enable-msvc
```
## BUILDING WITH the MSVC++ IDE
These instructions are for MSVC++ Version 10. Instructions for other versions
should be similar. '''The MSVC++ are not regularly tested so please let us
know if they are broken.'''
1. Go to `SYMPHONY/MSVisualStudio/v10` directory and open the solution
file `symphony.sln`.
2. Note that there are a number of additional preprocessor definitions that
control the functionality of SYMPHONY. These definitions are described in
`sym.mak`, a Unix-style makefile included in the distribution. To enable
the functionality associated with a particular definition, simply add it to
the list of definitions of `libSymphony` project together with the
required libraries and paths. For instance, if you want to enable GMPL reader
option, you need to * add the directory of the header files of GLPK to the
include files path * add `USE_GLPMPL` to the defines * add the GLPK
library to the solution
3. Make sure that the project `symphony` is set as the startup project by
choosing "Set as Startup Project" from the Project menu after selecting the
symphony project in the Solution Explorer. Choose `Build Solution` from
the `Build` menu. This should successfully build the SYMPHONY library and
the corresponding executable.
4. To test the executable, go to the `Debug` tab and choose `Start
Without Debugging.` and then type `help` or `?` to see a list of
available commands.
## BUILDING WITH VISUAL STUDIO FROM COMMAND LINE (deprecated)
These instructions are for MSVC++ Version 10. Instructions for other versions
should be similar.
1. Open a command line terminal. Go to 'SYMPHONY/MSVisualStudio/v10'
directory and type
```
devenv symphony.sln /Build "Debug|Win32
```
This will create the 32-bit debug version of SYMPHONY. You can build 64-bit
with
```
devenv symphony.sln /Build "Debug|x64"
```
For each command, the library `libSymphony.lib` and the executable
`symphony` will be created in directories according to platform and
configuration. The library, together with the header files in
`SYMPHONY\include\`, can then be used to call SYMPHONY from any C/C++
code. The API for calling SYMPHONY is described in the user's manual.
2. To test the executable, type
```
symphony.exe -F ..\..\SYMPHONY\Datasets\sample.mps
```
In the appropriate directory. If you want to use the interactive optimizer,
simply type
```
symphony.exe
```
and then type `help` or `?` to see a list of available commands.
3. If SYMPHONY is modified, type
```
devenv symphony.sln /Rebuild "Debug|Win32"
```
in order to clean and rebuild everything.
## BUILDING WITH THE NMAKE Utility (deprecated)
Note: the `sym.mak` file is no longer maintained, but may work.
1. Go to `MSVisualStudio` directory and edit the `sym.mak` makefile
to reflect your environment. This involves specifying the LP solver to be
used, assigning some variables and setting various paths. Only minor edits
should be required. An explanation of what has to be set is contained in the
comments in the makefile. Note that, you have to first create the COIN
libraries Cgl, Clp, Osi, OsiClp and CoinUtils.
2. Once configuration is done, open a command line terminal and type
```
nmake sym.mak
```
This will make the SYMPHONY library `libSymphony.lib` and the executable
`symphony` in `Debug` directory. The library, together with the header
files in `SYMPHONY\include\`, can then be used to call SYMPHONY from any
C/C++ code. The API for calling SYMPHONY is described in the user's manual.
3. To test the executable, type
```
symphony.exe -F ..\..\SYMPHONY\Datasets\sample.mps
```
in the output directory. If you want to use the interactive optimizer, simply
type
```
symphony.exe
```
and then type `help` or `?` to see a list of available commands.
### Building on OS X
OS X is a Unix-based OS and ships with many of the basic components needed to
build COIN-OR, but it's missing some things. For examples, the latest versions
of OS X come with the `clang` compiler but no Fortran compiler. You may also
be missing the `wget` utility and `subversion` and `git` clients (needed for
obtaining source code). The easiest way to get these missing utilitites is to
install Homebrew (see http://brew.sh). After installation, open a terminal and
do
```
brew install gcc wget svn git
```
To obtain the source code, the first step is to get the installer that will then
fetch the source for SYMPHONY and all its dependencies. *You do not need to
clone SYMPHONY first, just do the following!* Open a terminal and execute
```
git clone https://www.github.com/coin-or/COIN-OR-OptimizationSuite
```
Next, to check out source code for and build all the necessary projects
(including dependencies), execute the script in the `COIN-OR-OptimizationSuite`
subdirectory. To execute the script, do
```
cd COIN-OR-OptimizationSuite
chmod u+x coi.install.sh
./coin.install.sh
```
(Note: The `chmod` command is only needed if the execute permission is not
automatically set by git on cloning). Once you run the script,
you will be prompted interactively to select a project to fetch and build. the
rest should happen automagically. Alternatively, the following command-line
incantation will execute the procedure non-interactively.
```
./coin.install.sh fetch build --no-prompt --main-proj=SYMPHONY
```
With this setup, `clang` will be used for compiling C++ by default and
`gfortran` will be used for Fortran. Since `clang` uses the GNU standard
library, `gfortran` is compatible.
If you want to use the `gcc` compiler provided by Homebrew, then replace the
`build` command above with
```
./coin.install.sh build --no-prompt --main-proj=SYMPHONY CC=gcc-5 CXX=g++-5
```
Options that would have been passed to the `configure` script under the old
build system can simply be added to the command-line. For example, to build
with debugging symbols, do
```
./coin.install.sh fetch build --no-prompt --main-proj=SYMPHONY --enable-debug
```
To get help with additional options available in running the script, do
```
./coin/install.sh --help
```
If you wish to install in a different directory, such as `/usr/local`, then run
the command
```
./coin.install.sh install --no-prompt --main-proj=SYMPHONY --prefix=/path/to/install/dir
```
After installation, you will also need to add `/path/to/install/dir/bin` to your
`PATH` variable in your `.bashrc` and also add `/path/to/install/dir/lib`
to your `DYLD_LIBRARY_PATH` if you want to link to COIN libraries.