Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/haozeke/quip-nix


https://github.com/haozeke/quip-nix

Last synced: 22 days ago
JSON representation

Awesome Lists containing this project

README

        

* About
Some derivations to use QUIP on my cluster. Note that because of the psuedo-proprietary nature of GAP and some other aspects of this workflow, the sources cannot be provided here.

** Sources
- GAP (Gaussian Approximation Potentials) from [[http://www.libatoms.org/gap/gap_download.html][here]] or now; [[https://github.com/libAtoms/GAP][from Git]]
- My own setup used a branch which included support for the TurboSOAP descriptor
- TurboSOAP sources
- Some explanation of this might be [[https://turbogap.fi/wiki/index.php/Quick_start][found here]]
- [[https://github.com/libAtoms/QUIP][QUIP]] itself
- Fortran XML parser ([[https://github.com/libAtoms/fox][FoX]])
- This comes with QUIP, as a submodule

I can and will however, provide the directory listing:
#+BEGIN_SRC bash :results raw
tree QUIP -d -L 2
#+END_SRC

#+begin_src bash
QUIP
├── arch
├── bin
│   └── __pycache__
├── build
│   └── linux_x86_64_gfortran
├── doc
│   ├── _static
│   ├── _templates
│   └── Tutorials
├── quippy
│   ├── __pycache__
│   └── quippy
├── share
│   ├── Parameters
│   └── Structures
├── src
│   ├── f90wrap
│   ├── FilePot_drivers
│   ├── fox
│   ├── GAP
│   ├── libAtoms
│   ├── Potentials
│   ├── Programs
│   ├── Structure_processors
│   ├── turbogap
│   └── Utils
├── tests
│   ├── do_not_run
│   └── rules
└── travis

30 directories
#+end_src bash

- Note the additions to the ~src~ folder
- Also, the TurboSOAP sources are ABSOLUTE PATHS for some reason
** Nix Shell
With the derivation in place, we can build and enter the environment.
#+BEGIN_SRC bash
nix-shell -v --run "zsh"
#+END_SRC
Use the following command to find out what to put in ~MATH_LINKOPTS=~.
#+BEGIN_SRC bash
pkg-config --libs blas
pkg-config --libs lapack
#+END_SRC
With the current ~openblas~ setup, these will both be the same.
** Patches
We need to apply the ~patches~ in ~files~:
#+begin_src bash
patch -ruN -d QUIP/quippy < files/quippyF90wrap.patch
#+end_src
** QUIP-GAP
Now we can finally set this up.
#+BEGIN_SRC bash
nix-shell --run "zsh"
mkdir -p out/{bin,structs}
cd QUIP
mkdir -p build/$QUIP_ARCH
cp ../files/$QUIP_ARCH-Makefile.inc build/$QUIP_ARCH/Makefile.inc
make
make install
make install-quippy
make libquip
#+END_SRC
** Nix Shell
To get the integrated build just run:
#+BEGIN_SRC bash
nix-shell --run "zsh"
#+END_SRC
For permission errors use another terminal to run:
#+BEGIN_SRC bash
watch sudo chmod 777 /nix/store/2cg51vw7iws7ayawzwwr7rfv2ix5yws3-python3-3.8.5-env/lib/python3.8/site-packages -R
#+END_SRC
*The shell is required for* ~quippy~.
** Nix Build
After setting up the shell environment, we can build and install the binary.
#+BEGIN_SRC bash
nix-build -v
# Test it
nix-env -i ./result
#+END_SRC
** Conda Build
*** Obtain Sources
We will start by getting QUIP and TurboGAP.
#+begin_src bash
git clone --recursive https://github.com/libAtoms/QUIP.git QUIP
cd QUIP/src
git clone --recursive https://github.com/mcaroba/turbogap.git
mkdir ThirdParty
# In QUIP/src
cp -r ../../scme ThirdParty/
#+end_src
Now we have both of these ready to be made.
*** Environment Initialization
For this we use either ~conda~ or ~micromamba~.
#+begin_src bash
# from the root directory
conda env create -f environment.yml
conda activate quip-conda
# or
micromamba create -f environment.yml
micromamba activate quip-conda
#+end_src
Also we need to initialize some variables.
#+begin_src bash
source ./setEnvVars.sh
#+end_src
These essentially determine the different exported paths.
*** Building
We will assume any further explanation that:
- Compilers are present
- OpenBlas is present

On an HPC, this can be something like:
#+begin_src bash
ml avail openblas
ml avail gcc
ml load GCC/11.2.0
ml load OpenBLAS/0.3.18-GCC-11.2.0
#+end_src

Finally we need to build all the things.
#+begin_src bash
cd QUIP
mkdir -p build/$QUIP_ARCH
mkdir -p "$QUIP_STRUCTS_DIR"
cp ../files/$QUIP_ARCH-Makefile.inc build/$QUIP_ARCH/Makefile.inc
make
make libquip
make install
make install-quippy
#+end_src
* License
[[http://www.wtfpl.net/about/][WTFPL]]