C/C++

Build binaries

Building binaries from source requires installation of cmake and a C compiler such as clang or gcc.

Run the following to get the libqoco.so shared object file.

  1. Clone the repository and change directory.
    git clone https://github.com/qoco-org/qoco
    cd qoco
    
  2. Make build directory and change directory.
    mkdir build
    cd build
    
  3. Compile sources.
    cmake .. && make
    

    You should now see two binaries: libqoco.so which is the qoco library, and qoco_demo which solves a sample SOCP. To build unit tests, add -DENABLE_TESTING:BOOL=True to the cmake call. Note that when running unit tests, it is required to have cvxpy installed.

Use with CMake

To use in a CMake project add the following to your CMakeLists.txt file

add_subdirectory(QOCO_DIRECTORY)
target_link_libraries(yourExecutable qoco)

Where QOCO_DIRECTORY is the location where qoco is cloned.