LIGGGHTS Installation Guide for Ubuntu 12.04 LTS and 13.04

Submitted by rahulsoni on Mon, 09/09/2013 - 08:09


Fairly the whole credit goes to the writers of previously existing posts especially Paul.

  1. ##Installing Libraries g++ and git-core
  2. sudo apt-get install libvtk5-dev libeigen2-dev libopenmpi-dev g++ git-core

    Following two lines have helped me trobleshooting some errors in installing in ubuntu 14. (Instead of make ubuntuVTK, I tried make fedora for this case).
    sudo apt-get install build-essential git
    sudo apt-get install openmpi-common openmpi-bin libopenmpi-dev

    ##Checking installations
    which mpirun
    /usr/bin/mpirun comes up?
    which mpic++
    /usr/bin/mpic++ comes up?
    mpic++ -v
    gcc-Version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) comes up at the last line?

    ##Installing cmake
    sudo apt-get install cmake
    sudo apt-get install cmake-curses-gui

  3. ##Installing VTK
  4. Download vtk-5.8.0.tar.gz from
    Note: If VTK-5.8 not found then download it from here
    Extract downloaded folder into home directory
    cd /home/"user"/VTK
    sudo cmake .
    Note: 1. If you find difficulty or error in configuring, it is recommended to change INSTALL_PREFIX. Do ccmake /home/"user"/VTK, and then change the CMAKE_INSTALL_PREFIX from /usr/local to /usr. Then, enter c to configure and g to generate.
    2. If you find the error error: 'S_IFLNK' undeclared (first use in this function) then a small commit ( can fix the issue. Refer to
    sudo make
    sudo make install
    The last instructions will install .h, .a and .cmake files under /usr/local, such as /usr/local/include/vtk-5.8 and /usr/local/lib/vtk-5.8. For convenience of upgrading, it would be useful to create symbolic links of /usr/local/include/vtk-5.8 and /usr/local/lib/vtk-5.8 in the global environment:
    cd /usr/local/include
    sudo ln -s vtk-5.8 vtk
    cd /usr/local/lib/
    sudo ln -s vtk-5.8 vtk
    After installing VTK, go to the directory where cmake is installed, e.g. /usr/share/cmake-2.8. Then, go to the subdirectory Module and open the file FindVTK.cmake and you will see the following lines:
    # The following cache entries must be set by the user to locate VTK:
    # VTK_DIR - The directory containing VTKconfig.cmake.
    At the end of the messages (it could be after (# License text for the above reference.)) add in a new line:
    SET (VTK_DIR "/usr/local/lib/vtk")

  5. ##Installing LIGGGHTS
  6. git clone $HOME/LIGGGHTS-PUBLIC

    ##Compiling LIGGGHTS with jpg, png support
    gedit /$HOME/LIGGGHTS-PUBLIC/src/MAKE/Makefile.ubuntuVTK
    add "-DLAMMPS_JPEG" then give a tab followed by "-DLAMMPS_JPEG" in line 28
    add "-I/usr/include" in line 59
    add "-ljpeg" then give a tab followed by "-lpng" in line 61
    replace vtk version 5.2 with installed version 5.8 (or if any other is installed) in line 68
    Similarly, for creating movie file add "-DLAMMPS_FFMPEG" after a tab in line 28. For this you will need FFMPEG package in Ubuntu. See and for installing FFMPEG in Ubuntu. Orelse, you can enter following command:
    [sudo add-apt-repository ppa:jon-severinsson/ffmpeg
    sudo apt-get update
    sudo apt-get install ffmpeg
    sudo apt-get install frei0r-plugins

    if [ $(cat /etc/*-release | grep "DISTRIB_CODENAME=" | cut -d "=" -f2) == 'trusty' ];
    then sudo add-apt-repository 'deb trusty main' && sudo add-apt-repository 'deb saucy main' && sudo apt-get update
    cd /home/"user"/LIGGGHTS-PUBLIC/src
    sudo make clean-all
    sudo make ubuntuVTK or make fedora
    For problem compiling liggghts 3.0 please refer to

After successful compiling liggghts:
sudo ln -s /$HOME/LIGGGHTS-PUBLIC/src/lmp_ubuntuVTK /usr/bin/liggghts
sudo gedit ~/.bashrc
Add following lines (with appropriate path) at the end of file and save it.
alias "liggghts=/path to LIGGGHTS-PUBLIC/src/lmp_ubuntuVTK"

Open new terminal and type
Liggghts comes up, telling version, compiling date etc.

  • ##Checking LIGGGHTS for a simulation
  • cd /home/"user"/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/chute_wear
    liggghts < in.chute_wear
    Simulation will create dump files in the post folder.

  • ## Install LPP for postprocessing
  • sudo apt-get install python-numpy
    sudo git clone $HOME/LPP
    gedit ~/.bashrc
    add at the bottom alias lpp="python $HOME/LPP/src/"

  • ##Checking the lpp installation
  • Open new terminal
    cd /home/"user"/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/chute_wear/post
    lpp dump*.chute
    .vtk files will be created in the post folder which can be used later for visualization of simulation in paraview.

  • ##Install Syntax Highlighting for gedit
  • cd ~
    tar -zxvf language-specs.tar.gz?attredirects=0
    sudo mv $HOME/language-specs/liggghts.lang /usr/share/gtksourceview-3.0/language-specs

  • ##Installing paraview
  • Note: sudo apt-get install paraview install an older version of paraview, which in my case was crashing while opening a .stl file. .stl file represents geometry in LIGGGHTS simulation. I don't about others but in my case it was crashing. So, I decided to install paraview 4.

    Download the latest binary installer tar.gz file of paraview from
    Extract the tar.gz file in the same directory
    cd /home/"user"/Downloads {if the tar.gz is downloded in Downloads directory otherwise cd to appropriate directory}
    sudo cp -r ParaView-4.0.1-Linux-32bit /opt/ {Check the folder name for any corrections; make corrections according to 64 bit version}
    Check if it is installed by
    cd ~
    /opt/ParaView-4.0.1-Linux-32bit/bin/paraview {correct for 64 bit paraview}
    Paraview should open up now
    Add the PATH to bashrc file, so that paraview opens only by entering paraview
    gedit ~/.bashrc
    Add the following line at bottom
    export PATH=/opt/ParaView-4.0.1-Linux-32bit/bin/:$PATH {correct for 64bit paraview}
    Check if paraview installed by entering paraview in new terminal. Check the version of paraview at the top.
    Note: if you have installed any other version of paraview earlier then opening paraview through Dash Home may open a different version.

  • ##Checking the simulated results
    In paraview, open folder /home/"user"//LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/chute_wear then select all .stl files. Again, in paraview open folder /home/"user"/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/chute_wear/post and open all .vtk files.
    Click on Apply they play simulation.
  • ##Enabling parallel processing in LIGGGHTS
  • see processors command in manual to add feature in in.script
    gedit ~/.bashrc
    add at the bottom export WM_NCOMPPROCS=2 (where is the number of processors in your pc)
    command to initiate simulation with parallel computing mpirun -np 2 liggghts -in in.script