Compiling for OS X

From The Powder Toy
Revision as of 21:08, 25 July 2012 by Candunc (talk | contribs) (Page complete!)
Jump to: navigation, search

Note: This page is only for OS X (10.7, 10.8) Note: If you are 10.6 or below, go to this page: 10.6


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.


After that is done, time to install Lua.


Download this file: link

Keep uncompressing until it becomes a folder

Now, type cd in terminal and drag your lua folder inside.

Run this: ./configure && make

Then run: sudo make install

Lua has been installed in the system, but TPT will not accept it yet.

Open The Powder Toy's source folder and open "makefile" with TextEdit.

Find the line that says "powder-x", near this you will see a bit of text that says "-lua5.1", remove the 5.1 from this and save the file.


Done! Now, you are able to compile Source code into the applications!


To compile, type in cd and drag the source code into it.

Then type make powder-x


It will go though the process of compiling the source code, and it should say something along the lines of 'strip powder-x'

In your source folder, you will see a powder-x file. How do you run it, you ask?

Well, you will need to download a copy of powder toy, and right click (or control click) and click 'show contents'

Open the Contents folder, followed by the MacOS folder. Inside it is a powder-x file! Simply copy or move the powder-x from the source code folder and place it inside the .app

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

This was written by Candunc, 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!