fdevinc / ungar

Simplifying optimal control with metaprogramming
Apache License 2.0
94 stars 10 forks source link

OSQP dependencies #4

Closed chobby closed 1 year ago

chobby commented 1 year ago

Thank you for developing a great library. The description only says that Eigen and Boost.Hana are required as dependencies, do I also need to install osqp further?

fdevinc commented 1 year ago

Hi @chobby, thanks for reaching out! Eigen and Boost.Hana are the only required dependencies to access the core functionalities of the library: these are demonstrated in the two examples variable and variable_map. Variables and variable maps can be integrated into any application where you need to organize all your data in a single vector.

The automatic differentiation and optimization capabilities are optional and can be enabled by setting the CMake flags UNGAR_ENABLE_AUTODIFF and UNGAR_ENABLE_OPTIMIZATION to ON, respectively. For now, the latter option requires the former to be ON, too—you will receive informative compile errors if not. When enabled, these options will automatically download the required dependencies via CMake. In particular, UNGAR_ENABLE_OPTIMIZATION will download and make available OSQP and osqp-cpp. So, you do not have to install anything!

If you have a local installation of OSQP, then Ungar should be able to detect it by checking whether the target osqpstatic is defined. As a final note, autodiff and optimization are only available on Linux operating systems because they rely on an autodiff library that uses features specific to Linux.

chobby commented 1 year ago

Thank you very much! I will give it a try.

fdevinc commented 1 year ago

Great, I am always available should you have any issues!