[Lowerbounds, Upperbounds]

Algorithms are everywhere.

Recently I have looked into compiling Ipe on Windows. It’s really quite easy but here is a post on it for the public service anyway. The paths I use below are just examples.

  1. Download the source archive (currently version 6.0 preview 26) and expand it to C:\Checkouts\ipe. At this point there should be an ipe-6.0pre26 subdirectory C:\Checkouts\ipe\ipe-6.0pre26\.
  2. Duplicate this subdirectory into C:\Checkouts\ipe\current\ so that you have two parallel copies of the source tree. They are currently identical but we will change the one in this “current” directory. Below, we will call C:\Checkouts\ipe\current\ “the Ipe directory”. We want to keep ipe-6.0pre26 intact.
  3. While you are at the Ipe website, download the binary distribution too. You will need some files from there later.
  4. Download and install a MinGW distribution that has GCC 3.4.2. I use Dev-C++ since I have it already installed (and I can recommend that), but you can also get the vanilla MinGW instead. The installation must be done prior to the next step.
  5. Download Qt 4.1.1 Open Source edition and install it. During the installation, identify C:\Dev-Cpp\ as the MinGW directory to the installer.
  6. Download zlib 1.2.3 and freetype 2.1.0 from GnuWin32 and install them to C:\GnuWin32\.
  7. Modify Ipe\src\config.pri to reflect the paths below. Following our example, this is how the last section of config.pri should look like:
    win32 {
    DEFINES += WIN32
    ZLIB_INCLUDE = C:/GnuWin32/include
    ZLIB_LIBS = -LC:/GnuWin32/lib
    FREETYPE_INCLUDE = C:/GnuWin32/include/freetype2
    FREETYPE_INCLUDE += C:/GnuWin32/include
    FREETYPE_LIBS = -LC:/GnuWin32/lib
    }
  8. Turns out the current source distribution left out two small files accidentally. Get them here and put them in Ipe\src\ipe\.
  9. If you have Cygwin installed, find a way get rid of sh.exe on your path, say by renaming it. The goal is to make sure that the Cygwin shell does not get executed when you type sh in the command prompt. This is important. (Or if you know a way to force the make in MinGW32 to prefer cmd.exe to sh.exe, I would love to know.)
  10. Change directory to Ipe\src\.
  11. Execute qmake. This step takes very little time.
  12. Execute make. This can take a couple minutes.
  13. After the compilation has finished, you should have a subdirectory called Ipe\build\.
  14. From the binary distribution, copy the data\ subdirectory to Ipe\build\data\.
  15. For good measure, you should also copy the DLLs that are depended upon by your current build in Ipe\build\bin\. They are freetype6.dll, mingwm10.dll, QtCore4.dll, QtGui4.dll, zlib1.dll.
  16. This is part of the directory structure and I think it may help clarifying what happened above.

    C:\Checkouts\ipe\
    C:\Checkouts\ipe\ipe-6.0pre26\ (intact copy)
    C:\Checkouts\ipe\current\ (our working copy)
    C:\Checkouts\ipe\current\src\config.pri (edit this first)
    C:\Checkouts\ipe\current\src\ipe\ (then add two missing files)
    C:\Checkouts\ipe\current\build\ (made by the build process)
    C:\Checkouts\ipe\current\build\data\ (copied from binary distribution)
  17. At this point, you should be able to run Ipe\build\bin\ipe.exe.

You are done!