C

Binaries

Precompiled platform-dependent shared and static libraries are available on GitHub. We here assume that the user uncompressed each archive to OSQP_FOLDER.

Each archive contains static OSQP_FOLDER/lib/libosqp.a and shared OSQP_FOLDER/lib/libosqp.ext libraries to be used to interface OSQP to any C/C++ software. The extension .ext is platform dependent and is .so for Linux, .dylib for Mac and .dll for Windows. The required include files can be found in OSQP_FOLDER/include.

Simply compile with the linker option with -LOSQP_FOLDER/lib and -losqp.

If you are interested in development builds, you can find them on GitHub.

Sources

The OSQP libraries can also be compiled from sources. For more details see Build from sources.

Including OSQP in CMake projects

If you compiled OSQP from sources and followed the CMake installation instructions in Install the binaries section, you can include the package in another CMake project with the following lines depending on whether you need a shared or a static library

# Find OSQP library and headers
find_package(osqp REQUIRED)

# Link the OSQP shared library
target_link_libraries(yourTarget PRIVATE osqp::osqp)

# or...

# Link the OSQP static library
target_link_libraries(yourTarget PRIVATE osqp::osqpstatic)