Obtaining KIM Models

In order to use KIM Portable Models (PMs), which may depend on Model Drivers (MDs), or Simulator Models (SMs) on your system, you must install the KIM application programming interface (API) along with the specific models that you are interested in using. There are two options for doing so:

Installing from Pre-built Binaries

The easiest option for obtaining the KIM API and KIM models is to install the openkim-models pre-compiled binary package for your preferred operating system or package manager. When you install the openkim-models package, the package manager will automatically install the KIM API shared library as a required dependency.

Packaging status

The table to the right lists the systems for which pre-compiled binaries are available. For each system, the currently available version (release date) of the openkim-models package is listed. Green indicates the most current version available, whereas red indicates an older version. Binary packages are released on a regular basis, however if the model you require is not contained in the current version, you can install a model from source as explained below.

The commands necessary to install from binary on the various supported systems are:

Fedora Linux
$ sudo yum install openkim-models

Thanks to Christoph Junghans (LANL) for helping make Fedora binaries available.

Homebrew macOS
$ brew install openkim-models

Thanks to Ryan Elliott (UMN) for helping to make macOS Homebrew binaries available.

openSUSE Linux

On openSUSE, in order to have access to the kim-api-collections-management (and other utilities), you must also explicitly install the kim-api package.

$ sudo zypper install kim-api openkim-models

Thanks to Christoph Junghans (LANL) for helping make openSUSE binaries available.

Ubuntu Linux

On Ubuntu, currently binaries are only available from the openkim/latest Personal Package Archive (PPA). The commands necessary to setup the PPA on your system are:

$ sudo add-apt-repository ppa:openkim/latest
$ sudo apt-get update

On Ubuntu, in order to have access to the kim-api-collections-management (and other utilities), you must explicitly install the libkim-api-dev package.

$ sudo apt-get install libkim-api-dev openkim-models

Thanks to Anton Gladky (gladky.anton at gmail.com) for helping to make Ubuntu binaries available.

FreeBSD Ports
$ sudo pkg install openkim-models

Thanks to yuri@freebsd.org for helping make FreeBSD ports available.

Conda

On Conda-Forge, there are three packages available kimpy, kim-api, and openkim-models. The Python bindings to the kim-api is called kimpy and depends on kim-api. So kim-api will be installed along with kimpy.

$ conda install kimpy openkim-models

Thanks to Jan Janssen (Max-Planck-Institut für Eisenforschung) for helping to make conda-forge packages available.

Spack (https://spack.io)

Spack is a package manager for supercomputers, Linux, and macOS. The below commands will get you started, but see the docs for more.

$ git clone https://github.com/spack/spack.git
$ ./spack/bin/spack bootstrap
$ source spack/share/spack/setup-env.sh
$ spack install openkim-models
$ spack activate openkim-models
$ spack load kim-api

Thanks to Christoph Junghans (LANL) and Ryan Elliott (UMN) for helping make Spack support available.

Installing from Source

If binaries are not available for your system or you wish maximum control over the installation process, you can download the source code for the KIM API and any desired PMs/MDs/SMs, compile, and install them. This will require you to have the necessary compilers and build tools available on your system. Typically, this includes the GNU C, C++, and Fortran compilers (gcc, g++, and gfortran), as well as CMake version 3.4 or newer (cmake), make, xxd (which is part of the vim or vim-common package depending on the system), wget, tar, and various standard utilities from the coreutils package.

NOTE: If you already have the openkim-models package installed and are only interested in installing a version of a model not available in the current binary release, then you can skip the next step of building and installing the KIM API (since the kim-api package is already installed as a dependency of openkim-models) and you can proceed to installing KIM models from source.

Installing the KIM API from Source

The KIM API currently supports Unix/Linux and macOS systems. (Support for MS Windows is under development, but is not available yet.) Installation from source involves downloading the kim-api package, unpacking it, and following instructions to compile and install the code. The process requires a Unix/Linux or macOS system with CMake and compilers and standard utilities as noted above.

To install the KIM API do the following:

  1. Download the latest version of the API:
    Download kim-api-2.1.3.txz — released 2019/08/16
  2. Unpack the archive.

    • On Unix/Linux and macOS systems, type:

      $ tar Jxvf kim-api-2.1.3.txz
      

      which will expand the archive into the directory ./kim-api-2.1.3/

  3. Read the README.md file in the new directory.

  4. Read the NEWS file to see what is new in the current release.

  5. Install the package. (For complete instructions see INSTALL file.)

    • Quick start: try the following

       $ cd kim-api-2.1.3
       $ mkdir build
       $ cd build
       $ cmake .. -DCMAKE_BUILD_TYPE=Release
       $ make
       $ sudo make install
       $ sudo ldconfig
      

      (Make sure you know what you are doing when using sudo. Here, it should be safe.)

Installing KIM Models from Source

Once the KIM API is installed, the next step is to install the KIM models that are to be used with a KIM-compliant simulation code.

The KIM API supports four "collections" of PMs, MDs, and SMs. These are the "system-collection", the "user-collection", the "environment-variable-collection", and the "CWD-collection". This provides the user with a great deal of flexibility on where models will be installed on their machine. See the INSTALL file in the kim-api package root directory for more information on collections. The pre-compiled openkim-models package installs items in the system collection. To avoid any possible clashes between the operating system's package manager and the items installed from source, it is suggested that the latter be installed to the user collection.

The KIM API comes with the kim-api-collections-management utility (available from version 1.9.0 on) to install and manage KIM Items. Dependencies on MDs are automatically handled. For example, to install the Stillinger-Weber potential for silicon in the system collection do:

$ kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_005

Note that this model requires a MD (SW__MD_335816936951_004), which will be automatically downloaded and installed.

To see the list of the PMs, MDs, and SMs installed on the system do:

$ kim-api-collections-management list

Type kim-api-collections-management with no arguments, for a full list of supported options.