Views
Updated guide for building Pd-0.48-1 or later. The preferred guide is for Msys2. You can also compile with Msys1.
Outdated contents are moved down.
Building on Windows with Msys2
Download the 64-bit installer from:
Follow installation instructions on: https://www.msys2.org/wiki/MSYS2-installation/
Add with pacman these packages:
pacman -S make autoconf automake libtool
Then the 32-bit compiler:
pacman -S mingw32/mingw-w64-i686-gcc
and the 64-bit compiler:
pacman -S mingw64/mingw-w64-x86_64-gcc
Get Pd sources
Download the Pd sources from GIT. There's a big green button "clone or download" at https://github.com/pure-data/pure-data
Download the ASIO SDK
Install the ASIO SDK by doing the following:
-
1. Download the ASIO SDK: https://www.steinberg.net/en/company/developer.html
-
2. Uncompress asiosdk2.3.zip (or higher) into the ASIO folder of your downloded Pd sources
-
3. remove the version number so that you get pure-data/asio/ASIOSDK
Build Pd for 32-bit
Open the MinGW32 shell and do:
cd full/path/to/your/pd-master-sources ./autogen.sh ./configure make make app
Build Pd for 64-bit
Open the MinGW64 shell and do:
cd full/path/to/your/pd-master-sources ./autogen.sh ./configure make make app
Additonal notes for using other TCL/TK
Read https://github.com/pure-data/pure-data/blob/master/msw/README.txt
Building on Windows with Msys1
Install MinGW. The preferred directory is C:\MinGW
In the MinGW Installer Manager, select Installation > Update Catalogue
In 'Basic Setup' install:
-
mingw-developer-toolkit / bin
-
mingw32-base / bin
-
mingw32-gcc-g++ / bin
-
msys-base / bin
In 'All Packages > MinGW > MinGW Libraries' install:
-
mingw32-pthread-w32 / dev
The old automake versions 1.4 to 1.8 in 'All Packages > MinGW > MinGW Autotools' can be removed.
The command line shell can be started with C:\MinGW\msys\1.0\msys.bat. In the shell C:\ is available as /c/.
Make sure you do not have the msys-gcc or msys-binutils installed. It is intended only for building msys, and uses an older versions.
Building Pd-Vanilla
Since Pd-0.48-1 you can do the same as for Msys2 with the same steps as above for the ASIO folder.
cd full/path/to/your/pd-master-sources ./autogen.sh ./configure make make app
To run your compiled Pd with Msys1 you should copy pthreadGC-3.dll and libgcc_s_dw2.dll from C:\MinGW\bin to your built pd/bin
== == == ==
############## Building Pd-Vanilla (outdated. used around 0.46.%)
-
Retrieve the source tar-ball from Millers site,
-
Unpack it to a path without spaces,
-
Rename the directory to 'pd' (this is also in the README.txt),
-
Expand the contents of asiosdk2.3.zip in a directory pd/lib (result is a pd\lib\ASIOSDK2.3 path),
-
Run in pd/src make -f makefile.mingw from the minGW shell.
Building externals
-
Download the Pd-extended repository or retrieve it via SVN. Use a path without spaces.
-
The pd-core here is outdated, the more recent code is in Git. But this isn't regularly updated either.
-
The MinGW Gcc compiler needs an pd.dll to build against. The simplest way is to build or download pd-vanilla and copy the pd.dll to pure-data-svn/pd/bin.
-
From the MinGW shell, change to pure-data-svn/externals.
-
Enter make <externalName> to build.
MinGW does not have convenient tools like subversion, git, zip, gpg. For this you can install Cygwin or use Windows tools.
Outdated Content:
Original page
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.
Tortoise SVN
TortoiseSVN provides a native Windows SVN. Its best to use native Windows tools for this process, but Cygwin tools can also work.
-
Download TortoiseSVN, either 32-bit or 64-bit works for this process
-
customize setup to include command line client tools
Git for Windows
There is a build of Git for Windows that is based on MinGW MSYS, but is in its own installer. For this process a native git is preferred, but its possible to use Cygwin git too.
-
Download Git-1.8.0-preview20121022.exe and install it.
-
choose Run Git from the Windows Command Prompt from the Adjusting your PATH environment step in the installer
Cygwin
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 setup-x86.exe or setup-x86_64.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.
If you want the automated build scripts to work, you will need to add Cygwin to your system PATH.
ASIO SDK
First, download the 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.3.zip into path/to/pd/asio so that the files are in path/to/pd/asio/ASIOSDK2.3.
You can also leave the asiosdk2.3.zip file directly in the home folder of MSYS, i.e. ~/asiosdk2.3.zip in the MSYS/MinGW shell or C:\MinGW\msys\1.0\home\%USER%\asiosdk2.3.zip. The Pd-extended build system will look for it there and automatically unzip it in the right place. For Pd-vanilla, you'll have to unzip in manually in the right place.
NOTE: The 2.2 version used by older versions of Pd is no longer available for download from Steinberg.
MinGW
Download the MinGW package installer and run it:
-
Accept the GPLv3 and click Next
-
Choose the Use pre-packaged repository catalogues and click Next
-
Install into the default location: C:\MinGW and click Next
-
Check all Components (MinGW Compiler Suite, MSYS Basic System, and MinGW Developer Toolkit). and click Next
-
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 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 automake1.10 automake1.9 bzip2 expat gcc-ada gcc-fortran \ gcc-g++ gcc-objc gendef gettext gmp libasprintf libbz2 libexpat libiconv \ libpthreadgc libtool libz lua mingw-utils pexports pkginfo msys-bash \ msys-bison msys-cygutils msys-dos2unix msys-findutils msys-gawk msys-gmp \ msys-gzip msys-less msys-libgmp msys-libregex msys-make msys-rsync \ msys-texinfo msys-wget msys-unzip msys-zip
For some reason, mingw also installs some very old versions of automake. They just get in the way and cause trouble, so remove them:
mingw-get remove automake1.4 automake1.5 automake1.6 automake1.7 automake1.8
You can now build Pd-vanilla!
Your setup is now ready to build Pd-vanilla or the core of Pd-extended. The rest of these instructions cover setting up all of the libraries for a complete Pd-extended build environment.
Binaries from MinGW and GTK+
The GTK+ project provides a number of 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 --no-check-certificate https://www.tortall.net/projects/yasm/releases/yasm-1.2.0-win32.exe mv yasm-1.2.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.
copying libgmp-10.dll for cc1.exe
Sometimes, you might get an error about cc1.exe missing libgmp-10.dll. 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.7.2/ cp libintl-8.dll libiconv-2.dll /mingw/mingw32/bin
Inno Unpack
For the Pd-extended zip distro, the Inno Setup package needs to be unpacked then zipped up. For that, we use innounp so we don't need admin rights to unpack it. Download innounp037.rar and unrar it into C:\MinGW\bin
QuickTime SDK
Gem uses 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 this link, then once logged in, click this link to download the file: 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
Inno Setup is free installer generator for Windows. ISTool is a nicer IDE for Inno scripts. This is used to assemble the Pd-extended installer.
-
ispack-5.5.2-unicode.exe downloads and installs everything for you.
Building library dependencies for Windows 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 pd-dev.
Libraries
Here are some documents that look to have some very useful info, but has not yet been incorporated into this process:
Problems building for Windows --yippee, Mon, 11 Apr 2016 21:08:53 +0200
Hi fjkraan, this is relevant to building pd vanilla 0.46-7 on windows 7 64-bit.
While following the instructions here for building, minwgw gives the error: gcc not found. That can be fixed by going to windows system properties > advanced > environment variables > user variables > PATH > and appending C:\MinGW\bin (or wherever gcc is located). This seems to be a common problem with mingw on windows. A windows reboot is most likely required here.
Past that, I get this error during building:
In file included from m_sched.c:24:0: c:\mingw\include\pthread.h:320:8: error: redefinition of 'struct timespec'
-
struct timespec {
-
^
-
In file included from c:\mingw\include\time.h:53:0,
-
from c:\mingw\include\pthread.h:219, from m_sched.c:24:
c:\mingw\include\parts\time.h:105:8: note: originally defined here
-
struct timespec
-
^
-
make: *** [m_sched.o]? Error 1
... --fjkraan, Sat, 16 Apr 2016 21:49:27 +0200
http://mingw.5.n7.nabble.com/mingw-error-redefinition-of-struct-timespec-td34655.html suggests:
Try adding '-DHAVE_STRUCT_TIMESPEC' to your CFLAGS. I think this worked for me.