alternative CMake build environment

richti83's picture
Submitted by richti83 on Thu, 09/13/2018 - 13:41

As some people having difficulties to build LIGGGHTS(R) with windows I'm releasing an alternative CMake file to configure and build LIGGGHTS(R) on any platform.
Preliminary steps
I suggest at least MS VisualStudio 14 (2015) as it comes with erf.h and some other necessary headers.
I'm using MPICH2 for multiprozessing ( , MS MPI is not tested but should work too.
optional download and install vtk 8.0.1 (, configure with following flags:


open project, change to release build and than build the solution.

main steps
Download LIGGGHTS-PUBLIC-master:
Download attached cmake files, extract the archive in LIGGGHTS-PUBLIC/src/, overwrite existing CMakeLists.txt
I recommend using CMAKE>=3.7.1, using cmake-gui, point "Where is the source code" to LIGGGHTS-PUBLIC/src/, "Where to build binaries" to "/LIGGGHTS-PUBLIC/src/build", say yes to create the build folder.
Hit configure, select Generator of your choice (VS 14 2015 Win64).
Enable contact models by your choice.
Optinal enable vtk and point to vtk/build/ folder of preliminary step.
Hit configure again.
Check if mpi_library and mpi_extra_library is set correctly.
Hit Generate
Open Project, change to Release, build project
When all is ok you'll get an liggghts.exe in LIGGGHTS-PUBLIC\src\build\Release\

good luck,

note: to enable SQ you need boost and you have to patch math_extra_liggghts_superquadric.cpp see

Plain text icon save and rename to CMake_patch.zip8.76 KB
Image icon my setting92.88 KB

amir.mbi | Sun, 02/10/2019 - 09:53

Thank you very much for preparing this manuscript. I could correctly install LIGGGHTS on windows 10 with MS MPI and VTK .

Can this method use with future version of LIGGGHTS ?

richti83's picture

richti83 | Tue, 02/12/2019 - 10:14

Can this method use with future version of LIGGGHTS ?
I don't know as I have no insight in future development of the code.