Esys-Particle Build and Installation Notes: Justin Rahardjo, Dr. Vince Boros October 2014
Esys-Particle Build and Installation Notes: Justin Rahardjo, Dr. Vince Boros October 2014
October 2014
Contents
1 Building ESyS-Particle 1
1.1 Easy Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
iii
iv CONTENTS
5.2 Dump2VTK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
A Test Script 27
A.1 Main bash script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Building ESyS-Particle
packages, rst remove any existing ESyS-Particle installation, and then type in a
terminal:
Or for the latest trunk revision, including the most recent bug xes:
You will get updates automatically during the normal system update procedure.
• Boost
• Povray
1
2 CHAPTER 1. BUILDING ESYS-PARTICLE
All these packages need to be installed under a directory that is separate from
/usr/ and /usr/local/. This will help in testing the build for each version of the
software.
Firstly, create a new directory to contain the various folders. For the rest of this
document, it is assumed that the ~/BUILD/ directory is the base directory for the
installations.
$ cd ~
$ mkdir -p BUILD / sources
$ cd BUILD
$ mkdir bin lib share include
And don't forget to add these folders to the environment variables. For a more
$ cd ~/ BUILD / sources
$ tar xfz Python -2.6.9. tgz
$ rm Python -2.6.9. tgz
$ cd Python -2.6.9
$ ./ configure -- prefix = $HOME / BUILD -- enable - shared
$ make
$ make altinstall
NOTE:
NOTE: The command which python tells you which directory the command py-
thon looks for the libraries and binary les. Place the result of this command into
$ cd ~/ BUILD / sources
$ tar -- bzip2 - xf boost_1_52_0 . tar . bz2
$ rm boost_1_52_0 . tar . bz2
$ cd boost_1_52_0
$ ./ bootstrap . sh -- prefix = $HOME / BUILD -- with - libraries = filesystem ,
python , regex , system
$ ./ b2
$ ./ b2 install
is your base directory. If your Boost installation results in nonstandard library names
(such as the version of the C++ compiler included as part of the Boost library name),
to congure ESyS-Particle. The string following the = symbol needs to be the Boost
library name without the initial lib string and without the nal .so extension (for
Python library, rerun the script with this additional option (including the quotation
marks): LDFLAGS="-Lx/lib".
NOTE: When using Povray 3.7 or higher, include the thread library when com-
NOTE: When building with Python 3.2 and above (see Section 3.2), remember
to include directory to the python headers in the b2 command. Such as ./b2 include
="~/BUILD/include/python3.xm".
The most up-to-date instructions to install VTK from source can be found at http:
//www.vtk.org/Wiki/VTK/Configure_and_Build.
The following instructions will be using CMake 2.8.12 Release and VTK 6.1.0
VTK requires CMake to be installed. So, download the source code at http:
//www.cmake.org/cmake/resources/software.html and place in the base folder.
$ cd ~/ BUILD / sources
$ tar xfz cmake -2.8.12.2. tar . gz
$ cd cmake -2.8.12.2
$ ./ configure
$ make
$ make install
NOTE: If there is an error about not being able to nd the Curses Libraries,
$ cd ~/ BUILD / sources
$ tar xfz VTK -6.1.0. tar . gz
$ mkdir VTK - build
$ cd VTK - build
$ ccmake ../ VTK -6.1.0
In the CCMake GUI, hit [c] to congure for the rst time. Then, toggle to
• CMAKE_BUILD_TYPE - Release
• CMAKE_INSTALL_PREFIX - the base directory to install VTK in (can't use $HOME,
have to use or /home/username/)
1.2. GUIDE TO A SOURCE-BUILD 5
• BUILD_SHARED_LIBS - ON
• VTK_WRAP_PYTHON - ON
• Module_vtkPython - ON
• Module_vtkPythonInterpreter - ON
Once these options are set, hit [c] again to recongure, then check these values
and make sure it is using the correct python installation of the build.
• PYTHON_INCLUDE_DIR - (~/BUILD/include/python2.6)
• PYTHON_LIBRARY - (~/BUILD/lib/libpython2.6.so)
• VTK_INSTAL_PYTHON_MODULE_DIR - lib/python2.6/site-packages
Hit [c] to recongure again and then hit [g] to generate the required les. Lastly,
build VTK.
NOTE: Whilst conguring, there might be an error such as X11_Xt_LIB could not
be found. To x this problem, simply install the XT library.
$ cd ~/ BUILD / sources
$ tar xfz povray -3.6. tar . gz
$ rm povray -3.6. tar . gz
$ cd povray -3.6.1
$ ./ configure COMPILED_BY = " your name < email@address > " -- prefix =
$HOME / BUILD
$ make
$ make install
NOTE: There might be a problem with libpng12-dev. If so, remove it and use
libpng10-dev instead.
NOTE: If you are having problems installing Povray 3.7, please see Section 3.3.
6 CHAPTER 1. BUILDING ESYS-PARTICLE
instructions will be using Epydoc 3.0.1 release. Adjust the commands accordingly
$ cd ~/ BUILD / sources
$ unzip epydoc -3.0.1. zip
$ rm epydoc -3.0.1. zip
$ cd epydoc -3.0.1
Then use your preferred text editor to change the default installation path in
Then continue on with the installation using the command make install.
Once all the required dependencies are installed, we can start conguring the esys-
particle installation and install it. Firstly, create a directory for the ESyS-Particle
$ cd ~/ BUILD
$ mkdir esys - particle
$ cd esys - particle
$ bzr branch lp : esys - particle
$ mv esys - particle / source
$ mkdir install build
$ cd source
$ ./ autogen . sh
$ cd ~/ BUILD / esys - particle / build
$ ../ source / configure CC = mpicc CXX = mpic ++ CXXFLAGS = " - Wall - Wextra "
-- srcdir = $HOME / BUILD / esys - particle / source -- prefix = $HOME / BUILD /
esys - particle / install -- with - boost = $HOME / BUILD -- with - povray --
enable - vtk -- with - epydoc -- enable - docs
$ make
$ make install
NOTE: When compiling for Python 3.x, remember that both vtk and epydoc are
not supported and thus remove --enable-vtk and --with-epydoc in the congure com-
mand.
1.2. GUIDE TO A SOURCE-BUILD 7
And lastly, don't forget to add the ESyS-Particle installation paths to your en-
vironment variables.
Once ESyS-Particle has been built using all its dependencies, the installation needs
to be tested. To do this, run all the tutorial scripts from the ESyS-Particle Tutorial.
These test scripts can all be run together by using a bash script to run one after
the other. A few things can be added to the script such as a way to move all the
output les into another folder to tidy things up when viewing the results.
Once the build has been tested, the installation directories can be renamed so
that a new build can be tested. To rename the builds, we can use the following
script:
Once the les are renamed, we can start the testing process again from Sec-
tion 1.2.1.
9
10 CHAPTER 2. TESTING THE ESYS-PARTICLE BUILD
Table 2.1: A list of the builds of ESyS-Particle v2.3.1 tested on a Ubuntu 14.0.4
system. (VTK version 6.1.0 and Epydoc version 3.0.1)
2.1. TESTED BUILDS 11
Table 2.2: A list of the builds of ESyS-Particle v2.3.1 tested on a Ubuntu 12.0.4
system. (VTK version 6.1.0 and Epydoc version 3.0.1 for installs with Python 2.x
and Povray 3.6.1)
12 CHAPTER 2. TESTING THE ESYS-PARTICLE BUILD
Table 2.3: A list of the builds of ESyS-Particle v2.3.1 tested on a Debian 7.2 with
system Boost 1.49.0 and Python 2.6.8, 2.7.3 and 3.2.3. (VTK version 6.1.0 and
Epydoc version 3.0.1 for installs with Python 2.x and Povray 3.6.1)
Table 2.4: A list of the builds of ESyS-Particle v2.3.1 tested on a Suse 11 system
with system Boost 1.36.0 and Python 2.6.0. (VTK version 6.1.0 and Epydoc version
3.0.1 for installs with Python 2.x and Povray 3.6.1)
Chapter 3
During installation of Python 3.4, sometimes it comes up with a warning where PIP
is not installed.
For Python 3.1 and above, there is a syntax error that comes when running bootstrap
.sh. This is caused by an older version of Python's print function. Details on the
13
14 CHAPTER 3. PROBLEMS FOUND DURING BUILD
During the ./b2 command, if pycong.h can't be found. This is caused by Python's
naming convention for the include directory from 3.2 and above. To x it, insure
found when using Boost 1.52. These undened references are found in the boost
threading library.
This is found during the congure process, this problem is because of it not being
able to nd the correct Boost::Thread library. So, rstly insure you have installed
the threading library, if not, during bootstrapping of boost, insure that it is included
(--with-libraries=.....,thread).
If the same error persists after installing the boost_threading library, add the lib-
This is not a problem atm, but might be worth looking into eventually.
16 CHAPTER 3. PROBLEMS FOUND DURING BUILD
During make install, there was a problem where Python was not able to nd the
This problem seems to be caused by some permission errors. As the install folders
seem to be under root instead of the current user. Using chown -R, on the install
folder, seems to have solved the problem. This was caused by the original command
There is a problem with Python 3.2 and above where the naming convention has
changed from pythonx.x to pythonx.xm. And as such, there are problems found in the
congure le as well as during make. A x for the conguration process has been
placed and it lets the user go through the cong with no problems. But this problem
arises again during the build process and as such, a soft-link from libpython3.x.so
to libpython3.xm.so needs to be created to solve this problem temporarily.
Despite the message, when looking through the config.log, it was found that it
actually found the correct le, but then found undened references in the le itself.
section. This is solved by including the required path to the correct include folder.
Another error appears where it is unable to link with Boost Python library.
After looking through the cong.log, this problem was caused by an incompatibility
of Unicode between UCS4 and UCS2 of the python version. To solve this problem,
During make, sometimes it comes up with an error where it is unable to nd .Plo
When running the script using mpirun, there has been an error with _sysconfigdata_m
missing from python.
File " / usr / lib / python3 .3/ site . py " , line 250 , in getuserbase
USER_BASE = get_config_var ( ' userbase ')
File " / usr / lib / python3 .3/ sysconfig . py " , line 610 , in
get_config_var
return get_config_vars () . get ( name )
File " / usr / lib / python3 .3/ sysconfig . py " , line 560 , in
get_config_vars
_init_posix ( _CONFIG_VARS )
File " / usr / lib / python3 .3/ sysconfig . py " , line 432 , in _init_posix
from _sysconfigdata import build_time_vars
File " / usr / lib / python3 .3/ _sysconfigdata . py " , line 6 , in < module >
from _sysconfigdata_m import *
ImportError : No module named ' _sysconfigdata_m '
This is caused because of multiple python installations and the system not being
able to nd the correct one. Fix the python installation to x this problem. Another
solution is to make sure that the environment variables are pointing to the correct
Described in this section is the steps needed to create a new release for ESyS-Particle.
https://wiki.geocomp.uq.edu.au/index.php/Release_
1. Write release notes at
Notes_for_ESyS-Particle
3. Update the tutorial if necessary and generate the new PDF le:
./render.sh in Doc/Tutorial/
https://wiki.geocomp.uq.edu.au/index.php/File:
4. Upload the new le to
ESyS-Particle_Tutorial.pdf
bzr commit
6. Generate an updated API by building the code using the --with-epydoc option
doxygen Doxyfile
19
20 CHAPTER 4. ESYS-PARTICLE RELEASE STEPS
16. Link xed and committed bugs to the milestone, if any exist:
• if no keys has been dened in the system, generate the keys by using:
gpg --gen-key
21. Change the 2.3 series status from Active Development to Current Stable
22. Change the status of bugs xed for the release from Fix Committed to Fix
A few notes on the denitions and concepts of some parameters used in one or both
5.1 Masks
This is essentially a bitwise-mask that is applied to the particle tags. The default
The way bitmasking works is that it masks the positions in the binary value.
For example, when the given mask is 1, it only selects those with a value of 1 in
the rst position of the binary. And as such, will return tags with numbers 1, 3, 5,
7 and so on. Whereas when the given mask is 2, it selects those with value of 1 in
23
24CHAPTER 5. DEFINITIONS AND CONCEPTS OF PARAMETERS AND HOW-TOS
the second position of the binary, thus returning the tags with numbers 2, 3, 6, 7
and so on. Table 5.1 shows the masked bits and the positions of the binary, giving
5.2 Dump2VTK
Converting ESyS-Particle's checkpointer output les into VTK les for viewing in
Paraview.
1
Options and their arguments :
• t: dene the initial recording time step (tini), the total number of snapshots
that you want to produce (numsnap) and the gap between two recording time
steps, i.e., the interval (in time steps) between two CheckPointer les (deltat),
• list: instead of constructing the list of input les starting from the Check-
Pointer leNamePrex and from the arguments of the option -t, it takes as
1 http://scientificandhpcomputing.blogspot.com.au/2009/07/dump2vtk-tips-tricks.
html
5.2. DUMP2VTK 25
For most usecases, with checkpointer les that are in the format of: <CheckPointer
fileNamePrefix>_t=????_ID.txt
Test Script
27
28 APPENDIX A. TEST SCRIPT
65 python out2file . py a $1 " - Test . txt " " slope_friction_floor . py FAIL "
fi
67 sh move_output_files . sh slope_friction_floor slope_data_
91 END = ` date +% s `
ELAPSED = $ (( $END - $START ) )
93
python out2file . py a $1 " - Test . txt " " Time consumed by testing : "
$ELAPSED " seconds "
30 APPENDIX A. TEST SCRIPT
4 mkdir -p $1
mv $2 * $1 2 >/ dev / null
6 mv snap_ * $1 2 >/ dev / null
A.3. OUTPUT TEST RESULT TO FILE 31
6 import sys
import os
8
def ensure_file_exists ( filename = " output . txt " ) :
10 """ Checks if the file to be appended to exists . If not ,
Create the file in the root location
12 """
if not os . path . exists ( filename ) :
14 f = open ( filename , 'w ')
f . write ( " # Test results file \ n " )
16 f . close ()