Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Installing precompiled package

PIQP can be directly installed running the following commands

websave('install_piqp.m','https://raw.githubusercontent.com/PREDICT-EPFL/piqp/main/interfaces/matlab/install_piqp.m');
install_piqp

Matlab on Apple Silicon (Matlab R2023b) is currently not supported for precompiled packages, i.e., it has to be built from Source.

Building and Installing from Source

To build PIQP it is required to have CMake, Eigen 3.3.4+ and a compatible compiler like GCC, Clang, or Visual Studio with C++ extensions on Windows installed. CMake and a compatible compiler should already be installed on most systems.

Installing Eigen

on macOS via Homebrew

brew install eigen

on Ubuntu

sudo apt install libeigen3-dev

on Windows via Chocolatey

choco install eigen

building from source

# clone Eigen
git clone https://gitlab.com/libeigen/eigen.git eigen
cd eigen
git checkout 3.4.0

# build Eigen
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .

# install Eigen
cmake --install .

Building and Installing PIQP

  • Clone PIQP from Github recursively
    git clone https://github.com/PREDICT-EPFL/piqp.git --recurse-submodules
    
  • Build the interface in Matlab by executing the following commands
    cd interfaces/matlab
    make_piqp
    

    This will build and package the Matlab interface into a piqp-matlab-{platform}64.tar.gz file. You can also directly add the interface to the search path in Matlab by running

    addpath(pwd)
    savepath