Following these instructions could render your computer unfunctional. It also might destroy data stored on your computer or make data inaccessible.
THESE INSTRUCTIONS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE INSTRUCTIONS IS WITH YOU. SHOULD THE INSTRUCTIONS PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
From version 5.2.38, Praat sources can be compiled out-of-the-box for Windows XP using the MinGW compiling suit. To compile Praat, first install MinGW. Then download all the header files and libraries and move them to the include and lib directories of MinGW.
Download the latest Praat sources from http://www.praat.org/download_sources.html. Unpack the sources and place them in a convenient place.
Go to the top level directory of the Praat sources. Copy the file makefile.defs.mingw32 from the subdirectory makefiles to makefile.defs in the top level directory of the Praat sources. You can also make a link or shortcut to makefile.defs.mingw32, as long as the name of the link or shortcut is makefile.defs.
cd ~/sources_5242 ln -s makefiles/makefile.defs.mingw32 makefile.defs
Follow the direction in http://www.mingw.org/wiki/InstallationHOWTOforMinGW.
After installation you can use MinGW by way of the MinGW Shell which runs the Bash shell.
There is some information on MinGW for Mac OSX here. However, it is easier to use the MacPorts system. Install the MacPorts system following the instructions from http://www.macports.org/install.php. You might find it convenient to also install the MacPortsGUI, or Porticus. However, check whether these are compatible with the MacPorts version you installed. Note that you must have sudo rights to install anything on Mac OSX.
On the Mac, open a terminal window and type:
sudo port install i386-mingw32-gcc i386-mingw32-binutils i386-mingw32-libunicows i386-mingw32-runtime i386-mingw32-w32api
You will be asked for your password. Installation might take some time.
When using MacPorts, MinGW will be installed under /opt/local/i386-mingw32/ with the binaries in /opt/local/bin. However, the Praat makefile assumes that everything is installed under /mingw32. Moreover, the programs have names that differ from those the makefile assumes. And finally, windres seems to be in an unexpected place.
To set up the links with the correct names run the following commands:
# create a directory /opt/local/mingw32
sudo mkdir /opt/local/mingw32/
sudo ln -s /opt/local/i386-mingw32/lib /opt/local/mingw32/
sudo ln -s /opt/local/i386-mingw32/include /opt/local/mingw32/
sudo ln -s /opt/local/mingw32 /mingw32
sudo mkdir /opt/local/mingw32/bin
sudo ln -s /opt/local/bin/i386-mingw32-ranlib /opt/local/mingw32/bin/ranlib
sudo ln -s /opt/local/bin/i386-mingw32-gcc /opt/local/mingw32/bin/gcc
sudo ln -s /opt/local/bin/i386-mingw32-g++ /opt/local/mingw32/bin/g++
sudo ln -s /opt/local/bin/i386-mingw32-windres /opt/local/mingw32/bin/windres
Using Synaptic or apt-get, install mingw32. On the command line this would be:
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
You will be asked for your password.
Under Linux, MinGW will be installed under /usr/i586-mingw32msvc with the binaries in /usr/bin. However, the Praat makefile assumes that everything is installed under /mingw32. Moreover, the programs have names that differ from those the makefile assumes. And finally, windres seems to be in an unexpected place.
To set up the links with the correct names run the following commands:
# create a directory /opt/mingw32
sudo mkdir /opt/mingw32/
sudo ln -s /usr/i586-mingw32msvc/lib /opt/mingw32/
sudo ln -s /usr/i586-mingw32msvc/include /opt/mingw32/
sudo ln -s /opt/mingw32 /mingw32
sudo mkdir /opt/mingw32/bin
sudo ln -s /usr/bin/i586-mingw32msvc-ranlib /opt/mingw32/bin/ranlib
sudo ln -s /usr/bin/i586-mingw32msvc-gcc /opt/mingw32/bin/gcc
sudo ln -s /usr/bin/i586-mingw32msvc-g++ /opt/mingw32/bin/g++
sudo ln -s /usr/bin/i586-mingw32msvc-windres /opt/mingw32/bin/windres
After installation of the MinGW suit, the header files required by Praat must be installed. These are the DirectX headers, two header files from the Windows SDK, pthreads-win32 headers, and gdiplus headers and library.
To make things interesting, the GdiPlus*.h header files (and some others) are often called with
assorted case errors. As only Linux is case sensitive, this will trip up only Linux. As a cludge until the
sources and libraries have been corrected, run the following commands.
sudo ln -s /mingw32/include/GdiPlus.h /mingw32/include/gdiplus.h
sudo ln -s /mingw32/include/GdiPlusimageAttributes.h /mingw32/include/GdiPlusImageAttributes.h
sudo ln -s /mingw32/include/GdiPlusMetaFile.h /mingw32/include/GdiPlusMetafile.h
sudo ln -s /mingw32/include/shlobj.h /mingw32/include/Shlobj.h
Then try the following command:
find /usr/i586-mingw32msvc/include/ -iname 'GdiPlus*.h'|perl -ane 'chomp;$o=$_;s/GdiPlus/Gdiplus/g;print "sudo ln -s $o $_\n"'
Now check and double check whether the resulting sudo command lines are correct! If they are correct,
append |bash after this line and run it again. If you do not know what these lines are supposed to do,
do not try this.
Start MinGW shell from the start menu. Go to the top level directory with the Praat source and enter:
cd ~/sources_5238
make
Go do something else, because it will take some time.
Open a terminal window. Go to the top level directory with the Praat source and enter:
cd ~/sources_5238
make
Go do something else, because it will take some time.
You can test out the compiled praat.exe on OSX using a WineBottler. Winebottler is based on Wine.
Open a terminal window. Go to the top level directory with the Praat source and enter:
cd ~/sources_5238
make
Go do something else, because it will take some time.
You can test out the compiled praat.exe on Linux using a Wine.