Skip to the content.

KineticGas is available on PyPi as the pykingas package, for python versions 3.8-3.11, compiled for MacOS running on Apple Silicon, Linux and Windows.

For MacOS running on Intel, or other operating systems, KineticGas must currently be built from source.

Dependencies

The Python package dependencies are listed in the setup.py file in the root directory of the package.

To compile the binary that is called from the python wrapper, pybind11 is required.

A standalone C++ module, that works without the python wrapper is currently under development. See branches under pure_cpp/ for the most up-to-date version there.

Building from source

A build system using cmake and make is set up to support Mac, Linux and Windows. For Mac machines running on intel chips, one compiler flag must be modified.

First Try - For Mac/Linux

If all goes well, running

bash cpp/build.sh
pip install .

From the top level directory should provide you with an installation of the KineticGas python package pykingas.

For Mac’s running on an intel chip, the compiler flag -arch arm64 which is set in cpp/CMakeLists.txt must be removed or changed to -arch x86_64.

Short explanation

The bash script cpp/build_kingas.sh uses cmake and make to compile the binary that is called from the python module. Then it moves the binary to the pykingas directory.

When something goes wrong

For Windows

Running cmake from the cpp directory should produce an MSVC solution file. Building this solution should generate the file KineticGas_r.cp<python-version>-win_amd64.pyd which will be displayed as a “python extension module”. Copy this file to the pykingas directory, and run pip install . from the top-level directory (where setup.py) is found.