pystencils automatically searches for a compiler, so in most cases no explicit configuration is required. On Linux make sure that ‘gcc’ and ‘g++’ are installed and in your path. On Windows a recent Visual Studio installation is required. In case anything does not work as expected or a special compiler should be used, changes can be specified in a configuration file.

pystencils looks for a configuration file in JSON format at the following locations in the listed order.

  1. at the path specified in the environment variable PYSTENCILS_CONFIG

  2. in the current working direction for a file named pystencils.json

  3. or in your home directory at ~/.config/pystencils/config.json (Linux) or %HOMEPATH%\.pystencils\config.json (Windows)

If no configuration file is found, a default configuration is created at the above-mentioned location in your home. So run pystencils once, then edit the created configuration file.

Compiler Config (Linux)

  • ‘os’: should be detected automatically as ‘linux’

  • ‘command’: path to C++ compiler (defaults to ‘g++’)

  • ‘flags’: space separated list of compiler flags. Make sure to activate OpenMP in your compiler

  • ‘restrict_qualifier’: the ‘restrict’ qualifier is not standardized across compilers. For most Linux compilers the qualifier is __restrict__

Compiler Config (Windows)

pystencils uses the mechanism of setuptools.msvc to search for a compilation environment. Then ‘cl.exe’ is used to compile.

  • ‘os’: should be detected automatically as ‘windows’

  • ‘msvc_version’: either a version number, year number, ‘auto’ or ‘latest’ for automatic detection of latest installed version or ‘setuptools’ for setuptools-based detection. Alternatively path to folder where Visual Studio is installed. This path has to contain a file called ‘vcvarsall.bat’

  • ‘arch’: ‘x86’ or ‘x64’

  • ‘flags’: flags passed to ‘cl.exe’, make sure OpenMP is activated

  • ‘restrict_qualifier’: the ‘restrict’ qualifier is not standardized across compilers. For Windows compilers the qualifier should be __restrict