Skip to content

Instantly share code, notes, and snippets.

@vipranarayan14
Last active October 12, 2022 22:08
Show Gist options
  • Save vipranarayan14/24137c1ad4d0437c6b315745bdf76d27 to your computer and use it in GitHub Desktop.
Save vipranarayan14/24137c1ad4d0437c6b315745bdf76d27 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Installation location
MAIN_DIR="$HOME/scl"
ZEN_MAIN_DIR="$MAIN_DIR/SKT"
SCL_MAIN_DIR="$MAIN_DIR/scl"
echo -e "\n=== Updating system packages ===\n"
# Update system package repositories and packages:
sudo apt update && sudo apt upgrade
echo -e "\n=== Installing prerequisites ===\n"
# Install prerequisite system packages:
sudo apt install \
apache2 \
bash \
bison \
flex \
graphviz \
gcc \
lttoolbox \
make \
perl \
python \
python3-pip \
xsltproc \
default-jdk \
g++ ocaml \
ocamlbuild \
camlp4
# Install prerequisite python packages:
sudo pip3 install pandas openpyxl anytree devtrans
echo -e "\n=== Downloading SCL & Dependencies ===\n"
# Creating main installation dir
mkdir $MAIN_DIR
# Download Zen
git clone --depth 1 https://gitlab.inria.fr/huet/Zen.git "$ZEN_MAIN_DIR/zen"
echo -e "\n"
# Download SCL
git clone --depth 1 https://github.com/samsaadhanii/scl.git "$SCL_MAIN_DIR"
cat "$SCL_MAIN_DIR/SPEC/spec_users.txt" \
| sed -E \
-e "s|^(ZENDIR=).*$|\1$ZEN_MAIN_DIR|" \
-e "s|^(SCLINSTALLDIR=).*$|\1$SCL_MAIN_DIR|" \
> "$SCL_MAIN_DIR/spec.txt"
echo -e "\n=== Installing SCL ===\n"
if [ ! -d "$ZEN_MAIN_DIR/zen/ML" ] || [ ! -d "$SCL_MAIN_DIR" ]; then
echo "Missing dependencies. Installation failed."
exit 1
fi
# Setup Zen
cd "$ZEN_MAIN_DIR/zen/ML"
make
sudo a2enmod cgid
sudo systemctl restart apache2
# Install SCL
cd "$SCL_MAIN_DIR"
./configure
make
sudo make install
echo -e "\nInstalled SCL Successfully."
echo -e "\nOpen http://localhost/scl/ in your browser.\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment