Installation

KVP requires its C source files to be compiled to properly install. This is straight forward if you work with Linux or MacOS machines. It is also relatively simple on Windows, if you have some experience with compilers. This section describes the available instalation methods. It is recomended to use conda environments, since they come with pip pre-installed.

PyPI

The goal is to provide pre-compiled versions that can be installed by pip install, for as many platforms as possible.

pip install kvp     # In your conda environment of choice

Supportd platforms

Currently supported platforms are:

  • linux_x86_64 - Should be most Linux systems

  • win_amd64 - Should be most Windows systems

  • macosx_14_0_x86_64 - Older MacOS systems

  • macosx_14_0_arm64 - Newer MacOS systems

To know if any of the supported platforms includes yours, simply try to install the package. If pip gives you the package, then it is. If it does not, you may try the following section.

From source

Source install

This installation method adds the -march=native flag to the compilation process, which might make the low level procedures of the package marginally faster, should one actually care.

Download the repository and navigate to it from the terminal. Before installing, the C sources must be compiled or the package will raise an exception at import time.

The provided makefiles use the GNU C compiler, which is trivially installed in both Linux and MacOS systems, if not readily available after installing the operating system.

For Linux, simply run the makefile:

make

Makefile issues

If this says “nothing to be done for target” or something similar, navigate to the kvp/src folder and update any source file by, for example, adding and removing a whitespace. Proper makefiles should not have this issue, but this is not a proper makefile indeed.

For MacOS, add the corresponding target so the name of the compiled binary is correct for your system:

make mac

This will create a compiled binary, i.e. a shared library, inside kvp/lib/ called libkvp-*.so, where the asterisk is a platform specific code.

Once the binary is successfully created, the package can be correctly installed with pip while in your conda environment of choice:

pip install .

For Windows, the process is also trivial if you happen to have the compiler installed and on your system PATH. If not, you can try one of the available options at the GNU website.

If you have the compiler, just type:

make

This will create the compiled binary libkvp-bill.dll at the correct location. The name is also important, it has to be that name.

Now, within your conda environment of choice, run pip:

pip install .