[Tutorial] Build on Mac OS X with Xcode

Discussion and help for Compilation problems and platform portability.

Moderators: Dade, coordinators

[Tutorial] Build on Mac OS X with Xcode

Postby alenofx » Tue Oct 23, 2007 6:15 am

I've prepared an Xcode project to build LuxRender easily and STATICALLY link with all the necessary libraries.
To build it, just follow these steps:

  • install Xcode and X11 SDK (you can find last version from: http://developer.apple.com/tools/download/ );
  • download the LuxRender sources from CVS;
  • download the necessary libraries sources (boost, fltk, libpng, ilmbase & openexr);
  • delete the "boost" directory from the "lux" sources root;
  • extract the libraries sources in the "lux" directory, keeping the library root directory but deleting version numbers (ex: boost_1_34_1 -> boost, fltk-1.1.x-r5953 -> fltk, etc...);
  • put the "LuxRender.xcodeproj" in the "lux" directory, open it, select the right Release build (i368 or ppc) and "Build and Go" (select the "luxconsole" target to build the console version).

Note:
  • executable targets runs from terminal, but can be included in a simple ".app" package to run it with double click; anyway, LuxRender needs a good icon ;).
  • this build method is made to create a non-fat executable, keeping only the target build architecture (luxrender executable is about 3.3MB).
  • tested with boost 1.34.1, fltk 1.1.x-r5953, libpng 1.2.22, ilmbase 1.0.1 and openexr 1.6.1.

Libraries:

PS: sorry for my bad english.
Attachments
LuxRender.xcodeproj.zip
LuxRender Xcode project
(28.46 KiB) Downloaded 179 times
Last edited by alenofx on Mon Nov 05, 2007 2:17 pm, edited 4 times in total.
alenofx
 
Posts: 14
Joined: Tue Oct 16, 2007 3:05 pm
Location: Italy

Re: [Tutorial] Build on Mac OS X with Xcode

Postby Neo1975 » Tue Oct 23, 2007 6:22 am

I have commited now a fix in CMakeList.txt so if one want to build a Universal Binary using XCode have only to lunch:
Code: Select all
cmake -G Xcode .


in lux directory.

For have a static linkage remember to build OpenEXR library only in static mode.
You can perform this using this command:

Code: Select all
./configure --disable-dependency-tracking --enable-osx-universal-binaries --disable-shared


followed by
Code: Select all
make
su
make install
Neo1975
 
Posts: 54
Joined: Tue Oct 16, 2007 4:07 am
Location: Italy

Re: [Tutorial] Build on Mac OS X with Xcode

Postby alenofx » Tue Oct 23, 2007 6:46 am

Hi Neo,

thank you for your reply, but this project is made to build LuxRender directly with Xcode in one click, without using "cmake" (that's not bundled in Tiger) and without installing ANY needed libraries (that are directly built and linked by this project). ;)
alenofx
 
Posts: 14
Joined: Tue Oct 16, 2007 3:05 pm
Location: Italy

Re: [Tutorial] Build on Mac OS X with Xcode

Postby jromang » Tue Oct 23, 2007 9:19 am

Thanks guys ;)
Two differents approaches, two success ! Maybe we could keep the 'best' of both ?

CMake approach as an advantage regarding maintenance : when we change something into the source (new files, new targets,...) we update this script. If I put the xcode project into the CVS, we will also need to update this project as we change files. With CMake 'generation', no need to change the xcode project every time.
But...: XCode approach as the advantage of bieng simple, intuitive, an user-friendly. No libraries/dependencies is also a big plus !

So, my question is : would it be possible to keep a CMake-generated xcode project, while keeping all osx static libs in the source tree (in a 'osx' subdir) ? I would like make users could build Lux in 3 easy steps :
-Download CVS
-CMake -g to generate the XCode project
-Launch XCode/build

Apart that, the 'boost' directory' has nothing to do in the root of the project (it's used for the win32 project) ; I will fix that :-)
User avatar
jromang
Developer
 
Posts: 557
Joined: Wed Sep 19, 2007 2:41 am

Re: [Tutorial] Build on Mac OS X with Xcode

Postby Neo1975 » Tue Oct 23, 2007 10:35 am

Yes, today I commited a little modify in CMaleList.txt, so with
Code: Select all
cmake -G Xcode .


