meson dependency moved to linstaoo-mesa-deps
[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 apt-get install -y default-jre-headless python3-pip curl
15 python3 -m pip install toml
16
17 mkdir -p /home/$SUDO_USER/src
18 cd /home/$SUDO_USER/src
19 mkdir -p hdl_tools
20 cd hdl_tools
21
22 git clone https://git.libre-soc.org/git/yosys.git
23 git clone https://git.libre-soc.org/git/SymbiYosys.git sby
24 git clone https://github.com/SRI-CSL/yices2.git
25 git clone https://github.com/Z3Prover/z3.git
26 # XXX see ghdl-install this is really best done with that
27 git clone https://github.com/ghdl/ghdl
28 git clone https://github.com/ghdl/ghdl-yosys-plugin
29 # both of these need adding https://bugs.libre-soc.org/show_bug.cgi?id=883
30 git clone https://github.com/bitwuzla/bitwuzla.git
31 git clone -b cvc5-1.0.0 https://github.com/cvc5/cvc5.git cvc5
32
33 # yosys 0.13 has been found to be stable...
34 cd yosys
35 git checkout smtlib2-expr-support-on-0.13
36 make config-clang
37 make -j$(nproc)
38 make install
39
40 # ... but things are in the middle of a transition so use this version of ghdl
41 cd ../ghdl
42 git checkout 263c843ed49f59cb4cc3038bafcac2b9238ebad4
43 ./configure --with-llvm-config
44 make
45 make install
46
47 # ...with this specific version of the yosys-ghdl-plugin
48 cd ../ghdl-yosys-plugin
49 git checkout c9b05e481423c55ffcbb856fd5296701f670808c
50 make
51 make install
52
53 # ... cvc5
54 cd ../cvc5
55 git rev-parse HEAD
56 ./configure.sh --poly --auto-download -DCMAKE_CXX_FLAGS=-fpermissive
57 cd build
58 make -j$(nproc)
59 make install
60
61 # ... bitwuzla
62 cd ../../bitwuzla
63 git checkout 19dd987a6e246990619751cca07996fac505fd0b
64 ./contrib/setup-cadical.sh
65 ./contrib/setup-btor2tools.sh
66 ./contrib/setup-symfpu.sh
67 ./configure.sh
68 cd build
69 make -j$(nproc)
70 make install
71
72 # symbiyosys should be fine though
73 cd ../../sby
74 make install
75
76 cd ../yices2
77 autoconf
78 ./configure
79 make -j$(nproc)
80 make install
81
82 cd ../z3
83 python scripts/mk_make.py
84 cd build
85 make -j$(nproc)
86 make install
87
88 cd /home/$SUDO_USER/src
89 chown -R $SUDO_USER .
90 chgrp -R $SUDO_USER .