From 4aa61fa9aaa5465e89fbcb3970c4fef8e838a412 Mon Sep 17 00:00:00 2001 From: Roland Schwan Date: Tue, 18 Jun 2024 02:10:49 +0200 Subject: [PATCH] update documentation --- docs/interfaces/c_cpp/installation.md | 4 +- docs/interfaces/matlab/getting_started.md | 4 +- docs/interfaces/matlab/index.md | 2 +- ...installation.md => installation_matlab.md} | 8 ++-- docs/interfaces/matlab/installation_octave.md | 37 +++++++++++++++++ docs/interfaces/octave/index.md | 6 --- docs/interfaces/octave/installation.md | 40 ------------------- docs/interfaces/python/installation.md | 4 +- 8 files changed, 48 insertions(+), 57 deletions(-) rename docs/interfaces/matlab/{installation.md => installation_matlab.md} (84%) create mode 100644 docs/interfaces/matlab/installation_octave.md delete mode 100644 docs/interfaces/octave/index.md delete mode 100644 docs/interfaces/octave/installation.md diff --git a/docs/interfaces/c_cpp/installation.md b/docs/interfaces/c_cpp/installation.md index a906a10..4c1597e 100644 --- a/docs/interfaces/c_cpp/installation.md +++ b/docs/interfaces/c_cpp/installation.md @@ -12,9 +12,9 @@ nav_order: 1 ### Building and Installing PIQP -* Clone PIQP from Github recursively +* Clone PIQP from Github ```shell -git clone https://github.com/PREDICT-EPFL/piqp.git --recurse-submodules +git clone https://github.com/PREDICT-EPFL/piqp.git ``` * Build PIQP in a `build` folder ```shell diff --git a/docs/interfaces/matlab/getting_started.md b/docs/interfaces/matlab/getting_started.md index 7b74444..052dadf 100644 --- a/docs/interfaces/matlab/getting_started.md +++ b/docs/interfaces/matlab/getting_started.md @@ -1,9 +1,9 @@ --- title: Getting Started layout: default -parent: Matlab +parent: Matlab / Octave grand_parent: Interfaces -nav_order: 2 +nav_order: 3 --- {% root_include _common/problem_formulation.md %} diff --git a/docs/interfaces/matlab/index.md b/docs/interfaces/matlab/index.md index 1c0b8cf..97e53eb 100644 --- a/docs/interfaces/matlab/index.md +++ b/docs/interfaces/matlab/index.md @@ -1,5 +1,5 @@ --- -title: Matlab +title: Matlab / Octave layout: default nav_order: 3 parent: Interfaces diff --git a/docs/interfaces/matlab/installation.md b/docs/interfaces/matlab/installation_matlab.md similarity index 84% rename from docs/interfaces/matlab/installation.md rename to docs/interfaces/matlab/installation_matlab.md index 44ec48a..c8c7ab8 100644 --- a/docs/interfaces/matlab/installation.md +++ b/docs/interfaces/matlab/installation_matlab.md @@ -1,7 +1,7 @@ --- -title: Installation +title: Installation (Matlab) layout: default -parent: Matlab +parent: Matlab / Octave grand_parent: Interfaces nav_order: 1 --- @@ -21,9 +21,9 @@ install_piqp ### Building and Installing PIQP -* Clone PIQP from Github recursively +* Clone PIQP from Github ```shell -git clone https://github.com/PREDICT-EPFL/piqp.git --recurse-submodules +git clone https://github.com/PREDICT-EPFL/piqp.git ``` * Build the interface in Matlab by executing the following commands ```matlab diff --git a/docs/interfaces/matlab/installation_octave.md b/docs/interfaces/matlab/installation_octave.md new file mode 100644 index 0000000..236f60c --- /dev/null +++ b/docs/interfaces/matlab/installation_octave.md @@ -0,0 +1,37 @@ +--- +title: Installation (Octave) +layout: default +parent: Matlab / Octave +grand_parent: Interfaces +nav_order: 2 +--- + +## Installing package + +PIQP can be directly installed running the following command + +```matlab +pkg install "https://github.com/PREDICT-EPFL/piqp/releases/latest/download/piqp-octave.tar.gz" +``` + +Before using PIQP in Octave make sure to load it in your script with +```matlab +pkg load piqp +``` + +## Building and Installing from Source + +* Clone PIQP from Github +```shell +git clone https://github.com/PREDICT-EPFL/piqp.git +``` +* Package PIQP in Octave by executing the following commands +```matlab +cd interfaces/octave +package_piqp +``` +This will download all dependencies and package the Octave interface into a `piqp-octave.tar.gz` file. +You can then install the package with +```matlab +pkg install piqp-octave.tar.gz +``` diff --git a/docs/interfaces/octave/index.md b/docs/interfaces/octave/index.md deleted file mode 100644 index d6016d5..0000000 --- a/docs/interfaces/octave/index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Octave -layout: default -nav_order: 5 -parent: Interfaces ---- diff --git a/docs/interfaces/octave/installation.md b/docs/interfaces/octave/installation.md deleted file mode 100644 index 4a02a47..0000000 --- a/docs/interfaces/octave/installation.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Installation -layout: default -parent: Octave -grand_parent: Interfaces -nav_order: 1 ---- - -## Building from Source (on Linux) - -The PIQP Octave interface currently can only be built from source. To start with, -follow the instructions to [install Eigen and prerequistes](../../_common/building_from_source_deps.md) - -Then, from the piqp root directory do -``` -$ cmake -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_OCTAVE_INTERFACE=ON . -$ make -``` - -Then you can start Octave with -``` -$ LD_PRELOAD=[path-to-piqp]/interfaces/c/libpiqpc.so octave -``` - -When Octave starts, you also need to execute in Octave: -``` -octave:1> autoload("__piqp__", "[path-to-piqp]/interfaces/octave/piqp_plain.oct"); -octave:2> addpath("[path-to-piqp]/interfaces/octave"); -``` - -## Installing - -TODO - implement an install step in Cmake to put `libpiqpc.so` in a known shared library directory so the LD_PRELOAD isn't necessary. And also put the `piqp_plain.oct` and `piqp.m` files in areas for Octave to find. - -## Running - -In Octave you can now -``` -octave:3> help piqp -``` diff --git a/docs/interfaces/python/installation.md b/docs/interfaces/python/installation.md index acc8ade..ae7863b 100644 --- a/docs/interfaces/python/installation.md +++ b/docs/interfaces/python/installation.md @@ -28,9 +28,9 @@ conda install -c conda-forge piqp ### Building and Installing PIQP -* Clone PIQP from Github recursively +* Clone PIQP from Github ```shell -git clone https://github.com/PREDICT-EPFL/piqp.git --recurse-submodules +git clone https://github.com/PREDICT-EPFL/piqp.git ``` * Building and installing PIQP ```shell