Open-source tools for Cygwin on Windows

Magic, XCircuit, IRSIM, Netgen, Qrouter, Qflow, and PCB are all capable of running under Windows. However, the graphics of all except netgen (which is not a graphics program) are based on X11, the UNIX-based graphics environment, which not compatible with Windows API. Also signalling, system calls, etc., etc., are all UNIX based. Fortunately, there is something called Cygwin, that is an implementation of RedHat Linux that runs under Windows. In a nutshell, Cygwin comprises a set of DLL files implementing UNIX system calls (no small feat), and allows UNIX programs to be compiled and run in Windows. An important part of this packages is the X11 server that implements the X11 event mechanism, so that UNIX/X11 graphics programs can also be compiled and run. In versions since around 2003, the Cygwin X11 server can be run with the "-multiwindow" switch, in which case it runs as a background process on the Windows desktop, and allows X11 windows to appear directly on the desktop (before that, X11 created its own window and applications appeared inside the X11 window, not on the desktop).

There are, as one might expect, some complications. The best versions of the open source EDA tools are the ones based on the Tcl/Tk interpreter. The Tcl/Tk "wish" program is available as part of the Cygwin package. Versions of Cygwin since 2012 have Tcl/Tk compiled using X11. Previous versions used Windows API graphics and are not compatible. See below for a legacy X11-based Tcl/Tk version for Cygwin, but this is no longer necessary.

Because software changes all the time, my usual declaration is that everyone should compile from source. In the case of this hodgepodge of Tcl/Tk, X11, and Cygwin, however, compiling from source is a relatively painful experience for the uninitiated (not to mention a bit annoying for the expert, as well), so in this case, I try to provide binaries for download along with specific instructions that, if followed to the letter, should result in a successfully running program. But, as mentioned at the top of the paragraph, software changes all the time, and programs break, and nothing can be guaranteed. So instructions for a full compile from scratch are provided at the end, if it all comes down to that kind of desperation.

Cygwin distribution download and install:

The first thing you will need is the Cygwin distribution, if you do not already have it (you should!). You can determine for yourself how much of this beast you want to download and install, based on disk space and bandwidth limitations. However, if you have the disk space, and you have the bandwidth, and about an hour to spare while you go have lunch, then you might as well do the full install.

  1. Go to the Cygwin website at www.cygwin.com. Click on the "Install Cygwin" button.
  2. Follow the instructions there for installation. Note that the basic installation will be missing a number of things needed to compile and install these EDA tools. Keep the "setup" executable around; it is, in effect, a package manager, and can be used to add missing components to Cygwin at any time.

  3. Eventually the install wizard gets to the page of choices about which packages to install. I usually select the essential, basic options plus some listed below (for compiling). If you are just going to download and install the pre-compiled binaries, you should not need anything more than the default setup.

    To run X11, make sure you have the following package selected (click on "X11" to open the list of X11 packages):

    • xorg-xserver under X11.
    • startxwin under X11.
  4. Select the OpenGL libraries. These packages are:
    • libGL under X11
    • libGLU under X11
  5. Select tcsh:
    • tcsh under Shells
  6. Select Tcl/Tk:
    • Tcl/Tk under Interpreters
    • Tcl/Tk-devel under Interpreters
  7. If you just want to install the precompiled versions of various tools found on this website, then the above should be sufficient, along with the standard Cygwin installation. If you want to compile and install the EDA tools from source, you will need the following packages:
    • autoconf under Devel
    • libtool under Devel
    • gcc under Devel
    • make under Devel
    • cmake under Devele
    • M4 under Interpreters
    • X11 development under X11
    The following packages are optional but will make life easier if anything goes wrong:
    • gdb at Devel/gdb
    • emacs at Editors/emacs or
    • vim at Editors/vim
    The following packages are not needed by the EDA tools but are a good idea to include anyway:
    • zip at Archive/zip
    • unzip at Archive/unzip
    • automake at Devel/automake
    • g++ at Devel/g++
    Fortunately, once Cygwin is installed, missing pieces can be installed by the same process without having to reinstall everything.

    Continue through the Cygwin install process. Normally, I choose the default destination, which is "C:\cywgin". This location will be the assumption for the remainder of these instructions.

  8. Cygwin should put the X11 server icon on the desktop and/or Windows start menu, so all you have to do is to launch it. If it is not there, then you can run it by launching a Cygwin terminal from the windows desktop. At the terminal prompt, type "startxwin" to get the X11 server running in the background on the windows desktop. With this method (i.e., running from a terminal) all sorts of debugging information gets printed to this window, so it's best to pop it down. The "X" logo should appear on the Windows taskbar.

  9. To test the ability to run X11 applications, bring up another Cygwin terminal from the windows desktop. At the prompt, type "export DISPLAY=:0.0" followed by "oclock" (this may require selecting "oclock" for install in the Cygwin setup). The X11 analog clock should appear on the Windows desktop. If you get this far, you're ready to proceed with downloading and installing any of the EDA tools listed below.

