Personal tools
You are here: Home documentation developer WindowsMinGW
Views

Edit history

Edit: -1 of 1
Time: 2011-08-29 03:57:33
Note: /pd/pd/docs/developer/WindowsMinGW/edit "fixed glitch in mingw-libgnurx"

changed:
-
----
Pd is easily built with free tools on Microsoft Windows, and recently with the creation of the mingw-get tool, its much easier to get started. While you could probably use the most current versions of all of the packages below, the links provided are versions that are known to work.

== Cygwin ==

[http://cygwin.com Cygwin] is relatively easy to install and provides a much better working environment for things like subversion.  !MinGW lacks full support for some of the GNU utils like rsync, git, svn, etc., so install Cygwin's version.

 Download [http://cygwin.com/setup.exe setup.exe] and run it to install Cygwin.  Install it in the default location.

Once you get to the ''Select Packages'' screen, click the button on the upper right corner labeled ''View'' and change it to ''Full''.  Now find '''git''', '''make''', '''openssh''', '''patch''', '''rsync''', '''sed''', '''svn''', '''zip''', and '''unzip''' and make sure they are set to install.  This is represented by a version number to be installed instead of ''Skip''.


== !MinGW ==

Download the [http://www.mingw.org/ !MinGW] package installer and run it:

 1. [http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20110802/mingw-get-inst-20110802.exe/download mingw-get-inst-20110802.exe]
 1. Accept the GPLv3 and click ''Next''
 1. Choose the '''Use pre-packaged repository catalogues''' and click ''Next''
 1. Install into the default location: '''C:\MinGW''' and click ''Next''
 1. Check all Components ('''MinGW Compiler Suite''', '''MSYS Basic System''', and '''MinGW Developer Toolkit'''). and click ''Next''
 1. wait for the installer to download and install everything, now you have a working MinGW install and MSYS shell.

== Configuring MSYS ==

For the next steps, you will be using the MSYS shell that was installed from the MSYS installer. You can launch it from the Desktop shortcut or '''Start --> Programs --> !MinGW --> !MinGW Shell'''.  Once you are in the MSYS shell, you need to make '''/usr/local''' by running:

{{{
mkdir /usr/local
}}}

Now edit '''C:\MinGW\msys\1.0\etc\fstab''' using a good text editor (`vim` is now included in MinGW, Wordpad will work but '''not''' Notepad), or from within the MinGW/MSYS shell, `vim /etc/fstab`.  In that file, make sure you have these two lines (case is important!):

{{{
c:/MinGW/ /mingw
c:/MinGW/ /usr/local
}}}

Then quit all MSYS shells, and restart an MSYS shell, and check with the
'''mount''' command that both of the above directories are mounted.  To
do that, run '''mount'''.  You should see these lines within the rest:

{{{
...
c:\MinGW on /mingw type user (binmode)
c:\MinGW on /usr/local type user (binmode)
...
}}}

You can add MinGW and MSYS to the PATH so that Windows tools like `cmd.exe` can find them. For how to setup the environment variables for MSYS, check out Figure 10 and after in Max Berger's [http://max.berger.name/howto/cdt/ar01s03.jsp Setting up the compiler].  

== !MinGW extras ==

We need some packages that are not part of the default install, but are included in MinGW. In the MinGW/MSYS shell, run:
{{{
mingw-get install mingw-utils pexports cygutils msys-wget msys-zip msys-unzip \
          msys-libregex msys-texinfo msys-gmp msys-libgmp msys-bash \
          expat libexpat zlib libz gmp bzip2
}}}

== Binaries from MinGW and GTK+ ==

The GTK+ project provides a number of [http://www.gtk.org/download/win32.php binaries for Windows]. We use a few of them here.  Download and install them into '''C:\!MinGW''' using the !MinGW/MSYS shell.  The easiest way to do this is with with !MinGW/MSYS shell, by running these commands:

{{{
cd /tmp
wget http://prdownloads.sourceforge.net/mingw/mingw-libgnurx-2.5.1-bin.tar.gz
wget http://prdownloads.sourceforge.net/mingw/mingw-libgnurx-2.5.1-dev.tar.gz
tar --directory /mingw -xzf mingw-libgnurx-2.5.1-bin.tar.gz
tar --directory /mingw -xzf mingw-libgnurx-2.5.1-dev.tar.gz
wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0-win32.exe
mv yasm-1.1.0-win32.exe /mingw/bin/yasm.exe
wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.25-1_win32.zip
wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-dev_0.25-1_win32.zip
wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.1-1_win32.zip
wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib-dev_2.28.1-1_win32.zip
wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
unzip pkg-config_0.25-1_win32.zip -d /mingw 
unzip pkg-config-dev_0.25-1_win32.zip -d /mingw 
unzip glib_2.28.1-1_win32.zip -d /mingw 
unzip glib-dev_2.28.1-1_win32.zip -d /mingw
unzip gettext-runtime_0.18.1.1-2_win32.zip -d /mingw
}}}

The last step will prompt you to replace /mingw/share/locale/locale.alias, say '''Yes'''.

== Reboot ==

Just in case, it is good to reboot now.  Sometimes, you might get [http://www.ogre3d.org/forums/viewtopic.php?f=2&t=65683 an error about cc1.exe missing libgmp-10.dll]. It seems to be fixed by rebooting.

=== copying libgmp-10.dll for cc1.exe ===

Sometimes, even after rebooting, cc1.exe still gives an error about a missing `libgmp-10.dll` and other DLLs.  You can test this by running `./configure` in '''libtheora'''.  A kludge to fix it is to copy the DLLs into place right next to cc1.exe.  At the time of writing this document, it worked like this:

{{{
cd /mingw/bin
cp libgmp-10.dll libmpc-2.dll libmpfr-1.dll libintl-8.dll /mingw/libexec/gcc/mingw32/4.5.2/
cp libintl-8.dll libiconv-2.dll /mingw/mingw32/bin
}}}

== ASIO SDK ==

First, download the [http://www.steinberg.net/nc/en/company/developer/sdk_download_portal.html ASIO SDK]. You have to agree to Steinberg's license, then submit an email address, then they'll send you the download URL in an email.  Uncompress '''asiosdk2.2.zip''' into '''path/to/pd/asio''' so that the files are in '''path/to/pd/asio/ASIOSDK2'''.

=== QuickTime SDK ===

Gem uses [http://developer.apple.com/quicktime/ !QuickTime] on Windows for reading and writing video files.  You need an Apple ID in order to log in and download the `quicktimesdk.zip`.  First login by clicking [http://connect.apple.com this link], then once logged in, click this link to download the file: [http://adcdownload.apple.com/QuickTime/quicktime_7.3_sdk_for_windows/quicktimesdk.zip !QuickTime 7.3 SDK for Windows].  Once you have it, unzip it, then double-click the `!QuickTimeSDK.exe` and install using all of the defaults.

= Install Inno Setup package building =

== Inno Setup/!ISTool  ==
[http://www.jrsoftware.org/isinfo.php Inno Setup] is free installer generator for Windows. [http://www.istool.org/ !ISTool] is a nicer IDE for Inno scripts.  This is used to assemble the Pd-extended installer.

 [http://files.jrsoftware.org/ispack/ispack-5.2.3.exe ispack-5.2.3.exe] downloads and installs everything for you.



= Building from SVN '/sources' =

There are many libraries needed for building Pd libraries that are not yet available via `mingw-get` or binaries.  The best way to get these currently is to build them from source. For Pd-extended, you can get the sources from SVN and run this script to build it all:

{{{
cd pure-data
svn co https://pure-data.svn.sourceforge.net/svnroot/pure-data/sources
cd sources
./build-libs-on-mingw.sh
}}}


This will run for a while, and if it completes successfully, it will have installed all of the libraries needed for Pd-extended.  It should be safe to run '''./build-libs-on-mingw.sh''' again if something failed.


= Building Pd =

Now you're ready to start building Pd.  First, you'll need to start with [GettingPdSource], then you can move onto [BuildingPd] or [BuildingPdExtended].

= Updating this Process =

There are definitely some improvements that can be made to this up build process.  !MinGW is widely used, but its not widely standardized.  So many people have many different ways of building common libs for !MinGW.  This process is an effort to unify them, the biggest recent development along these lines is `mingw-get`.  As of this writing, this process can successfully build ffmpeg with many codecs.  The last huge gap is gmerlin-avdecoder, which is used by ![readanysf~] and Gem.  There are a number of additional codecs that are not yet part of this process, for example openjpeg builds but doesn't seem to work, then there is libgsm and quite a few other codec libraries that ffmpeg and gmerlin-avdecoder can use.  You can contribute by getting these building and working on MinGW and posting your results on [http://lists.puredata.info/listinfo/pd-dev pd-dev].

== Libraries ==

Here are some documents that look to have some very useful info, but has not yet been incorporated into this process:

 *[http://www.pygame.org/wiki/MinGWBuildingDependenciesByHand?parent=MingW zlib, libpng, libjpeg, libtiff, and more]
 *[http://ffmpeg.arrozcru.org/wiki/index.php?title=Libschroedinger libschroedinger]


Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser