Install the latest version of ESyS-Particle on ubuntu-20.04

Created by Dion Weatherley
Keywords:
installation
Last updated by:
Dion Weatherley

These instructions describe how to install the latest version of ESyS-Particle on Ubuntu-20.04 and variants. This only works for ESyS-Particle rev. 1218 and later.

Step 1: Install all mandatory dependencies:
==================================
Open a terminal and execute the following commands (omit the '$' symbol; this denotes the terminal prompt):

$ sudo apt update
$ sudo apt upgrade

$ sudo apt install libtool automake build-essential bzr cmake
$ sudo apt install mpi-default-bin mpi-default-dev libboost-all-dev
$ sudo apt install python-is-python3

Step 2: Download the ESyS-Particle source code:
======================================

$ mkdir -p ~/src/ESyS-Particle
$ cd ~/src/ESyS-Particle
$ bzr branch lp:esys-particle esys-particle-trunk
$ cd esys-particle-trunk

Step 3: Compile and install ESyS-Particle:
================================

EITHER:
Compile and install using cmake build system (Recommended)

$ mkdir -p ~/build/esys-particle
$ cd ~/build/esys-particle
$ cmake -S ~/src/ESyS-Particle/esys-particle-trunk
$ make
$ sudo make install

OR:
Compile and install using autotools build system (Deprecated)

$ sh autogen.sh

For Ubuntu-20.04:
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0 /usr/lib/x86_64-linux-gnu/libboost_python3.so

OR, for Ubuntu-21.10, first find the latest version of the libboost_python library:
$ ls /usr/lib/x86_64-linux-gnu/libboost_python3*

and copy the full library name, then create the symbolic link:

$ sudo ln -s /usr/lib/x86_64-linux-gnu/[insert full library name here] /usr/lib/x86_64-linux-gnu/libboost_python3.so

For all Ubuntu versions:
$ ./configure CC=mpicc CXX=mpic++
$ make
$ sudo make install

Step 4: Set up environment variables:
==============================

$ export PATH=/usr/local/bin/:$PATH
$ export LIBRARY_PATH=/usr/local/lib/:$LIBRARY_PATH
$ export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
$ export PYTHONPATH=/usr/local/lib/python3.8/dist-packages:/usr/local/lib/python3/dist-packages:$PYTHONPATH

[To make these changes permanent, append these 'export' commands to the end of ~/.bashrc file; omitting the '$' symbols]

Step 5: Test the installation:
======================

Issue the following commands to test whether ESyS-Particle is installed correctly:

$ mkdir ~/scratch
$ cd ~/scratch
$ mpirun -np 2 esysparticle ~/src/ESyS-Particle/esys-particle-trunk/Doc/Examples/two_particle.py

If this test case runs correctly, you should see the following output in the terminal:
CSubLatticeControler::initMPI()
slave started at local/global rank 0 / 1

A directory listing should look similar to this:
$ ls
data.csv
snapshot_t=0_0.txt
snapshot_t=0_1.txt
snapshot_t=1000_0.txt
snapshot_t=1000_1.txt
snapshot_t=100_0.txt
snapshot_t=100_1.txt
snapshot_t=200_0.txt
snapshot_t=200_1.txt
snapshot_t=300_0.txt
snapshot_t=300_1.txt
snapshot_t=400_0.txt
snapshot_t=400_1.txt
snapshot_t=500_0.txt
snapshot_t=500_1.txt
snapshot_t=600_0.txt
snapshot_t=600_1.txt
snapshot_t=700_0.txt
snapshot_t=700_1.txt
snapshot_t=800_0.txt
snapshot_t=800_1.txt
snapshot_t=900_0.txt
snapshot_t=900_1.txt

The first ten lines of 'data.csv' should look similar to this:
$ head data.csv
0 -0.074950 0.000000 0.000000 0.029370 0.000000 0.000000
1 -0.074900 0.000000 0.000000 0.029320 0.000000 0.000000
2 -0.074850 0.000000 0.000000 0.029270 0.000000 0.000000
3 -0.074800 0.000000 0.000000 0.029220 0.000000 0.000000
4 -0.074750 0.000000 0.000000 0.029170 0.000000 0.000000
5 -0.074700 0.000000 0.000000 0.029120 0.000000 0.000000
6 -0.074650 0.000000 0.000000 0.029070 0.000000 0.000000
7 -0.074600 0.000000 0.000000 0.029020 0.000000 0.000000
8 -0.074550 0.000000 0.000000 0.028970 0.000000 0.000000
9 -0.074500 0.000000 0.000000 0.028920 0.000000 0.000000

If you receive error messages during this test, please search the User Forum for similar errors:
https://answers.launchpad.net/esys-particle
If you cannot find a solution, post a new question to the User Forum, containing the text of the error messages, an explanation of the installation process, and the operating system version you used.