Tutorial for SKMF

How to compile and run the code

Linux and OS X

  • input.txt and main.cpp should be saved in the same folder
  • compilation on Linux and OS X: g++ main.cpp -o skmf
  • running (e.g. in bash shell): ./skmf


The quickest way to try the software on Windows is to download the SKMF.exe and input.txt files, copy them to the same folder, then run SKMF.exe .

Alternatively, if you would like to see the code and compile yourself, download the provided main.cpp and input.txt files and copy them to the same folder.

Installing Code::Blocks and opening main.cpp

The program code is written in C++. To compile it on Windows, we recommend installing the open source Code::Blocks IDE (integrated development environment). Download the binary release from the following link:

Download the codeblocks-XX.YYmingw-nosetup.zip file, where XX.YY is the current version number (16.01 on 28/04/2016). Extract the downloaded .zip file and run codeblocks.exe .

In Code::Blocks open the downloaded main.cpp file under File -> Open.

Open main.cpp file in Code::Blocks
Changing to C++11 standard

The program code uses C++11 standard, the compiler must be set accordingly.
Go to Settings -> Compiler...

Go to Settings -> Compiler...
Go to Settings -> Compiler...

Under Compiler Settings -> Compiler flags tick the box next to the "Have g++ follow the C++11 ISO C++ language standard [-std=C++11]" line, then click the OK button.

Setting C++11 standard
Tick the box next to C++11 standard, then click OK
Compiling and running the code

To create an executable .exe file press Ctrl+F9 or click on the yellow gear icon in the top row.

To create an .exe file click on the yellow gear icon
Click on the yellow gear icon

Go to the folder where you copied the input.txt and main.cpp files and run the newly created main.exe file.

The software is running
The software is running

Visualizing the results

The SKMF software's output file is in extended .XYZ file format. To visualize the results we recommend OVITO, The Open Visualization Tool which is available to all major operating systems, including Microsoft Windows, MacOS and Linux.

To get help in the first steps of using OVITO to visualise the results of the simulations, please go to our OVITO tutorial page.