Problem of linking the latest version of OpenKIM to MDStresslab

In an effort to construct the stress field using many-body potentials, I stumbled upon your useful software packages. However, when compiling MDStresslab, the manual asks to fill in the KIM_DIR variable within Makefile (I also attach this file for your ref.). However, when running one example, I encountered the following error:

The Model shared library file is not readable for Model name: ‘LJ_Smoothed_Bernardes_1958_Ar__MO_764178710049_001’.

  • Error: at line 110 in mod_kim.F90
    Message: kim_api_file_init
    KIM_STATUS_MSG: unsuccessful completion


And the Makefile is below

KIM_DIR = /home/hoang/build/kim-api
KIM_CONFIG_HELPER = kim-api-v1-build-config
#KIM_CONFIG_HELPER = ~/codes/kim-api-v1.7.3/src/utils/kim-api-v1-build-config
CC = (shell (KIM_CONFIG_HELPER) --cc)
CXX = (shell (KIM_CONFIG_HELPER) --cxx)
FC = (shell (KIM_CONFIG_HELPER) --fc)
LD = (shell (KIM_CONFIG_HELPER) --ld)
INCLUDES = (shell (KIM_CONFIG_HELPER) --includes)
CFLAGS = (shell (KIM_CONFIG_HELPER) --cflags)
CXXFLAGS = (shell (KIM_CONFIG_HELPER) --cxxflags)
FFLAGS = (shell (KIM_CONFIG_HELPER) --fflags)
LDFLAGS = (shell (KIM_CONFIG_HELPER) --ldflags)
LDLIBS = (shell (KIM_CONFIG_HELPER) --ldlibs)
OBJONLYFLAG = (shell (KIM_CONFIG_HELPER) --objonlyflag)
OUTPUTINFLAG = (shell (KIM_CONFIG_HELPER) --outputinflag)


The program in the MDStressLab website is compatible with an older version (v1.7) of KIM. I am assuming you are using KIM 2.0. Please see below for a KIM 2.0-compatible MDStressLab++ that is now in C++:

  • Nikhil Admal

Thank you Dr. Admal for sharing this version of MDStressLab. Is this version compatible with all OpenKIM 2x versions or only with 2.0?

Since there was not an instruction for installation, I simply issued a cmake command at the main folder. Howeever, the process encountered an error when “InteratomicForces.cpp” being built.

“No rule to make target ‘kim-api-NOTFOUND’, needed by ‘src/’. Stop.”

I assume this was due to the version compatibility?

Update: I was able to link MDstresslab++ with OpenKim 2.0.2. One difference I notice about the in the previous version, there were six entries for the initial and final structures. However, in this new version, they are incorporated in the 9-entry lines. Does this mean that the velocities of the final structure are ignored?


You are right, the configuration input file ( indeed has 9 entries. The first three columns correspond to the deformed configuration, the next three to velocity, and the final three to the reference configuration.

The reference configuration (columns 6-9) is needed only if you request for a Piola–Kirchhoff stress. On the other hand, for a Cauchy stress, which is independent of the reference configuration, columns 6-9 are not required. Let me know if you have any more questions.