Eric's Page

Fixes and Tips

After finding so many useful tips and bug-fixes on forums and blogs, I decided to finally start listing the things I have figured out so that all you other crazy programmers can save some time.  Below you'll find some things that took me a while to figure out.  Some of these tips may exist elsewhere online, but I thought they were worth reproducing here.

Compiling Portaudio on Snow Leopard (Mac OS X 10.6)  

9-30-2009

I recently upgraded to Snow Leopard, so I had trouble compiling the Portaudio audio I/O library.

Per the instructions for compiling on Mac OSX on the Portaudio website, run "./configure" from the portaudio directory.  The next step is to run "make".  This may result in compilation errors similar to the following:

...
cc1: warnings being treated as errors
src/common/pa_dither.c: In function 'PaUtil_Generate16BitTriangularDither':
src/common/pa_dither.c:73: warning: right shift count >= width of type
src/common/pa_dither.c:74: warning: right shift count >= width of type
src/common/pa_dither.c: In function 'PaUtil_GenerateFloatTriangularDither':
src/common/pa_dither.c:100: warning: right shift count >= width of type
src/common/pa_dither.c:101: warning: right shift count >= width of type
lipo: can't figure out the architecture type of: /var/folders/Yb/YbisVQwbFFiUBYFUlwO1yU+++TI/-Tmp-//cc52JJ8X.out
make: *** [src/common/pa_dither.lo] Error 1
...


We are getting type size errors.  The configure script correctly identified sizeof(long int) to be 8 bytes on our system; however, the 32bit systems that the make file is also compiling for don't like this.  To fix this, we need to edit the Makefile in the portaudio directory:

Open up the "Makefile" and remove the argument "-DSIZEOF_LONG=8" under the CFLAGS variable.
Now just run "make clean" and then "make" and it should all compile.