Compilation error No such file or directory

Trying to compile [ex__test___ar__fcc__cluster__cpp]
by entering the following command in cmd: gcc ex_test_Ar_fcc_cluster_cpp.cpp -o main

But i get the following error:

ex_test_Ar_fcc_cluster_cpp.cpp:33:11: fatal error: KIM_SimulatorHeaders.hpp: No such file or directory
33 | #include “KIM_SimulatorHeaders.hpp”

Hello,

You should be using the cmake command to build the software in the kim-api package. Instructions for building and installing the kim-api from source can be found here: OpenKIM · Obtaining KIM Models · Interatomic Potentials and Force Fields

Actually, I have installed the package using the binaries (as per the above screenshot). Do i still need to follow the instructions in “Installing the KIM API from Source”?

OK, great. No you should not need to build from source in that case.

In this case, I suggest you install the “doc” package and the build the example from there:

sudo apt-get install libkim-api-doc
cd /usr/share/doc/libkim-api-dev/examples/simulators/ex_test_Ar_fcc_cluster_cpp
mkdir build
cd build
cmake ../
make

I’m afraid I haven’t had time to test the above myself, but I think those commands are all correct. Let me know if it doesn’t work.

1 Like

Works! Thank you!