Installation

Installing binary wheel from PyPI

If you are running a Linux system and are only interested in non GPU-enabled build, you can install binary wheel from PyPI as usual:

pip install ising

Unfortunately, we cannot provide GPU-enabled binary wheel due to a manylinux PEP-513 policy, as it is impossible to build ising on CentOS 5.

Building from source

If you are not running Linux and/or are interested in a GPU-enabled build, you need to build ising from source. The process is simple and requires running a single command. We highly recommend using virtual environment instead of installing the package into the global scope. Note that otherwise installing the package may require root privileges.

Prerequisites

To build ising you need the following:

  • Virtually any C and C++ compiler,
  • A Fortran compiler. The build script supports PGI, Intel, and gfortran compilers.
  • Working CUDA toolkit. For CPU based implementation only its thrust library with OMP_DEVICE_BACKEND is used, but nvcc is still required for compiling sources. You can get around this requirement and use your local installation of thrust if you use GNU fortran compiler.
  • numpy Python package installed in the same environment as is used to run the build process.
  • Python development headers.

In addition, to build a GPU-enabled version you need PGI CUDA Fortran. Our package was tested against CUDA 9.2 and CUDA 10.0.

Building and installing

To build the ising package download its source code and run install.py script as follows:

python install.py --fcompiler=<fortran_compiler> [--usecuda]

where <fortran_compiler> is one of pgi, intel, gfortran. The --usecuda switch can be used to enable GPU support. Note that --usecuda requires --fcompiler=pgi.

The script should take care of building extensions and installing package, so after running the above command ising package should be ready to use.