Python
The easiest way to install the python version is using pip:
pip install scs
You can also install directly from source
git clone --recursive https://github.com/bodono/scs-python.git
cd scs-python
python -m pip install .
Apple Accelerate (macOS)
On macOS the Apple Accelerate backend is built and included automatically — no extra install flags are needed. It uses the Accelerate framework’s sparse LDLT solver, which is optimized for Apple hardware including Apple Silicon. See here for how to select Accelerate when solving.
MKL
If you have MKL, you can install the MKL Pardiso interface using
python -m pip install -Csetup-args=-Dlink_mkl=true .
See here for how to enable MKL when solving. MKL is typically faster than the built-in linear system solver.
The published Linux x86_64 wheels prefer the threaded MKL variant and include
the Intel OpenMP runtime (libiomp5). Windows currently falls back to
sequential MKL until Intel fixes the threaded pkg-config metadata in
its conda packages.
To use 64-bit BLAS/LAPACK integers (ILP64 / BLAS64) with any supported
BLAS/LAPACK library, install with:
python -m pip install -Csetup-args=-Duse_blas64=true .
If you combine BLAS64 with the MKL Pardiso backend, SCS requires
64-bit SCS integers as well (the default in the Meson build). At runtime SCS
also checks that the process-wide MKL interface layer matches the LP64/ILP64
mode it was compiled for, and fails early if another library already set an
incompatible MKL interface.
GPU
If you have a GPU and cuDSS installed you can install the GPU direct sparse solver using
python -m pip install -Csetup-args=-Dlink_cudss=true -Csetup-args=-Dint32=true .
See here for how to enable the GPU when solving. The sparse direct GPU solver is typically very fast.
See here for an example colab where the cuDSS version of SCS, along with required dependencies, is installed and used.
Spectral cones
To enable spectral cone support (log-determinant, nuclear norm, \(\ell_1\) norm, sum-of-largest-eigenvalues), install with:
python -m pip install -Csetup-args=-Duse_spectral_cones=true .
This requires LAPACK (enabled by default). See python_spectral_cone_keys for the cone dict keys.
Testing
To test that SCS installed correctly, and you have pytest installed, run
python -m pytest .
See here for the full SCS python API.
Legacy options
You can install with OpenMP parallelization support using
python legacy_setup.py install --scs --openmp
You can install the GPU indirect solver using
python legacy_setup.py install --scs --gpu