add svgwrite to list of dependencies
[dev-env-setup.git] / hdl-tools-yosys
1 #!/bin/bash
2 if [ "$EUID" -ne 0 ]
3 then echo "Please run as root using 'sudo bash'"
4 exit
5 fi
6
7 # this is a bit of a cheat, by relying on debian to pull in all the
8 # build dependencies. saves time researching how to get and list them
9 # by hand.
10 apt-get update -y
11 apt-get build-dep yosys -y
12 apt-get remove yosys -y
13
14 mkdir -p /home/$SUDO_USER/src
15 cd /home/$SUDO_USER/src
16 mkdir -p hdl_tools
17 cd hdl_tools
18
19 git clone https://github.com/cliffordwolf/yosys.git
20 git clone https://github.com/YosysHQ/SymbiYosys.git sby
21 git clone https://github.com/SRI-CSL/yices2.git
22 git clone https://github.com/Z3Prover/z3.git
23
24 cd yosys
25 make config-clang
26 make -j$(nproc)
27 make install
28
29 cd ../sby
30 make install
31
32 cd ../yices2
33 autoconf
34 ./configure
35 make -j$(nproc)
36 make install
37
38 cd ../z3
39 python scripts/mk_make.py
40 cd build
41 make -j$(nproc)
42 make install
43
44 cd /home/$SUDO_USER/src/hdl_tools
45 chown -R $SUDO_USER hdl_tools
46 chgrp -R $SUDO_USER hdl_tools