require specific versions of yosys and ghdl and ghdl plugin sigh
[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 apt-get build-dep ghdl -y
14
15 mkdir -p /home/$SUDO_USER/src
16 cd /home/$SUDO_USER/src
17 mkdir -p hdl_tools
18 cd hdl_tools
19
20 git clone https://github.com/YosysHQ/yosys.git
21 git clone https://github.com/YosysHQ/SymbiYosys.git sby
22 git clone https://github.com/SRI-CSL/yices2.git
23 git clone https://github.com/Z3Prover/z3.git
24 git clone https://github.com/ghdl/ghdl
25 git clone https://github.com/ghdl/ghdl-yosys-plugin
26
27 # yosys 0.13 has been found to be stable...
28 cd yosys
29 git checkout yosys-0.13
30 make config-clang
31 make -j$(nproc)
32 make install
33
34 # ... but things are in the middle of a transition so use this version of ghdl
35 cd ../ghdl
36 git checkout 263c843ed49f59cb4cc3038bafcac2b9238ebad4
37 ./configure --with-llvm-config
38 make
39 make install
40
41 # ...with this specific version of the yosys-ghdl-plugin
42 cd ../ghdl-yosys-plugin
43 git checkout c9b05e481423c55ffcbb856fd5296701f670808c
44 make
45 make install
46
47 # symbiyosys should be fine though
48
49 cd ../sby
50 make install
51
52 cd ../yices2
53 autoconf
54 ./configure
55 make -j$(nproc)
56 make install
57
58 cd ../z3
59 python scripts/mk_make.py
60 cd build
61 make -j$(nproc)
62 make install
63
64 cd /home/$SUDO_USER/src/hdl_tools
65 chown -R $SUDO_USER .
66 chgrp -R $SUDO_USER .