Compiling for OS X

From The Powder Toy
Revision as of 16:27, 11 April 2013 by jacob1 (talk | contribs) (change SDL link, probably fixes fullscreen crash on macs (also untested, may not even work))
Jump to: navigation, search

Note: This page is only for OS X (10.7, 10.8) It may not work on 10.6 and below Note: This guide is untested, it may not work (possibility of lua errors or errors when running the final version). If there are problems, try posting your errors on the development help section of the forums, or coming onto irc.

Download Xcode from the App Store link

Download SDL link

Download xQuartz link


This should download to your downloads folder. Keep uncompressing until it becomes a folder.

Then, in terminal, type cd (<-- Make sure there is a space after) and then drag the SDL folder in.

then type in (or copy / paste) ./configure && make


If that comes up with an error, go to this page and download 'Command Line Tools for OS X'.

There are two versions. One is for lion 10.7 and the other is for mountain lion 10.8. If you don't know which you are using, go to the apple in the top left hand corner and press about my mac.

After that, install SDL by typing in sudo make install It will ask you for your password. Type it in and press enter.

Now, download scons and unzip it. Go into the terminal, and type in cd with a space after it and drag in the folder that you downloaded. Next type sudo python setup.py install. The terminal will ask you for your password. Note that you can not see your password while you are typing it in. You now have scons installed.


Go into the folder with the source code that you downloaded. Open up terminal again and type cd with a space after it. Drag in the folder with the source code.

Next type this into Terminal: scons --macosx --release --stable --sse2 --nofft. It will start compiling.

If it compiled without errors, you will find a file called powder-x in the build folder. Double click it and run it.

Congrats, you have compiled spare code and have made a OS X application.

This was written by Candunc and rewritten by jmeyer2k, although parts were copied from the Mac OS X compile page. Thanks to the editors on the Mac OS X compile page, and thanks to people at Mac Rumors and Ximon to help me find out various errors.

I hope this helps future users become Mac Compilers and push TPT to Mac users!