INSTALL.sh 1.7 KB
Newer Older
Gabriel Kirsten's avatar
Gabriel Kirsten committed
1 2
#!/bin/bash

Gabriel Kirsten's avatar
 
Gabriel Kirsten committed
3 4 5 6 7
RED='\033[0;31m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NC='\033[0m'

Gabriel Kirsten's avatar
Gabriel Kirsten committed
8
echo "[PYNOVISAO INSTALLER] Installing PYNOVISAO... Please wait!"
9 10
export OMP_NUM_THREADS=4
export KMP_AFFINITY="verbose,explicit,proclist=[0,3,5,9],granularity=core"
Gabriel Kirsten's avatar
Gabriel Kirsten committed
11 12 13

#check if is root
if [ "$EUID" -ne 0 ]
Gabriel Kirsten's avatar
 
Gabriel Kirsten committed
14 15
  then printf "${RED}[PYNOVISAO INSTALLER] ERROR! Please run as root.${NC}"
  echo
Gabriel Kirsten's avatar
Gabriel Kirsten committed
16 17 18
  exit
fi

Gabriel Kirsten's avatar
 
Gabriel Kirsten committed
19 20 21
echo "[PYNOVISAO INSTALLER] Updating apt-get..."
sudo apt-get -qq update
echo "[PYNOVISAO INSTALLER] Installing prerequisites..."
22
sudo apt-get -qq -y install libfreetype6-dev tk tk-dev python-pip openjdk-8-jre openjdk-8-jdk weka weka-doc python-tk python-matplotlib
23
sudo apt-get -qq -y install python3-pip python3-tk python3-matplotlib
24
source ~/.bashrc
Gabriel Kirsten's avatar
Gabriel Kirsten committed
25

Gabriel Kirsten's avatar
 
Gabriel Kirsten committed
26
echo "[PYNOVISAO INSTALLER] Upgrading pip..."
27
sudo pip install --upgrade pip  --quiet
28
# Numpy must be installed before installing javabridge
Gabriel Kirsten's avatar
 
Gabriel Kirsten committed
29
echo "[PYNOVISAO INSTALLER] Installing numpy..."
30
sudo pip install numpy==1.14.5 --quiet
Gabriel Kirsten's avatar
 
Gabriel Kirsten committed
31
echo "[PYNOVISAO INSTALLER] Installing libraries..."
32
sudo pip install -r requeriments.txt --quiet
Gabriel Kirsten's avatar
 
Gabriel Kirsten committed
33 34 35 36 37 38 39 40 41 42 43 44 45

printf "${YELLOW} \n======== WARNING ========\n"
printf "The Keras is necessary so that it is possible to use CNN. It is recommended to install the version for GPU processing (if available) but it is also possible to use CPU processing.\n"
printf "To install the GPU version (tricky) follow the steps at: https://www.tensorflow.org/install/install_linux"
printf "${NC}\n"
read -p "Would you like to install keras CPU libraries? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
   echo "[PYNOVISAO INSTALLER] Installing keras libraries..."
   sudo pip install tensorflow 
   sudo pip install keras
fi
Gabriel Kirsten's avatar
Gabriel Kirsten committed
46

Gabriel Kirsten's avatar
Gabriel Kirsten committed
47
echo
Gabriel Kirsten's avatar
 
Gabriel Kirsten committed
48
printf "${BLUE}[PYNOVISAO INSTALLER] Installation completed!${NC}"
Gabriel Kirsten's avatar
Gabriel Kirsten committed
49
echo