View topic - How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit

How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit

Users-contributed CVS development builds. Post here your questions about compiling the source code.

How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit

Post Mon Feb 14, 2011 12:04 am

How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit for use with Blender 2.56
by Jasper Mine on Jan 30, 2011

PART I

Hello, I couldn't find a tutorial to do this when I was looking to test the newest versions of Blender and Yafaray, so hopefully this can help in your testing.

First thing is to prepare your mac for compiling source code. We need the Apple Developers Tools to do this. If your not already registered as an Apple Developer you must do so now by going here:

http://developer.apple.com/programs/register/

Once complete, sign in and go here:

http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/5.1.17.2.1.3.3.1.0.1.1.0.3.3.3.3.1

Look for the Xcode 3.1.4 Developer Tools. You can also access this area via the Resources>Mac OSX >Developer Downloads. For users of Snow Leopard, Mac OS X 10.6 links to the latest Xcode can be found on here:

http://developer.apple.com/

Follow the installer instructions.

OK, now that that's complete we will want to download and install a neat program that manages a whole collection of opensource software, called MacPorts. You can download it here:

http://www.macports.org/

Follow the installer instructions. After the installer runs we need to make a little edit. Open the Terminal and type:

Code: Select all
$ ls -a

You should see a file called .profile. In Terminal type:

Code: Select all
$ open .profile

A text editor should open and you should edit the PATH entry to include extra paths like this:

Code: Select all
export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/lib:/opt/local/include:$PATH

Save the file and make sure you don't add .txt or anything to it.

I recommend a GUI for MacPorts. I use Porticus but there are others:

http://porticus.alittledrop.com/index.html

Next we should update MacPorts to the current version by typing in the Terminal or from a GUI like Porticus:

Code: Select all
$ sudo port selfupdate

Once complete we can get the prerequisite software needed to build Yafaray and Blender. Please install the following using the Terminal command or by using the GUI:

Code: Select all
$ sudo port install

    git
    subversion
    cmake
    zlib
    libxml2
    freetype
    jpeg
    libpng
    tiff
    swig
    openexr
    ilmbase
    fftw-3
After the packages have compiled and installed we use one of them to fetch the source code from the Yafaray project server. On my machine I created a directory in the Documents folder called Development where I do my code hacking. You of course could put the code anywhere. So for me from the Terminal I type:

Code: Select all
$ cd /Users/myusername/Documents/Development

Then I create a new directory for Yafaray stuff by typing:

Code: Select all
$ mkdir Yafaray

Change directory to the newly created folder:

Code: Select all
$ cd Yafaray

And download the sources:

Code: Select all
$ git clone git://github.com/YafaRay/Core

Lets get Yafaray exporter now. Type in Terminal:

Code: Select all
$ git clone git://github.com/YafaRay/Blender-2.5-Exporter

And while we are at it, lets get the Blender sources, from Terminal:

Code: Select all
$ cd /Users/myusername/Documents/Development

Create a new directory for Blender stuff and change into this directory by typing:

Code: Select all
$ mkdir Blender
$ cd Blender

Download the sources:

Code: Select all
$ svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/blender

And also the support libraries:

Code: Select all
$ mkdir lib
$ cd lib
$ svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/darwin-9.x.universal


Please continue on to Part II to find out how to run the cmake commands.
Last edited by jsplifer on Mon Feb 14, 2011 5:06 pm, edited 1 time in total.
jsplifer
 
Posts: 3
Joined: Sun Feb 13, 2011 10:54 pm

Re: How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit Part1

Post Mon Feb 14, 2011 2:07 pm

Very helpful, but surely it would be better to upload these as consecutive posts in the same thread ?
User avatar
stoneage
 
Posts: 1241
Joined: Sun Dec 23, 2007 1:06 pm

Re: How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit Part1

Post Mon Feb 14, 2011 3:13 pm

In fact I think it would be better to put all the content in a tutorial
User avatar
Samo
 
Posts: 3110
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit Part2

Post Mon Feb 14, 2011 4:57 pm

How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit for use with Blender 2.56
by Jasper Mine on Jan 30, 2011

PART II

