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.

amir.mbi | Mon, 09/16/2019 - 17:14

If you use windows 10, you can install Windows Subsystem for Linux from this link:

after that you can install ubuntu terminal in your windows from windows 10 store.

then by running ubunutu terminal, the LIGGGHTS can be installed with the code as follows:

sudo apt-get install liggghts

WassDh | Wed, 10/30/2019 - 04:54

I am trying to Install LIGGGHTS on windows 10 following this method but without much success.

I followed the instructions step-by-step (no SuperQuadratic option), I used VS 2019 , MPICH2 and VTK 7.1.1with the configurations mentioned by richti83, I also added the provided Cmake files. The error I get is when I build the ALL_BUILD with VS - I receive :

-Error C1128 number of sections exceeded object file format limit: compile with /bigobj liggghts C:\LIGGGHTS380-CMAKE\CMAKE-BUILD_SYSTEM\LIGGGHTS-PUBLIC\src\contact_models.h 158
(And when I build it again it says Error C1128 number of sections exceeded object file format limit: compile with /bigobj liggghts C:\LIGGGHTS380-CMAKE\CMAKE-BUILD_SYSTEM\LIGGGHTS-PUBLIC\src\fix_wall_gran_base.h 369)

-Error D8040 error creating or communicating with child process liggghts C:\LIGGGHTS380-CMAKE\CMAKE-BUILD_SYSTEM\LIGGGHTS-PUBLIC\src\build2\cl 1

I am new to all this and have no idea how I can solve this issue. Any help would much be appreciated.

Thank You,

richti83's picture

richti83 | Thu, 10/31/2019 - 20:09

did you enable a lot of contact-model combinations ? I guess adding /bigobj to the compiler or linker flags as stated in the error message should work.
I can not test VS>2015 bc. I've no access to Dreamspark / M$ Imagine.