forked from siliconcompiler/siliconcompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-bluespec.sh
executable file
·35 lines (24 loc) · 959 Bytes
/
install-bluespec.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
#!/bin/sh
set -e
# Get directory of script
src_path=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)
sudo apt-get install -y ghc libghc-regex-compat-dev libghc-syb-dev \
libghc-old-time-dev libghc-split-dev tcl-dev build-essential pkg-config \
autoconf gperf flex bison
mkdir -p deps
cd deps
git clone $(python3 ${src_path}/_tools.py --tool bluespec --field git-url) bluespec
cd bluespec
git checkout $(python3 ${src_path}/_tools.py --tool bluespec --field git-commit)
git submodule update --init --recursive
make -j$(nproc) install-src
if [ -z ${PREFIX} ]; then
# install
sudo mkdir -p /opt/tools/bsc
sudo chown $USER:$USER /opt/tools/bsc
BSC_VERSION=$(echo 'puts [lindex [Bluetcl::version] 0]' | inst/bin/bluetcl)
mv inst /opt/tools/bsc/bsc-${BSC_VERSION}
ln -s /opt/tools/bsc/bsc-${BSC_VERSION} /opt/tools/bsc/latest
echo "Please add \"export PATH=/opt/tools/bsc/latest/bin:\$PATH to your .bashrc"
fi
cd -