Difference between revisions of "Compiling for OS X"

From The Powder Toy
Jump to: navigation, search
(Added --nofft support.)
(a few changes, now works for tpt++ (note: guide untested))
Line 1: Line 1:
Note: This page is only for OS X (10.7, 10.8)
+
Note: This page is only for OS X (10.7, 10.8) It may not work on 10.6 and below
Note: If you are 10.6 or below, go to this page: [http://powdertoy.co.uk/Wiki/index.html?title=Compiling_for_Mac_OS_X 10.6]
+
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 [http://webchat.freenode.net/?channels=#powder irc].
 
 
  
 
Download Xcode from the App Store [http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 link]
 
Download Xcode from the App Store [http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 link]
Line 24: Line 23:
 
It will ask you for your password. Type it in and press enter.
 
It will ask you for your password. Type it in and press enter.
  
Download [http://prdownloads.sourceforge.net/scons/scons-2.3.0.zip this] and unzip it. Go into terminal. Type in <code bash>cd </code> with a space after it and drag in the folder that you downloaded. Next type <code bash>sudo python setup.py install</code>. 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.
+
Now, download [http://prdownloads.sourceforge.net/scons/scons-2.3.0.zip scons] and unzip it. Go into the terminal, and type in <code bash>cd </code> with a space after it and drag in the folder that you downloaded. Next type <code bash>sudo python setup.py install</code>. 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 <code bash>cd </code> with a space after it. Drag in the folder with the source code.
 
Go into the folder with the source code that you downloaded. Open up terminal again and type <code bash>cd </code> with a space after it. Drag in the folder with the source code.
  
Next type this into Terminal: <code bash>scons --macosx --nofft</code>. The terminal will spit out a bunch of crap.
+
Next type this into Terminal: <code bash>scons --macosx --release --stable --sse2 --nofft</code>. It will start compiling.
  
If you go into the build folder that this command has created in the source code, you will find a file that says powder-legacy-x. Double click it and run it.
+
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.  
 
Congrats, you have compiled spare code and have made a OS X application.  

Revision as of 16:15, 11 April 2013

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!