Asking for help in the install of Openkim in LAMMPS for Ubuntu

These days i try to install OpenKIM in the LAMMPS in the Ubuntu system. i use to install LAMMPS, and add KIM in the cmake code. the installation finally succed, but i found that not all the example in the /LAMMPS/examples can be held.
For some examples, the LAMMPS cannot runs and it mentioned that it cannot find the model name. I wonder whether this installation of KIM have the full package of KIM collection.
i try to use , but return no such command.
thanks for helps.

this is the first time for i to searching in this forum. after searching in this forum, i found another installation method which i don’t want to use the first time i see. the link is
when using this method, should i install the LAMMPS before the installation of OpenKIM? should i enable the KIM pacage in the installation of LAMMPS?

在 2019年12月20日星期五 UTC+8上午9:11:30,Hervé Y.写道:

hi @Hervé,

In UBUNTU, to use kim-api-collections-management first it should be in the PATH. This is explained in the INSTALL file at as well as in the kim-api package INSTALL file, line 375.

You can employ the “kim-api-activate” utility to set up the PATH and bash-completion as

source ${HOME}/local/bin/kim-api-activate

If you do not know where did you install kim-api-activate, you can also use the ‘locate’ command.
sudo apt-get install locate should install the ‘locate’ command if you do not have it on your system.

Then you can use the utility to automatically install any extra models.

Hope this helps.

Kind regards,

hi @Hervé

when using this method, should i install the LAMMPS before the installation of OpenKIM?

If you are installing from the source. To activate OpenKIM in LAMMPS, you should have it installed on your system. Please follow the instruction to install the KIM API from source,
After the KIM API package is installed, and if you use a non-standard PATH to install the KIM-API, you should use the “kim-api-activate” utility to set up the PATH and bash-completions. The activate script adds the utilities to the executable PATH, please read the section “D” in the INSTALL file for more information.

Hope this helps.
Kind regards,

Thanks for help, i’ll try it

在 2019年12月20日星期五 UTC+8上午11:16:39,Yaser Afshar写道:

Thanks for your help
i follow the D.1 the typical build scenario, and succed. so i think that i don’t have to use the “kim-api-activate”, however, when i finish this process, and begin the “cmake” of LAMMPS, it returns this:

KIM-API package not found. Default behavior set to download and build our
Call Stack (most recent call first):
CMakeLists.txt:335 (include)

– KIM-API download requested - we will build our own

before, when i haven’t noticed the “kim-api-activate”, i add these folds into environment by editing the bashrc with PKG_CONFIG_PATH, as mention inthe LAMMPS documentation 3.7.3. here the link

and a i have:

root@DESKTOP-EOHDBIH:/lammps/build# echo $PKG_CONFIG_PATH

now i realize that this step is unnecessary, however, it seems it doesn’t work either.

在 2019年12月20日星期五 UTC+8上午11:16:39,Yaser Afshar写道:

hi @Hervé
I checked on ubuntu version 17.10 and did a fresh install following the instructions. Everything works fine for me. Just a minor thing that might be a problem with some Ubuntu versions. If you did a standard installation, it might happen that the /usr/local/bin where kim-api-collections-management is installed on ubuntu is not in your path and that is why you can not find kim-api-collections-management. You can resolve this simply by

echo "PATH=\$PATH:/usr/local/bin" >> ~/.bashrc

After that, please open a new terminal and you should be fine.

If this was not helpful and could not resolve your problem, please let me know in more detail everything you did plus your ubuntu version and we can help you with this.

Hi @Yaser
I am very grateful for your help.
i started again from a fresh install ubuntu, and i have used the code to add the path into .bashrc that you provieded, but during the “cmake” step for LAMMPS, it still mentioned that “the KIM-package not found. we will download and build our own”
my ubuntu version is 18.04.3 LTS
and here is the details where i began from a fresh new ubuntu system.

sudo passwd root su

after that, all the operation is using root
i am a Chinese user, so i change the souce list by a mirror source for China provided by Aliyun.
after that :

sudo apt-get update sudo apt-get upgrade
apt install build-essential; apt install cmake
apt install gfortran apt update
$ apt upgrade

here i upgrade my ubuntu system and install some basic software. then i reboot the system.
then i download mpich3 from their official website and install it.

$ tar -zxvf mpich3.tar.gz

cd mpich ./configure --enable-shared=yes

$ make

$ make install

then i follow the D.1 Typical Build Scenario to install the KPI-API, but i didn’t delete the build folder as suggesting in the D.1.
and the example provided in the D.1 can be held.

then i use the lammps-stable.tar.gz download from their official website. because use the code “git” to get LAMMPS is too slow here. the LAMMPS version is 7Aug19.
then i unpackage it in the main folde (/home/herve)

cd lammps mkdir build
$ cd build

before the cmake, i use the presets of all_on.cmake, but i delete all the user package and other package i don’t need, and there are BODY KIM MANYBODY MOLECULE MPIIO in the cmake file.
then i use the code
$ echo “PATH=$PATH:/usr/local/bin” >> ~/.bashrc

close the terminal, open another ternimal, use su to get root, and return to the /home/herve/lammps/build folder
then i use

$ cmake -C …/cmake/presets/all_on.cmake -D PKG_GPU=off …/cmake

and the feedback including “the KIM-package not found. we will download and build our own”

in fact, during the process, i have used 3 or four time $ echo “PATH=$PATH:/usr/local/bin” >> ~/.bashrc
i don’t know whether this matter.

Thanks again for your patience.

在 2019年12月20日星期五 UTC+8下午10:14:50,Yaser Afshar写道:

Hi Hervé,

(1) If you did follow section D.1 of the KIM API install instructions (to install system-wide), you should have the following directory and file:


Can you confirm that these exist? This will confirm that the KIM API build/install succeeded.

(2) If you issue pkg-config --list-all | grep "libkim", what do you get? If LAMMPS is unable to locate your KIM API installation, it’s almost certainly because pkg-config can’t find it.