add sudo, remove systemd
[dev-env-setup.git] / hdl-tools-yosys
1 #!/bin/bash
2 if [ "$EUID" -ne 0 ]
3 then echo "Please run as root"
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 cd $SUDO_USER/home
15 mkdir hdl_tools
16 cd hdl_tools
17
18 git clone https://github.com/cliffordwolf/yosys.git
19 git clone https://github.com/YosysHQ/SymbiYosys.git sby
20 git clone https://github.com/SRI-CSL/yices2.git
21 git clone https://github.com/Z3Prover/z3.git
22
23 cd yosys
24 make config-clang
25 make -j$(nproc)
26 make install
27
28 cd ../sby
29 make install
30
31 cd ../yices2
32 autoconf
33 ./configure
34 make -j$(nproc)
35 make install
36
37 cd ../z3
38 python scripts/mk_make.py
39 cd build
40 make -j$(nproc)
41 make install
42
43 cd $SUDO_USER/home/hdl_tools
44 chown -R $SUDO_USER hdl_tools
45 chgrp -R $SUDO_USER hdl_tools