EDA Tools binary distribution download and install:

Downloading and installing EDA tools:
Tcl/Tk forms the backbone for all of the Tcl/Tk-based EDA tools. Once it has been properly installed from the Cygwin setup, each of the EDA tools can be downloaded as a .tgz file and installed according to the instructions found on the following pages:
  1. Magic
  2. XCircuit
  3. IRSIM
  4. Netgen
  5. Qrouter
  6. Qflow
  7. PCB

Tcl-Cygwin binary distribution download and install (legacy, pre-2012):

Deprecated, deprecated, deprecated.

This is the legacy version of Tcl/Tk 8.5 from before 2012 when Cygwin switched from the Win32 version of Tcl/Tk to the X11 version, which is compatible with the EDA tools. The binary download and also the instructions for compiling from source are included here, although they are thoroughly deprecated.

In other words, you should not need to do anything in this section.

Download:

File Revision Size Date
tcltk_x11_win.tgz 8.4.11 (2.87MB) October 18, 2005
tcltk_x11_vista.tgz 8.5.0 (2.87MB) January 22, 2008
tcltk_x11_w7.tgz 8.5.11 (9.65MB) October 1, 2012

Install:

  1. Save the above file in the Cygwin root directory, which is normally "C:\cygwin" if the default setup was chosen for the Cygwin installation.
  2. Bring up a Cygwin terminal on the Windows desktop
  3. Do "cd /". The file tcltk_x11_win.tgz should be here.
  4. Do "tar xfz tcltk_x11_win.tgz"
  5. Use the file "tcltk_x11_vista.tgz" for Windows Vista. Other than the name, everything else works as advertised here. This also works for Windows-7. The version of Tcl/Tk is 8.5.0.
  6. Use the file "tcltk_x11_w7.tgz" for Windows-7. Other than the name, everything else works as advertised here. The version of Tcl/Tk is 8.5.11.

Test:

If the X server is on the desktop, then launch it. If not, then bring up one Cygwin terminal and do:
  1. XWin -multiwindow
Either method will run the X server in the background (which should show up as the X11 "X" icon on the Windows taskbar). Diagnostic output ends up going to the terminal if you run it from the terminal command line.

Now, bring up a new Cygwin terminal and do:

  1. export PATH=$PATH:/usr/local/lib
  2. export DISPLAY=":0"
  3. wish
Hopefully this should result in a "%" prompt in the Cygwin terminal and a new window called "wish" on the Windows desktop. Note that if you do not do the "export PATH" line, you will likely get the Windows API graphics-based version of "wish", which is not the right one, and will not work with the EDA tools!

Tcl-Cygwin source distribution download, compile and install:

This is not the recommended procedure, as the compile process is annoyingly difficult. For completeness, I am providing the set of instructions detailing the steps I took to get the source for X11-based Tcl/Tk to compile under Cygwin. Follow this link.

email:

Last updated: August 5, 2016 at 6:47pm