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 (http://www.mpich.org/static/downloads/1.4.1p1/mpich2-1.4.1p1-win-x86-64.msi) , MS MPI is not tested but should work too.
optional download and install vtk 8.0.1 (http://www.vtk.org/files/release/8.0/VTK-8.0.1.zip), configure with following flags:

cmake -DBUILD_TESTING:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=../install -DModule_vtkIOMPIParallel:BOOL=ON -DVTK_Group_MPI:BOOL=ON -DVTK_Group_Rendering:BOOL=OFF -DVTK_RENDERING_BACKEND:STRING=None -DVTK_USE_X:BOOL=OFF -DModule_vtkIOMPIImage:BOOL=ON -DModule_vtkParallelMPI:BOOL=ON -G "Visual Studio 14 2015 Win64" ..\

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

main steps
Download LIGGGHTS-PUBLIC-master: https://codeload.github.com/CFDEMproject/LIGGGHTS-PUBLIC/zip/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,
Christian.

note: to enable SQ you need boost and you have to patch math_extra_liggghts_superquadric.cpp see https://www.cfdem.com/forums/some-notes-v-380

AttachmentSize
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.