Loading...
Searching...
No Matches
Build from source

Describes how to compile and install idol from source.

Requirements

To build idol from source, you need:

  • CMake ≥ 3.22
  • C++20 compiler (GCC or Clang)
  • Git

You can verify your tools with:

cmake --version
g++ --version
clang++ --version
git --version

Build instructions

Follow these steps to compile and install idol.

Step 1 — Clone the repository

git clone https://github.com/hlefebvr/idol.git

Step 2 — Create a build directory

mkdir -p idol/build
cd idol/build

Using a separate build directory keeps the source tree clean.

Step 3 — Configure and build

cmake ..
cmake --build .

This compiles the idol library and the idol_cl executable.

Step 4 — Install

sudo cmake --install .

By default, this installs files into:

/usr/local/bin
/usr/local/lib
/usr/local/include

Step 5 — Verify installation

idol_cl --version

If the command prints the version, the installation was successful.

CMake Options

You can customize the build using CMake options.

Enable MibS support

When installing via package managers (apt-get or brew), MibS is included automatically.
When building from source, you must enable and configure it manually.

First, install MibS by following the instructions on the official MibS documentation. Then either:

  • set the environment variable:
export COIN_OR_HOME=/path/to/coin-or/dist
  • or pass the directory directly to CMake with the option COIN_OR_DIR.

Finally, enable MibS with the CMake option USE_MIBS=ON.

cmake -DUSE_MIBS=ON -DCOIN_OR_DIR=/path/to/coin-or/dist ..

Both COIN_OR_HOME and COIN_OR_DIR must point to the COIN-OR dist directory.

Custom installation directory

To install into a custom location, set:

cmake -DCMAKE_INSTALL_PREFIX=/custom/install/path ..

Example:

cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..

The executable will be installed into:

$HOME/.local/bin/idol_cl

Build examples

To build the example programs:

cmake -DBUILD_EXAMPLES=ON ..

Build tests

To build the test suite:

cmake -DBUILD_TESTS=ON ..