Installation KIMAPI on the server(CentOS7) without root access

I am writing to inquire about the installation process of KIMAPI. I have been trying to install it on the server to use hNN_WenTadmor_2019Grx_C__MO_421038499185_001, but I encounter a problem.

I followed the installation steps from the address (OpenKIM · Obtaining KIM Models · Interatomic Potentials and Force Fields) with two different methods. In the first method, I encountered a problem since the server does not allow the use of sudo in (sudo make install and sudo ldconfig).
In the second method, spack was used and KIMAPI version 2.2.1 was installed. But unfortunately, there is a limited number of force fields (I checked the path kim-api/portable-models/,simulator-models/). Is my installation incomplete? If not, is there a way to add the mentioned force field?

I would greatly appreciate your assistance with this matter. Thank you in advance for your time and help.

1 Like

Hi Masoud,

The first thing to try is the following command:

kim-api-collections-management install user hNN_WenTadmor_2019Grx_C__MO_421038499185_001

Let me know if that works and if not, what is the error message and we’ll go from there.

Cheers, ilia

1 Like

Hi ilia
Thank you for your guidance.
I executed this command but unfortunately, it took a long time and I did not receive any message.
Of course, I should also say that although Kimapi 2.2.1 was installed and I have access to some potentials, and with them the execution was without problems, but during the installation process through spack, I encountered two errors, one in the section:
./spack/bin/spack bootstrap
usage: spack bootstrap [-h] SUBCOMMAND …
spack bootstrap: error: the following arguments are required: SUBCOMMAND

spack activate openkim-models
==> Error: activate is not a recognized Spack command or extension command; check with ``spack commands’'.

Hi Masoud,

I have a couple of solutions for you that may work. First, it looks like the OpenKIM query site was down, which is why the command I gave you was hanging. You can try again and see if it works (after doing

source spack/share/spack/
spack load kim-api


If that doesn’t work, this is my first time using Spack, so I may be misunderstanding, but it looks like there are some issues with the instructions on that we will need to fix. Meanwhile, based on what happened when I tried the install on my local machine, I may have a temporary fix for you.

When you do

kim-api-collections management list

you will see a list of models that are installed, which will be the small amount of demonstration models as you said. Under “system collection”, it will show you the paths where the model-drivers, portable-models and simulator-models are located for that collection, which is somewhere under the Spack installation, for me


etc. for portable-models and simulator-models (for you it will be something obviously different on your HPC)

If you look around your spack folders, there should be an analogous folder for openkim-models (as opposed to kim-api). For example, for me all the openkim-models model drivers were installed in


etc. for portable-models and simulator-models

The problem is that the KIM API doesn’t know how to find these. You can point the KIM API to look in these places by setting the environment variable

export KIM_API_MODEL_DRIVERS_DIR=/home/ilia/spack/opt/spack/linux-ubuntu22.04-icelake/gcc-11.3.0/openkim-models-2021-01-28-ez5vqozbya5a44wmlj5sm2wadluaa4ut/lib/kim-api/model-drivers

(the last one is probably unnecessary since you’re trying to use a portable models that uses a driver)

You will have to set these environment variables at every login.
Another option is to just copy the items from the openkim-models folders to the kim-api folders.

Hopefully one of these options will work for you!

Cheers, ilia

I followed the above steps and the problem was solved. Thank you for guiding me in the best way :pray:

1 Like