Installation

sGameSolver can be installed using pip.

pip install sgamesolver

If you are using MacOS or a linux distribution, please check the according section under “Cython” below.

Installation with Anaconda

While sGameSolver works fine with the official Python distribution from python.org, we strongly recommend using Anaconda for numerical computations - the speedup provided by Anaconda was sizeable on our systems when using sGameSolver. If you do use Anaconda, make sure to install numpy, scipy, pandas, matplotlib and cython before installing sGameSolver. Otherwise, these dependencies will be installed by pip (rather than conda), which should be avoided. The sequence should thus be

conda activate my_env
conda install numpy scipy pandas matplotlib cython
pip install sgamesolver

Compiling Cython

The performance-critical routines that evaluate the homotopy function \(H\) and its Jacobian \(J\) are written in Cython. Parts of sGameSolver may thus need to be compiled during installation. The following should let you know if that applies for your situation, and if yes, how to prepare your system:

  • We provide wheels for Python versions 3.6–3.10 via PyPI. Wheels are pre-built, so usually no steps from your side necessary when installing via pip.

  • Should you want or have to compile anyway, first identify the compiler required for your version of Python. Activate your virtual environment and run python in a terminal; you should see a line like

>>> python
Python 3.XXX ... [MSC v.1916 64 bit (AMD64)]
>>>

If the number is MSC v. 1916, you need to download and install Microsoft build tools 2017, if it is 1900, you’ll need 2015. When installing, make sure to check “Windows 10 SDK” as well. Once that is done, you can install sGameSolver e.g. via pip.

Installing without OpenMP

  • OpenMP is a standard for parallel computing; parts of sGameSolver’s Cython code make use of it.

  • Most compilers (especially linux’ gcc, MSVC on windows) support it.

  • However, if you have a different setup and experience any related problems during installation, you can disable it by installing via:

pip install sgamesolver --install-option="--no-openmp"

Installing without Cython

  • If all else fails, you can install sGameSolver without Cython support – in that case, it will fall back to a numpy implementation of the respective functions, which will be considerably slower however.

  • To do so, make sure numpy, scipy, pandas and matplotlib are installed. Then run:

pip install sgamesolver --install-option="--no-cython" --no-deps