Add verilator install script.
authorR Veera Kumar <vklr@vkten.in>
Wed, 19 May 2021 21:11:48 +0000 (02:41 +0530)
committerR Veera Kumar <vklr@vkten.in>
Wed, 19 May 2021 21:11:48 +0000 (02:41 +0530)
verilator-install [new file with mode: 0755]

diff --git a/verilator-install b/verilator-install
new file mode 100755 (executable)
index 0000000..c136a0f
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+apt-get update -y
+apt-get install -y python3 make autoconf g++ flex bison ccache \
+               numactl libgoogle-perftools-dev perl-doc \
+               zlibc zlib1g-dev git
+
+# change into $SUDO_USER home directory
+cd /home/$SUDO_USER
+mkdir -p src/verilator
+cd src/verilator
+
+git clone https://github.com/verilator/verilator
+
+cd verilator
+git checkout v4.106
+autoconf
+./configure --prefix=/usr/local/verilator
+make -j$(nproc)
+make install
+
+cd /home/$SUDO_USER/src/verilator
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+