We now have everything we need to compile the code. Lets start with Blender because a part of it is needed when compiling Yafaray. Lets open /Applications/Utilities/System Profiler from the Finder, click on Software from the outline and then look what Kernel Version is used. Most likely it will be Kernel Version: Darwin 9.8.0. We should still be in the /Blender/lib directory in the Terminal, if not get back to it. A symlink is needed here to fake the compiler into thinking the downloaded /lib/darwin-9.x.universal stuff is actually for the current Darwin version. So we do that now with the command:

Code: Select all
$ ln -s darwin-9.x.universal/ darwin-9.8.0-i386

Make sure you use the correct Darwin version as told by the System Profiler.

Before we let the compiler loose one more thing is needed. Let's generate some make files:

Code: Select all
$ cd /Users/myusername/Documents/Development/Blender

Create a folder to muck around in, such as:

Code: Select all
$ mkdir build

Change into this directory:

Code: Select all
$ cd build

And run cmake with:

Code: Select all
$ cmake ../blender

You will see cmake do its thing and hopefully exit gracefully. The defaults need a bit of tweaking so adjust the following by running:

Code: Select all
$ ccmake ../blender

    CMAKE_BUILD_TYPE = release
    CMAKE_INSTALL_PREFIX = /usr/local
    CMAKE_OSX_ARCHITECTURES = i386 CMAKE_OSX_DEPLOYMENT_TARGET = 10.5 CMAKE_OSX_SYSROOT = /Developer/SDKs/MacOSX10.5.sdk
    USE_QTKIT = OFF
    WITH_BUILDINFO = ON
    WITH_BULLET = ON
    WITH_COCOA = ON
    WITH_CODEC_FFMPEG = ON
    WITH_CODEC_QUICKTIME = ON
    WITH_CODEC_SNDFILE = ON
    WITH_FFMPEG = ON
    WITH_FFTW3 = ON
    WITH_FLUID = ON
    WITH_GAMEENGINE = ON
    WITH_IK_ITASC = ON
    WITH_IMAGE_CINEON = ON
    WITH_IMAGE_DDS = ON
    WITH_IMAGE_HDR = ON
    WITH_IMAGE_OPENEXR = ON
    WITH_IMAGE_OPENJPEG = ON
    WITH_IMAGE_REDCODE = OFF
    WITH_IMAGE_TIFF = ON
    WITH_INSTALL = ON
    WITH_INTERNATIONAL = ON
    WITH_JACK = OFF
    WITH_LIBS10.5 = ON
    WITH_LZMA = ON
    WITH_LZO = ON
    WITH_MOD_BOOLEAN = ON
    WITH_MOD_DECIMATE = ON
    WITH_MOD_FLUID = ON
    WITH_OPENAL = ON
    WITH_OPENCOLLADA = ON
    WITH_OPENMP = OFF
    WITH_PLAYER = OFF
    WITH_PYTHON = ON
    WITH_PYTHON_INSTALL = OFF
    WITH_QUICKTIME = ON
    WITH_RAYOPTIMIZATION = ON
    WITH_SAMPLERATE = ON
    WITH_SDL = ON
    WITH_SNDFILE = ON
Quite a few options but it gets you some extras like rendering to ffmpeg. When your happy with the options hit "c" key to configure and then "g" to generate and exit.

Type in the Terminal and Blender will build with the command:

Code: Select all
$ make

You can open the Finder and navigate to /Users/myusername/Documents/Development/Blender/build/bin if you have been using my naming advice. Here you will find Blender to drag and drop or copy and paste wherever you want.

After this is done, doing an update is much easier. From a fresh Terminal type:

Code: Select all
$ cd Documents/Development/Blender
$ svn up blender
$ svn up lib/darwin-9.x.universal
$ cd build
$ make

Yafaray can be updated with:

Code: Select all
$ cd Documents/Development/Yafaray/Core
$ git pull
$ cd Documents/Development/Yafaray/Blender-2.5-Exporter
$ git pull

Moving on to Yafaray. From a fresh Terminal navigate to the sources with:

Code: Select all
$ cd Documents/Development/Yafaray/Core/CMakeConfig
$ cp UserConfig.template UserConfig.txt
$ open UserConfig.txt

