Skip to content

Latest commit

 

History

History
121 lines (87 loc) · 4.21 KB

installation.rst

File metadata and controls

121 lines (87 loc) · 4.21 KB

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 :py:mod:`numpy`, :py:mod:`scipy`, :py:mod:`pandas`, :py:mod:`matplotlib` and :py:mod:`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:

.. tabs::

    .. group-tab:: Windows

        - 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

        .. code-block:: console

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

        If the number is :code:`MSC v. 1916`, you need to
        `download <https://visualstudio.microsoft.com/de/vs/older-downloads/>`_
        and install Microsoft build tools 2017,
        if it is :code:`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.

    .. group-tab:: Linux

        - As of now, no wheels yet (but we hope to provide them soon).
        - Before installing, make sure the ``gcc`` compilers are installed.
        - When using Anaconda, Miniconda, or some other derivative,
          you might have to additionally install
          the package :py:mod:`gxx_linux-64`.
          Otherwise, the installation steps are the same as under Windows.

        .. code-block:: console

            conda activate my_env
            conda install numpy scipy pandas matplotlib cython gxx_linux-64
            pip install sgamesolver

    .. group-tab:: MacOS

        - Unfortunately, we have neither experience nor an opportunity
          to test this setup.
        - Your best bet will be to find a guide on how to compile cython modules
          on MacOS, follow instructions and then install sGameSolver as above.
        - If you are having trouble relating to OpenMP support, check below
          how to install without.
        - If all else fails, you can install without Cython altogether (see below).


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

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