aboutsummaryrefslogtreecommitdiff
path: root/clp-bin/BUILD.md
blob: d3eb6c2813f4e879f1747ada1508971892e8a916 (plain)
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
# Building COIN Linear Programming Library for Windows

Building COIN Linear Programming library for Windows requires additional components beyond the standard Simply Fortran compiler suite.  The following outlines the steps for building COIN Linear Programming on Windows.

## Requirements

To build COIN-LP, the following tools must be available:

 * Bash
 * GNU Make
 * pkg-config
 * Simply Fortran

The quickest way to get everything working is to use MinGW W64 via MSYS2.  The download is available from [the MSYS2 site]([https://www.msys2.org/#installation).  Simply Fortran is available from its [Download page](https://simplyfortran.com/download/?platform=windows)

### MSYS2 Requirements Setup

After installing MSYS2, you'll need to execute the following command to install requirements from within MSYS2 (available now in the Start menu after installation):

```
pacman -S pkg-config make
```

## Downloads

Building COIN-LP requires two source archives: CoinUtils and Clp.  Both are available from GitHub:

 * CoinUtils: https://github.com/coin-or/CoinUtils/releases
 * Clp: https://github.com/coin-or/Clp/releases
 
These appropriate archives should be extracted into a sensible directory.  This action should create two new directories.  For example, if the current versions of CoinUtils and Clp are 2.11.4 and 1.17.6 respectively, there should now be two directories named:

 * CoinUtils-releases-2.11.4
 * Clp-releases-1.17.6

A GNU Makefile is provided in this directory to handle automatically building everything.  Copy this Makefile to the directory containing these two subdirectories as well.

## Building

First, start the MSYS2 shell from the Start menu.

To ensure compatibility with Simply Fortran, its compiler should be used to build the libraries.  Because MSYS2 doesn't import the full Windows path, you'll need to manually set the path using the command:


```
export PATH= /c/Program\ Files\ \(x86\)/Simply\ Fortran\ 3/mingw-w64/bin:$PATH
```

Next, navigate to the directory where the COIN-LP libraries were extracted above.  MSYS2 addresses Windows drives simply as root directories in UNIX-like format; "C:" would be known as "/c" and so on.  For example, if you've extracted the archives to *C:\Users\jeff\Fortran\clp*, enter the command:

```
cd /c/Users/jeff/Fortran/clp
```

If you've copied the Makefile to this directory as explained above, you can now simply type:

```
make install
```

After a few moments, depending on your system, there should now be an *install* subdirectory containing the products of the build procedure.  Within the *install/lib* directory will be:

 * libClp.a
 * libClpSolver.a
 * libCoinUtils.a
 
which are the libraries necessary for building applications using COIN-LP.


---


*by Jeff Armstrong (jeff@approximatrix.com)*

*Initial Release: 2020-10-15*