The file should open in a text editor and we make a few edits on the following items, note the default on left is changed to the new parameter on right:

    set(WITH_QT ON) = set(WITH_QT OFF)
    set(BUILDRELEASE OFF) = set(BUILDRELEASE ON)
    #set(YAF_BINDINGS_PY_DIR ${CMAKE_SOURCE_DIR}/install/bindings/python) = set(YAF_BINDINGS_PY_DIR "/Users/myusername/Documents/Development/Yafaray/Build/bindings/python")
    #set(YAF_PY_VERSION 3.1) = set(YAF_PY_VERSION 3.1)
One other file to open and edit with a text editor, from fresh Terminal:

Code: Select all
$ cd /Users/myusername/Documents/Development/Yafaray/Core/CMakeModules
$ open FindYafPythonLibs.cmake

And use the hash mark to comment out these lines, should look like the following when your done:

    #UNSET(PYTHON_DEBUG_LIBRARY CACHE)
    #UNSET(PYTHON_LIBRARY CACHE)
    #UNSET(PYTHON_INCLUDE_DIR CACHE)
Save your changes and from a fresh Terminal type:

Code: Select all
$ cd Documents/Development/Yafaray
$ mkdir Build
$ cd Build
$ cmake ../Core
$ ccmake ../Core

You need to hit the "t" key to toggle advanced mode. Then find and edit these two entries:

    CMAKE_MODULE_LINKER_FLAGS_RELE -undefined dynamic_lookup
    PYTHON_INCLUDE_DIR /Users/myusername/Documents/Development/Blender/lib/darwin-9.x.universal/python/include/python3.1/
    PYTHON_LIBRARY /Users/myusername/Documents/Development/Blender/dev/lib/libbf_python.a
    WITH_QT = OFF
Now go ahead and push "c" to configure, "e" to exit, and "g" to generate and exit. We should be ready to let it rip by typing:

Code: Select all
$ make
$ sudo make install


This concludes Part II. Please continue on to Part III for Installation process.
jsplifer
 
Posts: 3
Joined: Sun Feb 13, 2011 10:54 pm

Re: How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit Part3

Post Mon Feb 14, 2011 5:05 pm

How to Compile Yafaray 0.1.2 on Mac OS X 10.5.8 32 bit for use with Blender 2.56
by Jasper Mine on Jan 30, 2011

PART III

Alright almost done :) Make a folder somewhere on your hard drive for Blender scripts. I recommend creating ~/Library/Application Support/Blender/Scripts. Open Blender and access the User Preferences. From the File tab and in the Scripts field navigate to the newly created directory, or wherever you might store scripts. Remember to save as Default and close Blender.

Last part. A bit of copying things to the new scripts folder. So from Terminal:

Code: Select all
$ cp -r /Users/myusername/Documents/Development/Yafaray/Blender-2.5-Exporter /Users/myusername/Library/Application\ Support/Blender/Scripts/yafaray

Make a directory:

Code: Select all
$ mkdir /Users/myusername/Library/Application\ Support/Blender/Scripts/yafaray/bin

Copy over files:

Code: Select all
$ cp -r /usr/local/lib/libyafaraycore.dylib /usr/local/lib/yafaray /usr/local/lib/libyafarayplugin.dylib /Users/myusername/Library/Application\ Support/Blender/Scripts/yafaray/bin

Copy some things:

Code: Select all
$ cp /Users/myusername/Documents/Development/Yafaray/Build/bindings/python/_yafrayinterface.so /Users/myusername/Documents/Development/Yafaray/Build/bindings/python/yafrayinterface.py /Users/myusername/Library/Application\ Support/Blender/Scripts/yafaray/bin

Move some files:

Code: Select all
$ mv /Users/myusername/Library/Application\ Support/Blender/Scripts/yafaray/bin/yafaray /Users/myusername/Library/Application\ Support/Blender/Scripts/yafaray/bin/plugins

Of course you're going to want to use the paths that pertain to your User name and where your put things. We should be done now. Open Blender and select Yafaray from the render drop down menu in the upper right. Hope that helps.
jsplifer
 
Posts: 3
Joined: Sun Feb 13, 2011 10:54 pm


Return to Testing Builds



Who is online

Users browsing this forum: No registered users and 2 guests

cron