Skip to content

Commit 63dcd68

Browse files
author
Ruman Gerst
committed
+ Installation scripts
* Improved electron wrapper * Updated data policy
1 parent deae784 commit 63dcd68

File tree

9 files changed

+468
-1606
lines changed

9 files changed

+468
-1606
lines changed

check_R.sh

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/bash
2+
3+
#
4+
# Installs/checks the R version
5+
#
6+
7+
expected_r_version="3.4.3"
8+
installation_folder=$1
9+
debian_check=$(which apt)
10+
11+
echo ">>>>>>> Checking R ..."
12+
13+
if [ -e $installation_folder/R ]; then
14+
echo ">>> R already exists. Nothing to do."
15+
exit
16+
fi
17+
18+
# Try to install system R if not available
19+
if [ "" == $(which R) ]; then
20+
21+
if [ "" == "$debian_check" ]; then
22+
echo "You do not seem to run Ubuntu or Debian."
23+
echo ""
24+
echo "If available, install R version $expected_r_version"
25+
read -p "Press enter to continue"
26+
else
27+
available_system_r=$(apt-cache show r-base | grep "Version: $expected_r_version")
28+
if [ "" != "$available_system_r" ]; then
29+
read -p "R is not installed. Install it? [Y/N]" -n 1 -r
30+
echo # (optional) move to a new line
31+
if [[ $REPLY =~ ^[Yy]$ ]]; then
32+
sudo apt install r-base
33+
fi
34+
fi
35+
fi
36+
fi
37+
38+
# Try to use system R
39+
if [ "" != $(which R) ]; then
40+
echo ">>> Found System R"
41+
echo "$(R --version)"
42+
43+
system_r_check=$(R --version | grep "$expected_r_version")
44+
45+
if [ "" == "$system_r_check" ]; then
46+
echo ">>> System R does not match!"
47+
48+
read -p "Keep System R anyways? [Y/N]" -n 1 -r
49+
echo # (optional) move to a new line
50+
if [[ $REPLY =~ ^[Yy]$ ]]; then
51+
ln -s "$(which R)" $installation_folder/R
52+
exit
53+
fi
54+
fi
55+
fi
56+
57+
58+
# Try to compile R
59+
read -p "Do you want to compile R version 3.4.3? [Y/N]" -n 1 -r
60+
echo # (optional) move to a new line
61+
if [[ $REPLY =~ ^[Yy]$ ]]; then
62+
./check_r_build_dependencies.sh
63+
FOLDER=$(pwd)
64+
cd $installation_folder
65+
mkdir src
66+
cd src
67+
wget -nc https://cran.r-project.org/src/base/R-3/R-3.4.3.tar.gz
68+
tar -xzvf R-3.4.3.tar.gz
69+
cd R-3.4.3
70+
./configure --prefix=$installation_folder/R-3.4.3 --enable-R-shlib --with-blas --with-lapack
71+
make
72+
make install
73+
cd ../..
74+
ln -s ./R-3.4.3/bin/R R
75+
cd $FOLDER
76+
exit
77+
fi
78+
79+
read -p "Please insert the full path to the R executable: "
80+
ln -s $REPLY $installation_folder/R
81+
82+
83+

check_dependencies.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
#
4+
# Installs dependencies for Ubuntu/Debian
5+
#
6+
7+
echo ">>>>>>> Checking dependencies ..."
8+
9+
dependencies=(ffmpeg libcurl4-gnutls-dev libxml2-dev libssl-dev libmysqlclient-dev libcairo2-dev libgtk2.0-dev xvfb xauth xfonts-base libxt-dev libgconf2-4 npm)
10+
uninstalled_dependencies=()
11+
debian_check=$(which apt)
12+
13+
if [ "" == "$debian_check" ]; then
14+
echo "You do not seem to run Ubuntu or Debian."
15+
echo ""
16+
echo "Please install the equivalent packages to following packages:"
17+
echo "${dependencies[@]}"
18+
read -p "Press enter to continue"
19+
exit
20+
fi
21+
22+
for d in "${dependencies[@]}"; do
23+
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $d|grep "install ok installed")
24+
echo "Checking for $d: $PKG_OK"
25+
26+
if [ "" == "$PKG_OK" ]; then
27+
uninstalled_dependencies+=($d)
28+
fi
29+
done
30+
31+
if [ ! -z "$uninstalled_dependencies" ]; then
32+
echo "Following packages need to be installed: ${uninstalled_dependencies[@]}"
33+
sudo apt install "${uninstalled_dependencies[@]}"
34+
fi

check_r_build_dependencies.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
#
4+
# Installs dependencies for Ubuntu/Debian
5+
#
6+
7+
echo ">>>>>>> Checking build dependencies ..."
8+
9+
dependencies=(build-essential)
10+
uninstalled_dependencies=()
11+
debian_check=$(which apt)
12+
13+
if [ "" == "$debian_check" ]; then
14+
echo "You do not seem to run Ubuntu or Debian."
15+
echo ""
16+
echo "Please install the equivalent packages to following packages:"
17+
echo "${dependencies[@]}"
18+
read -p "Press enter to continue"
19+
exit
20+
fi
21+
22+
for d in "${dependencies[@]}"; do
23+
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $d|grep "install ok installed")
24+
echo "Checking for $d: $PKG_OK"
25+
26+
if [ "" == "$PKG_OK" ]; then
27+
uninstalled_dependencies+=($d)
28+
fi
29+
done
30+
31+
if [ ! -z "$uninstalled_dependencies" ]; then
32+
echo "Following packages need to be installed: ${uninstalled_dependencies[@]}"
33+
sudo apt install "${uninstalled_dependencies[@]}"
34+
fi

0 commit comments

Comments
 (0)