Skip to content

Commit

Permalink
Merge pull request #361 from binpash/setup-fixes
Browse files Browse the repository at this point in the history
Fix installation on package releases
  • Loading branch information
dkarnikis authored Oct 18, 2021
2 parents 54209c8 + 7e8f58d commit e13d767
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
1 change: 0 additions & 1 deletion compiler/pash.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import subprocess
import argparse
from datetime import datetime

from annotations import *
from ast_to_ir import *
from ir import *
Expand Down
6 changes: 3 additions & 3 deletions scripts/distro-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case "$distro" in
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y # for g++-10
sudo apt-get update &> $LOG_DIR/apt_update.log
echo "|-- running apt install..."
sudo apt-get install -y git libtool m4 curl automake pkg-config libffi-dev python python3 python3-pip wamerican-insane bc bsdmainutils g++-10 python3-testresources &> $LOG_DIR/apt_install.log
sudo apt-get install -y git libtool m4 curl automake pkg-config libffi-dev python python3 python3-pip wamerican-insane bc bsdmainutils g++-10 python3-testresources python3-setuptools &> $LOG_DIR/apt_install.log
echo "|-- make g++-10 default..."
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
sudo update-alternatives --set g++ /usr/bin/g++-10
Expand All @@ -43,14 +43,14 @@ case "$distro" in
add-apt-repository ppa:ubuntu-toolchain-r/test -y # for g++-10
apt-get update &> $LOG_DIR/apt_update.log
echo "|-- running apt install..."
apt-get install -y git libtool curl sudo procps m4 automake pkg-config libffi-dev python python3 python3-pip wamerican-insane bc bsdmainutils g++-10 python3-testresources &> $LOG_DIR/apt_install.log
apt-get install -y git libtool curl sudo procps m4 automake pkg-config libffi-dev python python3 python3-pip wamerican-insane bc bsdmainutils g++-10 python3-testresources python3-setuptools &> $LOG_DIR/apt_install.log
echo "|-- make g++-10 default..."
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
sudo update-alternatives --set g++ /usr/bin/g++-10
;;
fedora*)
echo "|-- running dnf install...."
dnf install git gcc gcc-c++ python python3-pip make curl automake autoconf libtool hostname bc procps python3-testresources -y &> $LOG_DIR/dnf_install.log
dnf install git gcc gcc-c++ python python3-pip make curl automake autoconf libtool hostname bc procps python3-testresources python3-setuptools -y &> $LOG_DIR/dnf_install.log
;;
arch*)
echo "Updating mirrors"
Expand Down
22 changes: 16 additions & 6 deletions scripts/setup-pash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
set -e

cd $(dirname $0)
PASH_TOP=${PASH_TOP:-$(git rev-parse --show-toplevel)}
# check the git status of the project
if git rev-parse --git-dir > /dev/null 2>&1; then
# we have cloned from the git repo, so all the .git related files/metadata are available
git submodule init
git submodule update
# set PASH_TOP
PASH_TOP=${PASH_TOP:-$(git rev-parse --show-toplevel)}
else
# we are in package mode, no .git information is available
git clone https://github.com/angelhof/libdash/ compiler/parser/libdash/ --depth 1
# set PASH_TOP to the root folder of the project if it is not available
PASH_TOP=${PASH_TOP:-$PWD/..}
fi
cd $PASH_TOP

LOG_DIR=$PWD/install_logs
mkdir -p $LOG_DIR
PYTHON_PKG_DIR=$PWD/python_pkgs
mkdir -p $PYTHON_PKG_DIR
git submodule init
git submodule update

echo "Building parser..."
cd compiler/parser
Expand Down Expand Up @@ -65,9 +75,9 @@ echo "export distro=$distro" > ~/.pash_init
cd ../

echo "Installing python dependencies..."
python3 -m pip install jsonpickle --system -t $PYTHON_PKG_DIR &> $LOG_DIR/pip_install_jsonpickle.log
python3 -m pip install numpy &> $LOG_DIR/pip_install_numpy.log
python3 -m pip install matplotlib &> $LOG_DIR/pip_install_matplotlib.log
python3 -m pip install jsonpickle --root $PYTHON_PKG_DIR #&> $LOG_DIR/pip_install_jsonpickle.log
python3 -m pip install numpy #&> $LOG_DIR/pip_install_numpy.log
python3 -m pip install matplotlib #&> $LOG_DIR/pip_install_matplotlib.log


echo "Generating input files..."
Expand Down

0 comments on commit e13d767

Please sign in to comment.