Newer
Older
# SAMPLE
**S**urface **A**dsorbate Poly**m**orph **P**rediction with **L**ittle **E**ffort
A tool for efficient structure search on surfaces. For details see https://www.sciencedirect.com/science/article/pii/S0010465519301973
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
## Setup
### 1. Cloning
You can clone this repository by using
```
git clone git@gitlab.tugraz.at:structuresearch/sample.git
git submodule add git@gitlab.tugraz.at:structuresearch/tools.git tools
git submodule update --init --recursive
```
in the command line.
This clones the SAMPLE code base together with the tools library (AIMSTools, VASPTools, QETools).
### 2. Build C libraries
Next step is to build the CWrapper library of SAMPLE and AIMSTools. For that you need to execute the
script in ``sample/C/build.sh`` and in ``tools/AIMSTools/C/build.sh``.
If succesful you should find a ``libCUtil.so`` file in the ``Release`` folder.
### 3. Set PYTHONPATH
Now one need to add ``sample/tools``, ``sample/tools/AIMSTools``, ``sample/tools/VASPTools`` and ``sample/tools/QETools``
to the PYTHONPATH so that all import statements in the ``sample`` package are working. You can add these lines to
your .bashrc file
```
export PYTHONPATH=${PYTHONPATH}:$<sample-repo-directory>/sample/tools
export PYTHONPATH=${PYTHONPATH}:$<sample-repo-directory>/sample/tools/AIMSTools
export PYTHONPATH=${PYTHONPATH}:$<sample-repo-directory>/sample/tools/VASPTools
export PYTHONPATH=${PYTHONPATH}:$<sample-repo-directory>/sample/tools/QETools
```
You need to exchange ``<sample-repo-directory>`` with the path to your sample repository (directory where you cloned the repo)
### 5. install required python packages
sample needs several external python packages which can be easily installed via ``pip``. Just run the following install
command at the root folder of the sample repository.
```
pip install -r requirements.txt
```
For anaconda one can use
```
conda install --file requirements.txt
```
### 4. Configure git submodules [OPTIONAL]
This step is optional.
The tools library in sample is its own git repository and does not automatically update if a `git pull`` command is
executed inside the sample git repository.
To automatically get updates for the tools library one need to configure the git repository with
```
git config --local submodule.recurse true
git config --local fetch.recurseSubmodules on-demand
```
Now the tools git submodule is updated with every ``git pull`` command.
If you do not want this behavior you can skip this step and update the tools library manually.
### 6. Run unittests
To test if everything is set up correctly run the unittests inside the tests folder in the sample repo and in the
tools library.
```
python3 TestAll.py
```