idol
A C++ Framework for Optimization
|
Describes how to install idol from source and link it to your project.
This section describes how to install idol from source using CMake and Make. You may consider this as a more advanced option, but it is still very easy to do.
First, we need to download idol from GitHub.
Then, we follow the standard CMake build procedure.
If there are no errors, we can install idol using the following command.
That's it! idol is now installed on your system. The next section describes how to link idol to your project.
Note that you probably want to use idol in combination with external optimization solvers like Gurobi or HiGHS. To do so, you need to install the solvers and set the corresponding CMake options. See the CMake Configuration Options section for more details.
A CMake option can be set using
-DMY_OPTION=VALUE
, e.g.,cmake -DUSE_GUROBI=ON ..
.
If you do not have sudo privileges, you can also install idol in a custom folder. To do so, use the standard CMAKE_INSTALL_PREFIX
option to change the destination folder as follows:
Now that idol is installed, we can link it to our project. To do so, we will assume that you have a basic CMake
project with a CMakeLists.txt
that looks like this:
This file creates a target called my_target
made of only one source file main.cpp
. Now, we show how to link idol to your target.
First, we need to find idol using the find_package
command.
Then, we can link idol to our target.
That's it! You can now use idol in your project.