https://github.com/gbionics/osqp-eigen
Simple Eigen-C++ wrapper for OSQP library
https://github.com/gbionics/osqp-eigen
convex-optimization optimization osqp qp quadratic-programming
Last synced: 6 months ago
JSON representation
Simple Eigen-C++ wrapper for OSQP library
- Host: GitHub
- URL: https://github.com/gbionics/osqp-eigen
- Owner: gbionics
- License: bsd-3-clause
- Created: 2018-02-01T09:30:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-11-20T21:15:28.000Z (7 months ago)
- Last Synced: 2025-12-23T14:53:18.713Z (6 months ago)
- Topics: convex-optimization, optimization, osqp, qp, quadratic-programming
- Language: C++
- Homepage: https://robotology.github.io/osqp-eigen/
- Size: 1.83 MB
- Stars: 465
- Watchers: 10
- Forks: 128
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# osqp-eigen
| General | [](https://isocpp.org) [](https://github.com/robotology/osqp-eigen/blob/master/LICENSE) |
| :-------: | :----------------------------------------------------------: |
| **CI/CD** | [](https://www.codacy.com/gh/robotology/osqp-eigen/dashboard?utm_source=github.com&utm_medium=referral&utm_content=robotology/osqp-eigen&utm_campaign=Badge_Grade) [](https://github.com/robotology/osqp-eigen/workflows/C++%20CI%20Workflow/badge.svg) [](https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=341091&view=results) |
| **conda** | [](https://anaconda.org/conda-forge/osqp-eigen) [](https://anaconda.org/conda-forge/osqp-eigen) [](https://anaconda.org/conda-forge/osqp-eigen) [](https://anaconda.org/conda-forge/osqp-eigen) |
Simple C++ wrapper for [osqp](http://osqp.readthedocs.io/en/latest/index.html) library.
## 📚 Documentation
The documentation is available online at the accompanying [website](https://robotology.github.io/osqp-eigen).
## 📄 Dependences
The project depends only on [`osqp`](http://osqp.readthedocs.io/en/latest/index.html) and [Eigen3](http://eigen.tuxfamily.org/index.php?title=Main_Page). Please install [Catch2](https://github.com/catchorg/Catch2) if you want to run the tests only for testing.
## 🛠️ Usage
### 📦 Install with conda (recommended)
You can easily the library with [`conda`](https://github.com/conda-forge/osqp-eigen-feedstock) using the following command
```
conda install -c conda-forge osqp-eigen
```
`conda` will automatically install [`osqp`](http://osqp.readthedocs.io/en/latest/index.html) and [Eigen3](http://eigen.tuxfamily.org/index.php?title=Main_Page).
### ⚙️ Build from source (advanced)
1. Clone the repository
```
git clone https://github.com/robotology/osqp-eigen.git
```
2. Build it
```
cd osqp-eigen
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH= ../
make
make install
```
3. Add the following environmental variable
```
OsqpEigen_DIR=/path/where/you/installed/
```
## 🖥️ How to use the library
**osqp-eigen** provides native `CMake` support which allows the library to be easily used in `CMake` projects.
**osqp-eigen** exports a CMake target called `OsqpEigen::OsqpEigen` which can be imported using the `find_package` CMake command and used by calling `target_link_libraries` as in the following example:
```cmake
cmake_minimum_required(VERSION 3.0)
project(myproject)
find_package(OsqpEigen REQUIRED)
add_executable(example example.cpp)
target_link_libraries(example OsqpEigen::OsqpEigen)
```
If you prefer to use the [`bazel`](https://bazel.build/) build system, **osqp-eigen** is available in the Bazel Central Registry, so you can use it following the docs available at [`https://registry.bazel.build/modules/osqp-eigen`](https://registry.bazel.build/modules/osqp-eigen).
## 🐛 Bug reports and support
All types of [issues](https://github.com/robotology/osqp-eigen/issues/new) are welcome.
## 🧩 Compatibility Policy
This project tries to avoid removing functionalities in minor releases, while functionalities are only removed in major version. However, this is only done in a best-effort way, and it may be possible that backward incompatibly changes occur in minor releases (see [EffVer](https://jacobtomlinson.dev/effver/) for more details). Furthermore, the policy is that patch releases does not modify at all the public headers (i.e. the installed `.h` and `.hpp`) files of the project. This is done to ensure that no ABI change will occur in patch releases, without having to manually track ABI changes.
## 📝 License
Materials in this repository are distributed under the following license:
> All software is licensed under the BSD 3-Clause License. See [LICENSE](https://github.com/robotology/osqp-eigen/blob/master/LICENSE) file for details.