The world of open source software development doesn’t sit still. A program that I rely on to build PaulStretch on OSX is CMake, which is an open source, cross-platform program that hides some of the complexity of building software on different platforms.
If you’ve built any software on OS X or Linux you’re probably familiar with the “./configure ; make ; make install” method of working with source packages. CMake does that but it goes out of its way to handle the low level crap that is a pain in the ass to set up program configuration with autoconf. On top of that, it will run on any Unix, OS X or Windows. And on top of THAT, it will generate Makefiles, or project files for any of the commonly used integrated development programs like Visual Studio (on PC) and XCode (on Mac).
CMake really is as close as you can get to ‘write once, run anywhere’ in the world of C and C++. Not that there won’t be platform-specific stuff you’ll have to do, but it’s a lot easier and more concise in CMake.
Anyway, as of CMake 2.8, there is a powerful new CMake Module called ExternalProject. It automates downloading, configuring and building open source packages. I’ve used ExternalProject heavily in my day job, so it seemed natural to use it to streamline building PaulStretch. The result is maybe just as complex as the original build setup, but it is a lot more robust. Reading through the CMakeLists.txt files I’ve set up will be a good introduction to how things work in CMake — I’ve done a bunch of things in there you’ll want to know how to do for your own projects — use ExternalProject_add to download and build libraries, do some platform-specific configuration, create an executable, etc.
You can download the new PaulStretch Build package here: http://www.cornwarning.com/xfer/PaulStretchBuild-2.1.tar.gz
The instructions are pretty straightforward:
0. Make sure you have the compilers and development libraries installed on your system.
1. Download the Tar file
2. unpack the tar file, somewhere you have write permission.
3. Run PaulStretch/BuildPaulStretch.sh
On OS X, this will create a paulstretch.app, that you can drag and drop wherever you want. On Linux, the executable will be in bin/paulstretch — it’s statically linked so it will run without needing anything besides the program file on your system. Or, for that matter, any other compatible Linux distribution.
The result is an executable program in whatever directory you’ve run this process in. The following commands would accomplish this whole process in a directory called ‘PaulStretch’ in your home directory.
mkdir -p ~/PaulStretch
curl http://www.cornwarning.com/xfer/PaulStretchBuild.tar.gz | tar xzf –
After running these commands, on OS X your PaulStretch program will be ~/PaulStretch/paulstretch.app. On Linux, it will be ~/PaulStretch/bin/paulstretch.
As an added bonus, I took the time to try building on a couple of different Linux systems, to verify it works there.
Once again, what will trip up the non-software-developer types in this whole process is step 0: making sure the dev tools are available on your system. That’s something I’m not going to explain here. Google it. You’ll need GCC installed, all the development libraries, and on Linux the development libraries for libasound — the ALSA sound library.
If you happen to be a Windows developer, you could take a crack at building using Visual Studio or MinGW. The CMake build files are theoretically portable, but you’ll have to download CMake for Windows (here: http://www.cmake.org/files/v2.8/cmake-2.8.3-win32-x86.exe)I haven’t done this, because I avoid doing development work on my Windows machines at home. If I’m at home, and farting around on the computer, I want to be able to just use music software, not build it. Plus you can download the Windows version of PaulStretch here: http://sourceforge.net/projects/hypermammut/.
Let me re-iterate again — I don’t want to be tech support for this — if you can’t figure out from this post how to use what I’ve put together, you probably shouldn’t even be trying to build it yourself. Ask your kid nephew who’s a big H4X0R to do it for you.