a8f0c15a11f8ce09d36cf5ffb6b1ba26fa17aa86
[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 # this is sort-of what ghdl-install does, hmmm
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://git.libre-soc.org/git/yosys.git
21 git clone https://git.libre-soc.org/git/SymbiYosys.git sby
22 git clone https://github.com/SRI-CSL/yices2.git
23 git clone https://github.com/Z3Prover/z3.git
24 # XXX see ghdl-install this is really best done with that
25 git clone https://github.com/ghdl/ghdl
26 git clone https://github.com/ghdl/ghdl-yosys-plugin
27 # both of these need adding https://bugs.libre-soc.org/show_bug.cgi?id=883
28 git clone https://github.com/bitwuzla/bitwuzla
29 git clone https://github.com/cvc5/cvc5 -b cvc5-1.0.0
30
31 # yosys 0.13 has been found to be stable...
32 cd yosys
33 git checkout smtlib2-expr-support-on-0.13
34 make config-clang
35 make -j$(nproc)
36 make install
37
38 # ... but things are in the middle of a transition so use this version of ghdl
39 cd ../ghdl
40 git checkout 263c843ed49f59cb4cc3038bafcac2b9238ebad4
41 ./configure --with-llvm-config
42 make
43 make install
44
45 # ...with this specific version of the yosys-ghdl-plugin
46 cd ../ghdl-yosys-plugin
47 git checkout c9b05e481423c55ffcbb856fd5296701f670808c
48 make
49 make install
50
51 # symbiyosys should be fine though
52
53 cd ../sby
54 make install
55
56 cd ../yices2
57 autoconf
58 ./configure
59 make -j$(nproc)
60 make install
61
62 cd ../z3
63 python scripts/mk_make.py
64 cd build
65 make -j$(nproc)
66 make install
67
68 cd /home/$SUDO_USER/src
69 chown -R $SUDO_USER .
70 chgrp -R $SUDO_USER .