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:
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.
The table to the right lists the macOS and Linux systems for which pre-compiled binaries are available. For each system, the currently available versions of the openkim-models
and kim-api
packages are listed. Green indicates the most current version available, whereas red indicates an older version. (The openkim-models
snapshot source code archives are available here. See below for the kim-api
source.) 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:
$ brew install openkim-models
Thanks to Ryan Elliott (UMN) for helping to make macOS Homebrew binaries available.
|
|
---|---|
|
|
|
|
|
|
|
|
On Ubuntu, the most recent binaries are 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
On Ubuntu releases, such as 22.10 (Kinetic Kudu), binaries are also available (although they may be older than those available from the PPA). 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.
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.
$ sudo dnf install openkim-models
Thanks to Christoph Junghans (LANL) for helping make Fedora binaries available.
$ sudo pkg install openkim-models
Thanks to yuri@freebsd.org for helping make FreeBSD ports available.
There are two scripts available in the unofficial Arch User Repository (AUR). One for the kim-api
package and one for the openkim-models
package. Note, the AUR provides build-scripts (not precompiled binaries) that download the source and then build the package(s) on your machine.
To install, you will need to have the base-devel
, git
, and pyalpm
packages installed.
$ git clone -q https://aur.archlinux.org/kim-api.git
$ cd kim-api
$ makepkg -fsrim --noconfirm
$ cd ..
$ git clone -q https://aur.archlinux.org/openkim-models.git
$ cd openkim-models
$ makepkg -fsrim --noconfirm
Thanks for Daniel Schopf <schopf.dan at gmail dot com> for helping make the ARU ports available.
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.
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.
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.
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:
If desired, verify the signature of the source code archive.
Release tarballs are signed with Ryan S. Elliott's <relliott@umn.edu>
public key
(https://z.umn.edu/relliott_asc
[576D4997C4D51D92]).
To verify the release tarball, first download the public key and import it:
$ gpg --import relliott.asc
After downloading the tarball and signature, run:
$ gpg --verify kim-api-2.3.0.txz.asc kim-api-2.3.0.txz
Unpack the archive.
On Unix/Linux and macOS systems, type:
$ tar Jxvf kim-api-2.3.0.txz
which will expand the archive into the directory ./kim-api-2.3.0/
Read the README.md file in the new directory.
Read the NEWS file to see what is new in the current release.
Install the package. (For complete instructions see INSTALL file.)
Quick start: try the following
$ cd kim-api-2.3.0
$ 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.)
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.