Skip to content
Snippets Groups Projects
Commit dd13c40a authored by David Hrbáč's avatar David Hrbáč
Browse files

Merge branch 'master' into 'master'

Clp module

See merge request !163
parents cba108df 7cbbb721
No related branches found
No related tags found
6 merge requests!368Update prace.md to document the change from qprace to qprod as the default...,!367Update prace.md to document the change from qprace to qprod as the default...,!366Update prace.md to document the change from qprace to qprod as the default...,!323extended-acls-storage-section,!196Master,!163Clp module
# Clp
## Introduction
Clp (Coin-or linear programming) is an open-source linear programming solver written in C++. It is primarily meant to be used as a callable library, but a basic, stand-alone executable version is also available.
Clp ([projects.coin-or.org/Clp](https://projects.coin-or.org/Clp)) is a part of the COIN-OR (The Computational Infrastracture for Operations Research) project ([projects.coin-or.org/](https://projects.coin-or.org/)).
## Modules
Clp, version 1.16.10 is available on Salomon via module Clp:
```console
$ ml Clp
```
The module sets up environment variables required for linking and running applications using Clp. This particular command loads the default module Clp/1.16.10-intel-2017a, Intel module intel/2017a and other related modules.
## Compiling and linking
!!! note
Link with -lClp
Load the Clp module. Link using -lClp switch to link your code against Clp.
```console
$ ml Clp
$ icc myprog.c -o myprog.x -Wl,-rpath=$LIBRARY_PATH -lClp
```
## Example
An example of Clp enabled application follows. In this example, the library solves linear programming problem loaded from file.
```cpp
#include "coin/ClpSimplex.hpp"
int main (int argc, const char *argv[])
{
ClpSimplex model;
int status;
if (argc<2)
status=model.readMps("/apps/all/Clp/1.16.10-intel-2017a/lib/p0033.mps");
else
status=model.readMps(argv[1]);
if (!status) {
model.primal();
}
return 0;
}
```
### Load modules and compile:
```console
ml Clp
icc lp.c -o lp.x -Wl,-rpath=$LIBRARY_PATH -lClp
```
In this example, the lp.c code is compiled using the Intel compiler and linked with Clp. To run the code, the Intel module has to be loaded.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment