Hello Everyone, I am attempting here to outline a step by step CFDEM installation procedure that worked for me. Kindly, help improve the same by suggestions and contributions.
Note: Slightly modified steps for following combination of compatibility at https://www.evernote.com/shard/s214/sh/0ec74d17-2173-4c6e-a156-6c8cbe418...
word CFDEMversion="cfdem-3.4.0";
word compatibleLIGGGHTSversion="3.4.0";
word OFversion="3.0.x-commit-ac3f6c67e02f0aac3777c27f9fb7558fc3536e37";
Note: CFDEM LIGGGHTS may not support vtk compiled LIGGGHTS, therefore, the following procedure will use non vtk compiled LIGGGHTS only. Also, CFDEM supports an speciifc version of LIGGGHTS and OpenFOAM. Therefore, if one is intended to install LIGGGHTS only for DEM use, then, it is better to have separate and very fresh installation of it. So that there is no conflict between only DEM LIGGGHTS and CFDEM LIGGGHTS. The procedure in following link can be followed to install LIGGGHTS separately:
http://www.cfdem.com/forums/liggghts-installation-guide-ubuntu-1204-lts-...
First of all check the compatibility of latest CFDEM coupling with version of LIGGGHTS and OpenFOAM.
To do so check file https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC/blob/master/src/lag...
For the present case it is like:
word CFDEMversion="cfdem-3.0.2";
word compatibleLIGGGHTSversion="3.3.1";
word OFversion="2.4.x-commit-3d8da0e960c717ff582f1517a27724144f086b83";
So, we will try installing the suggested versions only.
Reference web page https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-2.4.0/Ubuntu
Reminder: Whenever you start a new terminal window or tab, you should run the alias command associated to the OpenFOAM 2.4.0 shell environment. In other words, run the following command whenever you start a new terminal:
of24x
OpenFOAM-2.4.x installation
Based on https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-2.4.0/Ubuntu
- sudo -s
- apt-get install build-essential flex bison zlib1g-dev qt4-dev-tools libqt4-dev gnuplot libreadline-dev \
libncurses-dev libxt-dev libopenmpi-dev openmpi-bin libboost-system-dev libboost-thread-dev libgmp-dev libmpfr-dev \
python python-dev - apt-get install libglu1-mesa-dev libqt4-opengl-dev
- exit
- sudo apt-get install octave
- sudo apt-get install epstool
- git clone git://github.com/OpenFOAM/OpenFOAM-2.4.x.git
- cd OpenFOAM-2.4.x
- git checkout 3d8da0e960c717ff582f1517a27724144f086b83
- see http://www.cfdem.com/forums/openfoam-installation-cfdemcoupling-publicsr... and change the export WM_MPLIB=SYSTEMOPENMPI at line number 85 (approx) [if it is not so]
- wget "http://downloads.sourceforge.net/foam/ThirdParty-2.4.0.tgz?use_mirror=mesh" -O ThirdParty-2.4.0.tgz
- tar -xzf ThirdParty-2.4.0.tgz
- rm ThirdParty-2.4.0.tgz
- mv ThirdParty-2.4.0 ThirdParty-2.4.x
- ln -s /usr/bin/mpicc.openmpi OpenFOAM/OpenFOAM-2.4.x/bin/mpicc
- ln -s /usr/bin/mpirun.openmpi OpenFOAM/OpenFOAM-2.4.x/bin/mpirun
- uname -m
- Open a new terminal
for x86_64 enter following command
source $HOME/OpenFOAM/OpenFOAM-2.4.x/etc/bashrc WM_NCOMPPROCS=4 - Also, copy this line at the end of the ~/.bashrc file. And, reopen new terminal.
echo "alias of24x='source \$HOME/OpenFOAM/OpenFOAM-2.4.x/etc/bashrc $FOAM_SETTINGS'" >> $HOME/.bashrc
Note: This last line means that whenever you start a new terminal window or tab, you should run the alias command associated to the OpenFOAM 2.4.0 shell environment. In other words, whenever you start a new terminal, you should run:
of24x - cd $WM_THIRD_PARTY_DIR
- export QT_SELECT=qt4
- ./Allwmake
(wait for the msg to come that all done, rerun the command to ensure the compilation) - ./Allwmake
(recheck it once again) - wmSET $FOAM_SETTINGS
(If it says wmSET command not found then try: source OpenFOAM/OpenFOAM-2.4.x/etc/bashrc or source ../OpenFOAM-2.4.x/etc/bashrc if your are in $WM_THIRD_PARTY_DIR) - wmSET $FOAM_SETTINGS
(If it says wmSET command not found then try: source OpenFOAM/OpenFOAM-2.4.x/etc/bashrc or source ../OpenFOAM-2.4.x/etc/bashrc if your are in $WM_THIRD_PARTY_DIR) - sed -i -e 's=version}\.3=version}.12.1=' getCmake
- chmod +x getCmake
- ./getCmake
- ./makeCmake
- wmSET $FOAM_SETTING
- export QT_SELECT=qt4
- sed -i -e 's=MPI_ARCH_PATH/include=MPI_ARCH_PATH/include;$MPI_INCLUDE=' etc/tools/ParaView4Functions
- sed -i -e 's=//#define GLX_GLXEXT_LEGACY=#define GLX_GLXEXT_LEGACY=' \
ParaView-4.1.0/VTK/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx/li> - cd $WM_THIRD_PARTY_DIR/ParaView-4.1.0
- wget http://www.paraview.org/pipermail/paraview/attachments/20140210/464496cc... -O Fix.patch
patch -p1 < Fix.patch - cd VTK
- wget https://github.com/gladk/VTK/commit/ef22d3d69421581b33bc0cd94b647da73b61... -O Fix2.patch
patch -p1 < Fix2.patch - cd ../..
- uname -m
- #this will take a while... somewhere between 30 minutes to 2 hours or more
./makeParaView4 -python -mpi -python-lib /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0/li> - wmSET $FOAM_SETTINGS
- cd $WM_PROJECT_DIR
- find src applications -name "*.L" -type f | xargs sed -i -e 's=\ (YY\_FLEX\_SUBMINOR\_VERSION\)=YY_FLEX_MINOR_VERSION < 6 \&\& \1='
- cd $WM_PROJECT_DIR
- export QT_SELECT=qt4
- ./Allwmake
- ./Allwmake (#Run it a second time for getting a summary of the installation)
- Test the installation
icoFoam -help
CFDEM-3.0.2 and LIGGGHTS-3.3.1 installation preparation:
- cd
- sudo apt-get install octave
- sudo apt-get install epstool
- sudo apt-get install python-numpy
- gedit ~/.bashrc
- add at the bottom alias lpp="python $HOME/LPP/src/lpp.py"
- cd
- mkdir CFDEM
- cd CFDEM
- git clone git://github.com/CFDEMproject/CFDEMcoupling-PUBLIC.git CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION
- [Optional]
To get the latest version, open a terminal, go to the location of your local installation and type: Warning: git stash will remove your changes in $HOME/CFDEM/CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION!
cd $HOME/CFDEM/CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION
git stash
git pull - cd
- git clone git://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git LIGGGHTS-PUBLIC
- Download Pizza.py Toolkit from http://www.sandia.gov/~sjplimp/download.html and put the extracted dir as $HOME/
- cd
- Preparing liggghts
LIGGGHTS has to be compiled with -fPIC CCFLAG switch thus, it is suggested to compile with Makefile.fedora_fpic, and ensure the following lines in it:
CCFLAGS = -O2 \
-funroll-loops -fstrict-aliasing -Wall -Wno-unused-result -fPIC
SHFLAGS = -fPIC
LIGGGHTS-3.3.1 installation (see http://www.cfdem.com/forums/liggghts-installation-guide-ubuntu-1204-lts-... for any troubleshooting):
- sudo apt-get install libvtk5-dev libeigen2-dev libopenmpi-dev g++ git-core
- sudo apt-get install build-essential git
- sudo apt-get install openmpi-common openmpi-bin libopenmpi-dev
- sudo apt-get install cmake
- sudo apt-get install cmake-curses-gui
- ##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? - sudo add-apt-repository ppa:jon-severinsson/ffmpeg
- sudo apt-get update
- sudo apt-get install ffmpeg
- sudo apt-get install frei0r-plugins
- cd
- wget https://sites.google.com/site/rahuliitdhn/files-1/language-specs.tar.gz?...
- tar -zxvf language-specs.tar.gz?...1
- sudo mv $HOME/language-specs/liggghts.lang /usr/share/gtksourceview-3.0/language-specs
- cd $HOME/LIGGGHTS-PUBLIC/src/
- sudo make clean-all
- sudo make fedora_fpic
- sudo ln -s /$HOME/LIGGGHTS-PUBLIC/src/lmp_fedora_fpic /usr/bin/liggghts_fedora
- sudo gedit ~/.bashrc
- alias "liggghts_fedora=$HOME/LIGGGHTS-PUBLIC/src/lmp_fedora_fpic"
CFDEM-3.0.2 installation:
- Setting up Environment Variables:
- Add following lines at bottom
##================================================#
##- source cfdem env vars
export CFDEM_VERSION=PUBLIC
export CFDEM_PROJECT_DIR=$HOME/CFDEM/CFDEMcoupling-$CFDEM_VERSION-$WM_PROJECT_VERSION
export CFDEM_SRC_DIR=$CFDEM_PROJECT_DIR/src
export CFDEM_SOLVER_DIR=$CFDEM_PROJECT_DIR/applications/solvers
export CFDEM_DOC_DIR=$CFDEM_PROJECT_DIR/doc
export CFDEM_UT_DIR=$CFDEM_PROJECT_DIR/applications/utilities
export CFDEM_TUT_DIR=$CFDEM_PROJECT_DIR/tutorials
export CFDEM_PROJECT_USER_DIR=$HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION
export CFDEM_bashrc=$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/bashrc
export CFDEM_LIGGGHTS_SRC_DIR=$HOME/LIGGGHTS-PUBLIC/src
export CFDEM_LIGGGHTS_MAKEFILE_NAME=fedora_fpic
export CFDEM_LPP_DIR=$HOME/LPP/src
export CFDEM_PIZZA_DIR=$HOME/PIZZA/pizza-9Oct15/src
. $CFDEM_bashrc
#================================================# - Reopen new terminal
- bash
- It will prompt to add user-public dir then say yes
- check to see if any other errors are there
- Save the ~/.bashrc, open a new terminal and test the settings. The commands:
$CFDEM_PROJECT_DIR
$CFDEM_SRC_DIR
$CFDEM_LIGGGHTS_SRC_DIR
should give "...: is a directory" otherwise something went wrong and the environment variables in ~/bashrc are not set correctly. - To specify the paths of pizza, please check the settings in
$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/bashrc
(Note that the lines similar to what we have added in the $HOME/.bashrc is available here but all are commented by default so no need to touch them) - If $CFDEM_SRC_DIR is set correctly, you can type
cfdemSysTest
to get some information if the paths are set correctly.
or
Compile LIGGGHTS(R) and CFDEM(R)coupling:
- Go to your LIGGGHTS src directory and perform
sudo make clean-all - Now compile:
cfedmCompLIG - If previous compilation was successful, then compile CFDEM:
Try things in following sequence (although cfdemCompCFDEM should be sufficient but we can try to compile one by one so that we can see where is error being logged):
cfdemCompCFDEMsrc
cfdemCompCFDEMsol
cfdemCompCFDEMuti
cfdemCompCFDEMall
cfdemCompCFDEM - If you see the file $HOME/CFDEM/CFDEMcoupling-PUBLIC-2.4.x/src/lagrangian/cfdemParticle/etc/compileCFDEMcoupling.sh then it already compiles src, solver and utilities in the sequence and we have already compiled LIGGGHTS so only cfdemCompCFDEM is required.
- Run cfdemTestTut to test the tutorials if the compilation was done properly.
- Important commands related to CFDEM compilation defined in $HOME/CFDEM/CFDEMcoupling-PUBLIC-2.3.x/src/lagrangian/cfdemParticle/etc/bashrc
cfdemCleanCFDEM cleans the cfdem built
cfdemPullLIG pull the LIGGGHTS from web
cfdemPullCFDEMcoupling pull cfdem coupling
cfdemCompCFDEMall compiling cfdem coupling with LIGGGHTS
cfdemCompCFDEM compiling cfdem (src+solvers)
cfdemCompCFDEMsrc compiling cfdem src
cfdemCompCFDEMsol compiling solvers
cfdemCompCFDEMuti compiling utilities
See full list of command in $HOME/CFDEM/CFDEMcoupling-PUBLIC-2.3.x/src/lagrangian/cfdemParticle/etc/bashrc
anirbanmondal93 | Mon, 05/09/2016 - 11:29
Ubuntu-14.04 LTS
Hi rahulsoni,
Thanks for the installation tutorials of CFDEMCoupling given by you.
I want to install it on my ubuntu 14.04LTS linux based system.
What tutorials step-by-step you have given, will that work on my ubuntu 14.04 version?
Waiting for your reply.
With best regards,
Anriban
khoatranxd | Tue, 05/10/2016 - 10:25
It is not working, please help
I try to install CFDEM Coupling as above instruction. But it always shows error when i run the command"cfdemCompCFDEM" as following
/home/khoa/CFDEM/CFDEMcoupling-PUBLIC-/applications/utilities/cfdemPostproc
/home/khoa/CFDEM/CFDEMcoupling-PUBLIC-/src/lagrangian/cfdemParticle/etc/functions.sh: line 148: rmdepall: command not found
/home/khoa/CFDEM/CFDEMcoupling-PUBLIC-/src/lagrangian/cfdemParticle/etc/functions.sh: line 150: wclean: command not found
/home/khoa/CFDEM/CFDEMcoupling-PUBLIC-/src/lagrangian/cfdemParticle/etc/functions.sh: line 156: wmake: command not found
Anyone can help me?
THanks
Khoa
Daniel Queteschiner | Thu, 05/12/2016 - 16:18
OpenFOAM environment variables
Hi Khoa,
those commands are specific to OpenFOAM so I suppose the setup of your environment variables is incorrect at some point.
I suggest to double check all relevant paths and also check your setup using the cfdemSysTest command.
Cheers
Daniel
khoatranxd | Tue, 05/17/2016 - 03:18
HI Daniel
HI Daniel
Thank you! I will try to check it again
anirbanmondal93 | Tue, 05/17/2016 - 13:17
Hi guys,
Hi guys,
The openFoam version-3.0.1 is being installed in my ubuntu-14.04LTS.
I want to install CFDEM-3.0.2 and LIGGGHTS-3.3.1 beside that.
Will the OFversion-3.0.1 work with the above CFDEMversion-3.0.2 and LIGGGHTSverison-3.3.1 following the above mentioned installation guidelines given by rahulsoni. Or i have to install only Ofversion-2.2.x to do compatibleness.
Regards,
JoG | Wed, 06/29/2016 - 22:24
I just installed LIGGGHTS
I just installed LIGGGHTS-PUBLIC 3.4.1 with CFDEM 3.0.x and OpenFOAM 3.0.x under Ubuntu 14.04LTS.
You have to follow exactly the guidelines in https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC/blob/master/doc/git...
For me it was very important to compile the exact commit of OpenFOAM mentioned in the versionInfo.h file which can be found here: https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC/blob/master/src/lag...
Good luck!