-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_engine.sh
executable file
·58 lines (53 loc) · 1.71 KB
/
install_engine.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#
# Author: Pablo de Andres<mailto:[email protected]>
# Material Informatics Team, Fraunhofer IWM
#
# Description: This script install the LAMMPS engine and its Python binding
# Used as part of the installation for the Simlammps wrapper.
#
# Run Information: This script is run manually.
###################################
### Install engine requirements ###
###################################
./install_engine_requirements.sh
################################
### Download necessary files ###
################################
echo "Checking out a recent stable version"
git clone -b stable https://github.com/lammps/lammps.git
cd lammps
############################
### Perform installation ###
############################
mkdir build
cd build
# MPI, PNG, Jpeg, FFMPEG are auto-detected
cmake ../cmake -DPKG_MOLECULE=yes -DLAMMPS_EXCEPTIONS=yes -DBUILD_LIB=yes -DBUILD_SHARED_LIBS=yes
echo "Building LAMMPS shared library"
make
echo "Installing LAMMPS shared library and python package"
make install-python
#########################
### Test installation ###
#########################
{
echo "Checker whether LAMMPS is available in python"
python3 -c 'from lammps import PyLammps as p;p().command("print \"Hi from PyLammps\"")' &&
echo "LAMMPS installation complete." &&
# Clean-up
read -p "Do you want to remove the LAMMPS folder? [y/N] " -n 1 -r &&
echo &&
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Cleaning up LAMMPS folder..."
cd ../..
rm -rf lammps
echo "Done!"
else
echo "Folder was not removed."
fi
} || {
echo "There was an error with the installation."
echo "Please, try again or contact the developer."
}