Building Pd on MinGW/Windows HOWTO
PD is easily built with free tools on Microsoft's non-free Windows OS. 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.
(mingwPORT aims to improve this situation, but for now you will need to grab parts seperately.)
- Cygwin
- Cygwin is relatively easy to install. MinGW lacks full support for some of the GNU utils, so install Cygwin's version also.
-
Download 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 cvs, make, openssh, patch, and sed and make sure they are set to install. This is represented by a version number to be installed instead of Skip.
- MinGW
-
Download the MinGW package installer and run it.
MinGW-5.0.3.exe
Choose the Candidate distribution. Install the defaults and add the g++ compiler, g77 compiler, and MinGW make - Or you can just download my MinGW install, MinGW-Pd.tar.bz2, and uncompress it so that its installed into C:\MinGW. This includes most of the libraries listed below.
- MSYS/msysDTK
- Install these with all of the defaults:
- MSYS-1.0.10.exe
msysDTK-1.0.1.exe
Now 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 -> MSYS -> msys
Once you are in the MSYS shell, you need to make /usr/local:
mkdir /usr/localNow edit C:\msys\1.0\etc\fstab, or from within the MSYS shell, /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 shel, 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) ...
- Upgrade autoconf
- Some of the externals need a newer version of autoconf, so you need to manually upgrade it, or use Cygwin's autoconf manually. To upgrade autoconf in MSYS, first download msys-autoconf-2.59.tar.bz2 and save it in C:\msys\1.0\. Now open a Cygwin shell and run these commands:
cd /cygdrive/c/msys/1.0 tar xjf msys-autoconf-2.59.tar.bz2
Now open an MSYS shell, and check to see that you have autoconf 2.59:
autoconf --version
- pthreads
-
Download pthreads-w32-2-7-0-release.exe
and extract it be double-clicking it. Then run these commands in the MSYS
shell:
cd pthreads.2 make clean GC-inlined cp libpthreadGC2.a /usr/local/lib cp pthreadGC2.dll /usr/local/bin cp pthread.h sched.h semaphore.h /usr/local/include/
- Tcl & Tk
-
Download tcl8.4.13-src.tar.gz and tk8.4.13-src.tar.gz. Open an MSYS shell and run:
tar xzf tcl8.4.13-src.tar.gz cd tcl8.4.13/win ./configure && make CYGPATH=echo && make install cd ../.. tar xzf tk8.4.13-src.tar.gz cd tk8.4.13/win ./configure && make CYGPATH=echo && make install
-
If you get an error like this:
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
then check out the bottom of this page: http://wiki.tcl.tk/12317
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [regcomp.o] Error 2 - 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.1.zip and install these files:
cp asiosdk2.1/common/*.h /usr/local/include cp asiosdk2.1/host/*.h /usr/local/include cp asiosdk2.1/host/pc/*.h /usr/local/include mkdir /path/to/pd/asio cp asiosdk2.1/common/asio.cpp /path/to/pd/asio cp asiosdk2.1/host/asiodrivers.cpp /path/to/pd/asio cp asiosdk2.1/host/pc/asiolist.cpp /path/to/pd/asio
You now have everything you need to build Pd from CVS, as well as abstractions and doc. The next section covers what you need to build the extensions, externals, and packages sections. You can follow the instructions below, or you can try this script: build-libs-for-pd-on-mingw.sh Download all of the tarballs listed below, then run this script in the directory where all the tarballs are saved.
- Ogg Vorbis
- This is needed to compile the ogg-based externals for reading, writing and streaming ogg files.
-
libogg-1.1.3.tar.gz
is the version that is currently used in the build system.
tar xzf libogg-1.1.3.tar.gz && cd libogg-1.1.3 ./configure && make && make install
-
libvorbis-1.1.2.tar.gz
is the version that is currently used in the build system.
tar xzf libvorbis-1.1.2.tar.gz && cd libvorbis-1.1.2 ./configure && make
Then, after it dies with lots of errors, run this:cd lib /bin/sh ../libtool --tag=CC --mode=link gcc -O20 -D__NO_MATH_INLINES \ -fsigned-char -DUSE_MEMORY_H -o libvorbisfile.la -rpath \ /usr/local/lib -no-undefined -version-info 4:0:1 vorbisfile.lo \ libvorbis.la /usr/local/lib/libogg.la cd .. make && make install - LAME
-
This didn't work for me the first time, but I tried later, and it magically worked!
lame-3.97.tar.gz for mp3 supporttar xzf lame-3.97.tar.gz cd lame-3.97 ./configure && make && make install
- FLAC
-
This only partially worked for me.
flac-1.1.2.tar.gz
is the version that is currently used in the build system.
tar xzf flac-1.1.2.tar.gz && cd flac-1.1.2 ./configure && make && make install
- speex
- speex-1.1.12.tar.gz
tar xzf speex-1.1.12.tar.gz && cd speex-1.1.12 ./configure --enable-sse && make && make install
- libsndfile
-
This didn't work for the first time, but I tried later, and it magically worked!
Download libsndfile-1.0.17.tar.gz and:tar xzf libsndfile-1.0.17.tar.gz cd libsndfile-1.0.17 ./configure && make && make check && make install
Or read these instructions. - GNU regex
- regex-0.12.tar.gz (instructions were derived from: Building and install GNU Regex). You can ignore the
TeX errors as long as you end up with the file regex.o
tar xzf regex-0.12.tar.gz cd regex-0.12 ./configure && make ar ru libregex.a regex.o cp libregex.a /usr/local/lib cp regex.h /usr/local/include
- FFTW 2
-
Download fftw-2.1.5.tar.gz and:
tar xzf fftw-2.1.5.tar.gz cd fftw-2.1.5 ./configure --enable-float --enable-i386-hacks make make install
The above settings work best for Pd. You can customize your build by following these instructions. - FFTW 3
-
Download fftw-3.1.2.tar.gz and:
tar xzf fftw-3.1.2.tar.gz cd fftw-3.1.2 ./configure --with-our-malloc16 --with-windows-f77-mangling --enable-shared --disable-static --enable-threads --with-combined-threads --enable-portable-binary --enable-float --enable-sse make make install
The above settings work best for Pd. You can customize your build by following these instructions.
Checking the source code from CVS
The easy way to do checkout everything is to run this script where you want to put the Pd code: checkout-developer-layout.sh
But you can also do it manually: How to download from the SourceForge CVS
Building Pd-extended with MinGW
./configure doesn't yet work with MinGW, so you have to use this
MinGW Makefile. Download makefile.mingw and put it into pure-data/pd/src. There are also a lot of patches that need to be applied. To apply them, run a Cygwin shell. In the Cygwin shell, do:
cd pure-data/packages make patch_pd cd ../pd/src make -f makefile.mingw
For creating the Pd-extended installer
- 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.1.7.exe downloads and installs everything for you.
-
For building with SCons (pd-devel)
- copy scons/Scripts/* to MinGW's /bin and add eg c:\mingw\bin to PATH in System->Advanced->Environment
- logout and back in and start->run: rxvt -sl 10000 -geometry 90x50 -e sh --login -i
now you are in GNU land, so get PD source
- cvs -d :pserver:anonymous@cvs.sf.net:/cvsroot/pure-data co -r devel_0_39 pd
- add the .h and .cpp files from ASIO SDK into pd/src
and compile
- cd pd && scons install
your pd should end up in /usr/local/bin/pd.exe ...
optionally build the CVS externals as well
- cvs -d :pserver:anonymous@cvs.sf.net:/cvsroot/pure-data co externals
- cd externals/build && scons install