laOPT is a native C++ toolbox for high-performance nonlinear optimization and optimal control. It provides a compact, vector-valued modeling interface and transcribes user-defined problems into sparse nonlinear programs of the form
For optimal control applications, laOPT also provides a high-level continuous-time problem interface and direct transcription methods.
- Header-only C++17 library built on Eigen.
- Vector-valued modeling of objectives, dynamics, bounds, and constraints.
- Automatic differentiation (AD; gradients, Jacobians, and Hessians) using Eigen, with optional CasADi support.
- Sparse derivative assembly using precomputed sparsity patterns and evaluation tapes.
- Multiple shooting and Legendre-Gauss-Radau collocation for optimal control problems.
- A native sequential quadratic programming (SQP) solver and an interface to IPOPT.
- Interfaces to established QP solvers, including PIQP, OSQP, ProxQP, QPALM, qpSWIFT, and HPIPM.
- Open source under the BSD 2-Clause License.
(See more details in the documentation.)
laOPT requires a C++17 compiler, CMake 3.21 or later, and Eigen 3.4 or later. Clone and install the header-only package with
git clone https://github.com/PREDICT-EPFL/laopt.git
cd laopt
cmake -S . -B build -DLAOPT_BUILD_TESTS=OFF -DLAOPT_BUILD_EXAMPLES=OFF
cmake --build build
cmake --install buildTo use an laOPT in a CMake project:
find_package(laopt REQUIRED)
target_link_libraries(my_target PRIVATE laopt::laopt)The laopt::laopt target provides the core library and Eigen dependency. Solver interfaces are selected by including the corresponding laOPT header and linking the solver package explicitly in the consuming project.
For example, an application using the laOPT SQP solver with PIQP must link both targets:
find_package(laopt REQUIRED)
find_package(piqp REQUIRED)
add_executable(my_target main.cpp)
target_link_libraries(my_target PRIVATE
laopt::laopt
piqp::piqp
)The application can then select PIQP as its SQP subproblem solver:
#include <laopt/laopt.hpp>
#include <laopt/solvers/sqp_solver.hpp>
#include <laopt/solvers/piqp_interface.hpp>
using Solver = laopt::SQPSolver<Problem, laopt::PIQPSolver<Problem::scalar_t>>;The same pattern applies to IPOPT and the other QP solver interfaces.
The examples directory contains optimal control problems based on a double integrator, inverted pendulum, chain of masses, fixed-wing aircraft, and rocket. To build laOPT's examples, configure with -DLAOPT_BUILD_EXAMPLES=ON together with the LAOPT_WITH_* options for the locally available solver packages.
laOPT is developed by Johannes Waibel, Roland Schwan, and Colin N. Jones at the Automatic Control Laboratory at EPFL, Switzerland.
This work was supported by the Swiss National Science Foundation under the NCCR Automation (grant agreement 51NF40_225155).
If you use laOPT in scientific work, please cite the accompanying paper:
@INPROCEEDINGS{waibel2026laopt,
author={Waibel, Johannes, and Schwan, Roland and Jones, Colin N.},
booktitle={2026 IEEE Conference on Control Technology and Applications (CCTA)},
title={{laOPT}: A Native {C++} Optimal Control Toolbox for High-Performance Implementations, and Application to Racing},
year={2026}
}
laOPT is licensed under the BSD 2-Clause License.