command this rewrite the x code project whit static linkage.
Attention, if you modify the project is better to modify CMakeList.txt to rebuildit correctly.
Today I sent a Extensive Tutorial to Radiance about how to build on MAC OS X a universal binary linked statically to libray, instaction to build library too.
I hope this will go online soon.... (tomorrow pheraps)...
Today I use both XCode project (generated by cmake) both standard makefile... and there are not great difference.
Neo1975
 
Posts: 54
Joined: Tue Oct 16, 2007 4:07 am
Location: Italy

Re: [Tutorial] Build on Mac OS X with Xcode

Postby pHakeEyes » Tue Oct 23, 2007 7:32 pm

nice little tutorial, alenofx - got lux running finally on my mac. much appreciated.
I have no experience whatsoever compiling from source, so big thanks!
pHakeEyes
 
Posts: 6
Joined: Thu Oct 18, 2007 9:30 am

Re: [Tutorial] Build on Mac OS X with Xcode

Postby alenofx » Wed Oct 24, 2007 2:16 pm

pHakeEyes wrote:nice little tutorial, alenofx - got lux running finally on my mac. much appreciated.
I have no experience whatsoever compiling from source, so big thanks!


Great! That's the point: make it simple. ;)
alenofx
 
Posts: 14
Joined: Tue Oct 16, 2007 3:05 pm
Location: Italy

Re: [Tutorial] Build on Mac OS X with Xcode

Postby MasterDomino » Wed Oct 24, 2007 2:30 pm

Hello everybody!

I am an absolute n00b in "building" things, but when I asked in the BlenderArtist-Forum this afternoon if anybody had a PPC built of LuxRender, people just told me I should make one myself, it would be easy and probably even achievable by me... And so: here I am, so nobody can tell me that I didn't try at least.

I guess, my questions will be really stupid, but it would be great if you would be patient with me anyway and help me (or at least tell me right away if I am a hopeless case and should rather give up).


Following the steps above I already have problems with the first one:

I installed the X11 SDK, but what exactly is meant by "Xcode". On my Tiger-DVD I can only find a package called XcodeTools.mpkg . Is that the thing I need to install? Because if I do that it needs 1.4 GB (!) disk space. Or is there another thing, I need to install?

Second question:
How on earth do I download the sources from CVS (sorry, I am really a n00b). I it correct, that I need to go on http://cvs.savannah.nongnu.org/viewvc/?root=ecume? And then what do I have to do? Download the lux/ directory?


Thanks in advance for your help!

MasterDomino
MasterDomino
 
Posts: 38
Joined: Wed Oct 24, 2007 1:44 pm

Re: [Tutorial] Build on Mac OS X with Xcode

Postby alenofx » Wed Oct 24, 2007 2:39 pm

Yes, XcodeTools.mpkg is the right package (with the X11 SDK, just install with default settings to install both).
You can also download Xcode Tools from http://developer.apple.com/tools/download/ .

To download the CVS sources just use the cvs command with terminal: http://www.luxrender2.org/index.php?opt ... &Itemid=68 (replace (_arobase_) with @).
alenofx
 
Posts: 14
Joined: Tue Oct 16, 2007 3:05 pm
Location: Italy

Re: [Tutorial] Build on Mac OS X with Xcode

Postby MasterDomino » Wed Oct 24, 2007 3:54 pm

Thank you alenofx!

I have now successfully downloaded the source code and already extracted and renamed the libraries.
Now I am stuck again. I copied the "LuxRender.xcodeproj"-folder with the "project.pbxproj" file in it in the "lux" folder. Is that correct or should I just copy the file without the folder?

Because when I double click now, nothing is happening. XCode is opening, but I cannot see anything. What do I need to do? The console tells me:

"2007-10-24 20:59:20.514 Xcode[2216] Failed to load file "/Users/bla/lux/LuxRender.xcodeproj"

Also: What does

change ALL targets "architectures" option to ppc to build for PowerPC


exactly mean? At which point do I have to do that and how?


Thanks again for your patience and your help!

MasterDomino
Last edited by MasterDomino on Wed Oct 24, 2007 5:08 pm, edited 1 time in total.
MasterDomino
 
Posts: 38
Joined: Wed Oct 24, 2007 1:44 pm

Next

Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 1 guest