--- /dev/null
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+ then echo "Please run as root using 'sudo bash'"
+ exit
+fi
+
+# Make sure to install the following first:
+# install-hdl-apt-req
+# hdl-dev-repos
+# hdl-tools-yosys
+
+# change into $SUDO_USER home directory
+cd /home/$SUDO_USER
+mkdir -p src/ice40k
+cd src/ice40k
+
+apt install libeigen3-dev libboost-filesystem-dev libboost-system-dev \
+ libboost-thread-dev libboost-iostreams-dev
+
+git clone https://github.com/YosysHQ/icestorm.git icestorm
+git clone --recursive https://github.com/YosysHQ/nextpnr
+
+## Project icestorm
+cd icestorm
+make -j$(nproc)
+make install
+
+## Project nextpnr
+cd ../nextpnr
+# Latest tag
+git checkout nextpnr-0.6
+cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local .
+make -j$(nproc)
+make install
+
+# tinyprog for programming FPGA
+pip3 install tinyprog
+
+cd /home/$SUDO_USER/src/ice40k
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+