Magic VLSI – or just Magic – is a free and open source VLSI layout software. Simply put Magic allows you to draw the mask layers used in a semiconductor facrication process. The Magic software is another “Berkeley Child” (like BSD and others) and first came into existence in the 1980s. Magic is still under active development as of late 2019.

Some Linux distributions offer a pre-build package for Magic from their package repository. Most often these packages are outdated and therefor it is best to build Magic from the sources.

Start by pulling the latest release from the official project page.
$> git clone git://opencircuitdesign.com/magic
$> cd magic

$> git checkout magic-8.2

I am building Magic in a WSL Ubuntu 18.04 while writing this guide, so installing some additional packages is required before continuing. This step is subject to the build machine and may vary.
$> sudo apt install csh
$> sudo apt install libglu1-mesa-dev freeglut3-dev mesa-common-dev
$> sudo apt install tk tk-dev
$> sudo apt install libcairo2 libcairo2-dev

Now let’s continue to build Magic. I like to install software to /opt so it’s not burried deep inside the file tree and is available to all users on my machine (which is just me). The installation folder is set by the --prefix option.
$> ./configure --prefix=/opt/magic-8.2
If all the dependencies above where installed you should see a fivefold yes after the configure script has completed.

With that out of the way the build process can be launched as usual. The installation step may require to change the permissions on the installation folder, so that the current user has write access to the installation path.
$> make
$> make install

That’s it! Let’s see if it worked.
$> cd /opt/magic-8.2/bin
$> ./magic &

Success! Magic 8.2 has been launched.

In order to have something more than a gray box to look at let’s load the layout of an example gate from my Magic VLSI examples repo.

“Nice colors!” “Oh NAND you.”

That’s it for now. More examples on how to get started with Magic may follow.
P.S.: Before I forget to mention it, Magic requires a mouse with 3 buttons to work as intended. No kidding!

References:
[1] http://opencircuitdesign.com/magic/
[2] http://www.codebind.com/linux-tutorials/install-opengl-ubuntu-linux/
[3] https://github.com/andrsmllr/magic_vlsi_examples