summaryrefslogtreecommitdiffstats
path: root/build/setup
diff options
context:
space:
mode:
Diffstat (limited to 'build/setup')
-rw-r--r--build/setup/build/astra.sh11
-rw-r--r--build/setup/build/ccpi.sh13
-rw-r--r--build/setup/build/cmake.sh9
-rw-r--r--build/setup/build/python.sh9
-rw-r--r--build/setup/provision.sh15
-rw-r--r--build/setup/repos.sh41
6 files changed, 98 insertions, 0 deletions
diff --git a/build/setup/build/astra.sh b/build/setup/build/astra.sh
new file mode 100644
index 0000000..ed79a1d
--- /dev/null
+++ b/build/setup/build/astra.sh
@@ -0,0 +1,11 @@
+#! /usr/bin/env bash
+
+set -o errexit
+
+(
+ cd build/linux
+ ./autogen.sh
+ ./configure --with-cuda=/usr/local/cuda --with-python=/usr/bin/python3
+ make
+ make install
+)
diff --git a/build/setup/build/ccpi.sh b/build/setup/build/ccpi.sh
new file mode 100644
index 0000000..329fbdf
--- /dev/null
+++ b/build/setup/build/ccpi.sh
@@ -0,0 +1,13 @@
+#! /usr/bin/env bash
+
+real_script=$(readlink "$0")
+[ -z "$real_script" ] && real_script="$0"
+script_path=$(dirname "$real_script")
+
+set -o errexit
+
+# Do both (as framework's cmake install python files in invalid location)
+[ -f CMakeLists.txt ] && bash "$script_path/cmake.sh"
+[ -d Wrappers/Python ] && bash "$script_path/python.sh"
+
+exit 0
diff --git a/build/setup/build/cmake.sh b/build/setup/build/cmake.sh
new file mode 100644
index 0000000..09beccf
--- /dev/null
+++ b/build/setup/build/cmake.sh
@@ -0,0 +1,9 @@
+#! /usr/bin/env bash
+
+set -o errexit
+
+pypath=$(python3 -c 'import site; print(site.getsitepackages()[0])')
+#rm CMakeCache.txt
+cmake -D "PYTHON_DEST_DIR:PATH=$pypath" .
+make
+make install
diff --git a/build/setup/build/python.sh b/build/setup/build/python.sh
new file mode 100644
index 0000000..de08a2c
--- /dev/null
+++ b/build/setup/build/python.sh
@@ -0,0 +1,9 @@
+#! /usr/bin/env bash
+
+set -o errexit
+
+(
+ cd Wrappers/Python
+ python3 setup.py install
+)
+
diff --git a/build/setup/provision.sh b/build/setup/provision.sh
new file mode 100644
index 0000000..8066399
--- /dev/null
+++ b/build/setup/provision.sh
@@ -0,0 +1,15 @@
+#! /usr/bin/env bash
+
+set -o errexit
+
+setup_path="$1"
+repos_path="$2"
+[ -z "$setup_path" ] && setup_path="/root/setup"
+[ -z "$repos_path" ] && repos_path="/ccpi/repos"
+
+for name in "$repos_path"/*; do
+ (
+ cd $name
+ [ -f "ands_install.sh" ] && bash "ands_install.sh"
+ )
+done
diff --git a/build/setup/repos.sh b/build/setup/repos.sh
new file mode 100644
index 0000000..9e76208
--- /dev/null
+++ b/build/setup/repos.sh
@@ -0,0 +1,41 @@
+#! /usr/bin/env bash
+
+set -o errexit
+
+setup_path="$1"
+repos_path="$2"
+[ -z "$setup_path" ] && setup_path="/root/setup"
+[ -z "$repos_path" ] && repos_path="/ccpi/repos"
+
+repos=( \
+ "https://github.com/astra-toolbox/astra-toolbox.git tags/v1.8.3 astra.sh" \
+ "https://github.com/vais-ral/CCPi-Framework.git master ccpi.sh" \
+ "https://github.com/vais-ral/CCPi-FrameworkPlugins.git master ccpi.sh" \
+ "https://github.com/vais-ral/CCPi-astra.git update_projectors ccpi.sh" \
+ "https://github.com/vais-ral/CCPi-Regularisation-Toolkit.git master ccpi.sh" \
+)
+
+function install_repo {
+ repo="$1"
+ name=$(basename "$repo" .git)
+ branch="$2"
+ script="$3"
+
+ [ -d "$name" ] || git clone "$repo"
+
+ (
+ cd "$name"
+ git pull origin "$branch"
+ git checkout "$branch"
+ bash "$setup_path/build/$script"
+ ln -sf "$setup_path/build/$script" ands_install.sh
+ )
+}
+
+mkdir -p "$repos_path"
+(
+ cd "$repos_path"
+ for repo in "${repos[@]}"; do
+ install_repo $repo
+ done
+)