Tutorial Setup LIGGGHTS 3.6.0 on Ubuntu 16.x / Mint 18.x

PaulWinkler's picture
Submitted by PaulWinkler on Wed, 04/05/2017 - 13:21

Hi all,

Edit by Arno Mayrhofer: Please do not follow this outdated guide. Instead see the last post in this thread for details.

some time ago I posted tutorials for setting up LIGGGHTS on previous versions of Debian based Ubuntu and Linux Mint. Since the process for the last LIGGGHTS versions did not dramatically changed there was no update. Switching to Ubuntu 16.x based Systems (Linux Mint 18.x) some small changes were made and I want to provide an updated installation tutorial. It is not a fully automatic script, but there all commands noted you will need. So you can copy and paste the lines between the comments to the terminal. There are included some additional tools you may or may not use in combination with LIGGGHTS, VTK, PNG and JPG support are built in.


## Paraview 5.0.x, GNUplot 5.0.x, PovRay 3.7, Voro++ 0.4.x, Liggghts 3.6 on Mint 18.1 x64 (2017-04-04)
## [optional] 1. Install Voro++ 0.4.x by compiling
sudo apt install g++
cd ~
wget http://math.lbl.gov/voro++/download/dir/voro++-0.4.6.tar.gz
# visit http://math.lbl.gov/voro++/download if file version has changed
tar -zxvf voro++-0.4*.tar.gz
cd $HOME/voro++-0.4.*
make all
sudo make install
which voro++
/usr/local/bin/voro++ <- comes up?
#
## 2 Install Liggghts 3.x by compiling
## 2.1 Install Packages
sudo apt install git libvtk5-dev libeigen2-dev openmpi-bin openmpi-doc libopenmpi-dev
which mpirun
/usr/bin/mpirun comes up?
which mpic++
/usr/bin/mpic++ comes up?
## 2.2 Get Liggghts via Git
cd ~
git clone https://github.com/CFDEMproject/LIGGGHTS-PUBLIC $HOME/LIGGGHTS-PUBLIC3.6.0
## 2.3 Compiling Liggghts with VORONOI and jpg, png support
cd $HOME/LIGGGHTS-PUBLIC3.6.0/src
# [optional] if you want to use voro++ in LIGGGHTS: make yes-voronoi
# [optional] if you need extra packages install with sudo make yes-packagename
xed /$HOME/LIGGGHTS-PUBLIC3.6.0/src/MAKE/Makefile.ubuntuVTK
add "-DLAMMPS_JPEG -DLAMMPS_PNG" in line 32
add "-I/usr/include" in line 63
add "-ljpeg -lpng" in line 65
change line 73 to "VTK_INC = -I/usr/include/vtk-5.10"
change line 74 to "VTK_LIB = -lvtkCommon -lvtkFiltering -lvtkIO -lvtkParallel -lvtkGraphics"
save and close xed
# [optional] changes on the source code
make clean-all
make ubuntuVTK
# create system wide shortcut liggghts360 for compiled binary (I used to have different versions parallel)
sudo ln -s /$HOME/LIGGGHTS-PUBLIC3.6.0/src/lmp_ubuntuVTK /usr/bin/liggghts360
liggghts360
# Liggghts comes up, telling version, compiling date etc., press Ctr+d to quit
#
## [optional] 3. Install LPP for post processing (converts LIGGGHTS Dumps to vtk-files)
cd ~
sudo apt-get install python-numpy
sudo git clone https://github.com/CFDEMproject/LPP.git $HOME/LPP
xed ~/.bashrc
add: alias lpp="python $HOME/LPP/src/lpp.py"
#open new Terminal: lpp
#
## [optional] 4. Install Syntax Highlighting for xed (gedit)
cd ~
wget https://www.dropbox.com/s/78elqj4i2dn52wt/liggghts3.lang
sudo mv liggghts3.lang /usr/share/gtksourceview-3.0/language-specs
#
## [optional] 5. Install ParaView 5.0.1
sudo apt-get install paraview
#
## [optional] 6. Install GNUplot 5.0.3
sudo apt-get install gnuplot-x11
gnuplot
plot sin(x)
# window with sin graph comes up, press Ctr+d to quit.
#
## [optional] 7. Install Povray 3.7.1
# Alternative: http://www.conoce3000.com/html/espaniol/Apuntes/2014-06-20-CompilarInstalarPOV-Ray37LinuxMintCinnamon64bitsCompilarInstalarPOV-Ray37LinuxMintCinnamon64bits.php?Arch=20
cd ~
sudo apt-get install autoconf automake libboost-all-dev libboost-dev libopenexr-dev libsdl-dev zlib1g-dev libpng-dev libjpeg-dev libtiff-dev
git clone https://github.com/POV-Ray/povray.git $HOME/POV-Ray3.7
cd $HOME/POV-Ray3.7/unix
./prebuild.sh
cd ..
./configure COMPILED_BY="your name "
make check
# windows with cup and cookies comes up, click picture
sudo make install
# done!

Regards

Paul

lumblab227 | Fri, 04/07/2017 - 07:15

Hi Paul!

Thanks very much for your tutorial. Appreciated. However, when I use the command " dump dumpnetwork all local/gran/VTK 200 post/dump*.vtk " to export the local contact information and to convert it into .VTK for paraview analysis, it shows the error as entitled. I am wondering:
(1) Did I use the wrong command (e.g. lack arguments)?
(2) or the VTK is not supported when compiling.

NOTE:
I just used the example of in.packing and add the command line as described before. Hope that you could give me some instruction.

Thanks!

aaigner's picture

aaigner | Fri, 04/28/2017 - 13:35

Did you compile VTK by yourself? In that case you have to enable the ParallelVTK (or something similar, I don't know the CMAKE property by heart) otherwise vtkMPIController is missing.

neven.marticnevic | Tue, 05/02/2017 - 16:05

Hi,

for parallel processing You must add on the end of the .bashrc file this line:

"export WM_NCOMPPROCS=4" .... number 4 mean 4 cores of computer which You will use for liggghts

for opening .bashrc file type in terminal "sudo gedit ~/.bashrc".

After that You will be able to run parallel processing simulations, but you must run simulation in this way:

1. type in terminal, folder path which contains input script: example " cd /home/pc name/desktop/simulation folder"
2. after that type, example: mpirun -np 4 /home/pc name/Documents/liggghts/src/lmp_fedora -in in.nameofinputscript

Where -np 4 means 4 cores of pc (you can type Your number of cores which must match with number of cores in file .bashrc), after that there is a path to lmp_fedora (I compile liggghts with fedora) and simulation will start running with parallel processing.

For more information of processor grid read online documentation about command processors.

Best regards, Neven