-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·37 lines (27 loc) · 1.01 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/bash
gpuFlag=${2:-false}
heapSize=${1:-4096m}
updateBashEnv=${4:-true}
pTF=${3:-false}
echo "Commencing PlasmaML Build with: Executable Heap Size = $heapSize and GPU Flag = $gpuFlag"
sbt -Dheap=${heapSize} -Dgpu=${gpuFlag} -DpackagedTF=${pTF} stage
chmod +x ./target/universal/stage/bin/plasmaml
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
bash_file=".bashrc"
elif [[ "$OSTYPE" == "darwin"* ]]; then
bash_file=".bash_profile"
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
bash_file=".bashrc"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
bash_file=".bash_profile"
else
bash_file=".bashrc"
fi
if [[ "$updateBashEnv" == "true" ]]; then
echo "Updating PLASMAML_HOME=$DIR variable in $bash_file"
sed -i.bak '/export PLASMAML_HOME/d' ~/${bash_file}
echo 'export PLASMAML_HOME='${DIR} >>~/${bash_file}
source ~/${bash_file}
fi