Building on OSX - LuxRender Wiki

Building on OSX

Personal tools

From LuxRender Wiki

Jump to: navigation, search

This page describes the process of compiling LuxRender on OSX. If you just want to use the program, you can download the program using the links on the download page instead.

On this page, the installation process generating a 32bit application using Cmake and Xcode is explained. The procedure should work on both OS X 10.4 an 10.5.

Contents

download and install required software

We will be making use of a number of tools that need to be installed first:

Apple developer tools

Apple's developer tools (including Xcode) can be downloaded from http://developer.apple.com/technology/tools.html. Registration may be necessary.

Cmake

Cmake is an open source build system that can be downloaded http://www.cmake.org.

wxWidgets

WxWidgets is a toolkit that is being used for LuxRender's graphical user interface. The source code can be downloaded at http://www.wxwidgets.org. The program may already be installed on your computer, but getting a recent version is advisable.

After downloading the source code (for example wxAll 2.8.9), follow the instructions in the file BuildCVS.txt (“MacOS X using configure and the Developer Tools”) except for the line

type: ../configure –with-mac
for our purposes we will instead use
../configure --with-opengl –disable-shared

download LuxRender sourcecode

Downloading the source code can be done using the following commands in the terminal:

mkdir luxrender
cd luxrender
cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/ecume co lux testsuite exporters macos

This will create a folder called “luxrender” and put all the source code there.

set up libraries

LuxRender makes use of a number of libraries. Some of them are included with the LuxRender source code in a folder called “macos”. It is recommended to copy these libraries to the appropriate place, as follows:

From the folders jpeg, openexr-1.4.0, png and tiff, copy the contents of the “include” folder to /usr/local/include and the contents of the “lib” folder to /usr/local/lib.

Copy the contents of macos/boost/include/boost to usr/local/include.

Copy the contents of macos/boost/lib/x86/ to usr/local/lib.

set up CMake

Using CMake, we will check that all paths to required libraries are set correctly and generate an xcode project.

CMake settings
CMake settings


First, fill in the fields “Where is the source code” and “Where to build the binaries”. With this information, the program to locate a text file called “CMakeLists.txt” that contains information about the required dependencies.

After that, press the “Configure” button that is located at the bottom left of the window. This will bring up a new window; fill in the values as indicated on the following screenshot.

more CMake settings
more CMake settings


Afterwards, press OK or enter. Cmake will now start looking for compilers, dependencies and libraries. After this, change the drop down menu indicating “Simple View” to “Advanced View”.

Now, we should make sure that all links point to the right location – wherever possible, we want to use the libraries that came with the LuxRender source code instead of any other libraries. Also, check that wxWidgets is found at usr/local/bin, not at usr/bin. The right settings can be found at the following screenshots:

CMake path settings
CMake path settings


CMake path settings, continued
CMake path settings, continued


After checking the paths, press “Configure” again and finally press “Generate”. This should create an xcode project file in the location that was specified under “Where to build the binaries”.

open the project and compile in Xcode

Now open Xcode and go to “Open” in the file menu. Open the file called luxrender.xcodeproj or lux.xcodeproj. In the window that will now appear, there is a “Build” button that will start the compilation process. If you're lucky, pressing this will result in the creation of a functioning version of LuxRender. If this doesn't work right away, there are a few settings that may improve the chances of success.

First of all, go to the Project menu and select Edit Project Settings. In the General tab, change “Base SDK for All Configurations” from “Current Mac OS” to “Mac OS X 10.5”. In the Build tab, change the Architectures entry to “Native Architecture of Build Machine”. You can now close the Edit Project Settings window.

If you are using wxWidgets 2.8.9, chances are that there is a conflict between various libraries. To resolve this, double click “luxrender” under Targets in the item list on the left part of the window. This will bring up a new window called “Target “luxrender” Info”. In the Build tab, double click the “Other Linker Flags” entry. From the list that shows up, remove libwxjpeg-2.8.a, libwxpng-2.8.a and libwxtiff-2.8.a.

Now press the build button. If all goes right, the application will be created in a folder called “Debug” within the output folder specified in Cmake. If you run into any errors, please report them on the forum or see if anyone knowledgeable is present on the irc channel.