From ded458eaf1568332f2fcb61b4d549bbbebdcd3a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de>
Date: Thu, 6 Jul 2017 17:31:46 +0200
Subject: [PATCH] Add readme and script to apply patches

---
 README.md                | 113 +++++++++++++++++++++++++++++++++++++++
 patches/apply_patches.sh |  10 ++++
 2 files changed, 123 insertions(+)
 create mode 100644 README.md
 create mode 100755 patches/apply_patches.sh

diff --git a/README.md b/README.md
new file mode 100644
index 00000000..bfb74fcb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,113 @@
+# dune-perftool
+
+dune-perftool is an active research code project with the goal of
+generating high-performance integration kernels for dune-pdelab.
+
+**Note**: Due to the research character of the code things will change
+a lot and there is no guarantee of interface stability ;).
+
+
+## Dependencies
+
+dune-perftool depends on the following software packages:
+
+* You need a working [dune-pdelab][1].
+
+* We use [dune-testtools][2] for ini file variablility.
+
+* The [Integer Set Library][3] needs to be installed. Using the
+  package manager is probably the easiest way.
+
+
+## Cloning and Patching
+
+We use several sumbodules so you should clone with the --recursive option:
+
+```
+git clone --recursive ssh://git@parcomp-git.iwr.uni-heidelberg.de:20022/dominic/dune-perftool.git
+```
+
+or
+
+```
+git clone --recursive https://parcomp-git.iwr.uni-heidelberg.de/dominic/dune-perftool.git
+```
+
+If you have a feature branch 'feature/my-branch' where you change the
+submodules of dune-perftool and you want to test your branch it makes
+sense to checkout this branch directly:
+
+```
+git clone --recursive -b feature/my-branch ssh://git@parcomp-git.iwr.uni-heidelberg.de:20022/dominic/dune-perftool.git
+```
+
+Some tests compare the vtkoutput to a reference vtk output. If you
+want to have all tests passing you need to install [git-lfs][0] before
+cloning. Cloning via ssh and using a ssh-agent are recommended in this
+case:
+
+```
+ssh-add
+git clone --recursive ssh://git@parcomp-git.iwr.uni-heidelberg.de:20022/dominic/dune-perftool.git
+```
+
+After cloning dune-perftool you need apply some patches:
+
+* Go to the base folder of dune-perftool and run
+  patches/apply_patches.sh. This applies patches to the submodules.
+
+  ```
+  cd dune-perftool/
+  ./patches/apply_patches.sh
+  ```
+
+* Besides that you need to apply the patch
+  dune-perftool/patches/dune-geometry/quadrule_operator_counting_compatible.patch
+  in dune-geometry.
+
+
+## Building dune-perftool
+
+Building dune-perftool is done through the Dune build-system using
+cmake. See the [Dune homepage][4] for further details. You need to set the options
+
+```
+-DDUNE_PYTHON_ALLOW_GET_PIP=1
+-DDUNE_PYTHON_VIRTUALENV_SETUP=1
+```
+
+in your options file. Your options file could for example look like
+the following:
+
+```
+CMAKE_FLAGS="
+  -DDUNE_FORCE_PYTHON3=1
+  -DDUNE_PYTHON_ALLOW_GET_PIP=1
+  -DDUNE_PYTHON_VIRTUALENV_SETUP=1
+  -DCMAKE_BUILD_TYPE=Release
+  -DCMAKE_CXX_FLAGS='-march=native -ffast-math'
+  -DDUNE_SYMLINK_TO_SOURCE_TREE=1
+"
+
+MAKE_FLAGS="-j2"
+```
+
+
+## Building and Running the Tests
+
+You can build and run the tests via:
+
+```
+cd path/to/dune-perftool/build/directory
+make build_tests
+ctest
+```
+
+
+## Links
+
+[0]: https://git-lfs.github.com/
+[1]: https://gitlab.dune-project.org/pdelab/dune-pdelab
+[2]: https://gitlab.dune-project.org/quality/dune-testtools
+[3]: http://isl.gforge.inria.fr/
+[4]: https://www.dune-project.org/doc/installation/
diff --git a/patches/apply_patches.sh b/patches/apply_patches.sh
new file mode 100755
index 00000000..9bb1d2e2
--- /dev/null
+++ b/patches/apply_patches.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+pushd python/loopy
+git apply ../../patches/loopy/Current.patch
+git apply ../../patches/loopy/0001-Allow-using-globalargs-as-base-storage.patch
+popd
+
+pushd dune/perftool/vectorclass
+git apply ../../../patches/vectorclass/0001-Better-implementation-of-horizontal_add.patch
+popd
-- 
GitLab