OSX-renewing buildprocess -out-of-the-box-compile -

Discussion and help for Compilation problems and platform portability.

Moderators: Dade, coordinators

OSX-renewing buildprocess -out-of-the-box-compile -

Postby jensverwiebe » Fri Sep 24, 2010 7:26 am

These instructions are in wiki now: http://www.luxrender.net/wiki/Building_on_OSX


Hi all

Until weekend i plan to renew the compiling of LuxRender for OSX:

- adapt cmakelist.txt to use the "macos" dependencies from repo for lux (macos ) -- done
- adapt cmakelist.txt to use the "macos" dependencies from repo for luxrays (macos ) -- done
- renew "macos" repo to all needed and up-to-date libs. --done
- luxrays put to repo, so you can skip this point if you don´t need bleeding edge
- adapted for use with cmake 2.6 up to 2.8.3
- out source builddir possible
- static/framework switch added for configuring aimed use of pylux

The new OSX buildprocess ( 0.8branch atm ):

- get source of Luxrender, LuxRays and macos in the same directory ( you can use the mirror too )

Get QT 4.6.3 or higher and install it. (http://get.qt.nokia.com/qt/source/qt-ma ... -4.7.0.dmg)

Compile LuxRays (OSX 10.6)
Get cl.hpp from KHRONOS and place it in: /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers
In cmake ( 2.6+ recommended ), choose :
1. configure -> xcode-crosscompile
2. set in crosscompile: Name = darwin, version = 10.6, Processor = i386, x86_64, c = gcc, c++ = g++, root = /Developer/SDKs/MacOSX10.6.sdk
... Modes = set all to "find from root then native system".
press configure once more , then boost is found in boostroot
3. generate
4. open XCode.project
5. set wished arcitectures to build ( default = 2 arch universal Intel )
6. build

Compile LuxRender(OSX 10.6)
Get QT 4.6.3 or higher and install it.(if not done yet )
In cmake ( 2.6+ recommended ), choose :
1. configure -> xcode-crosscompile
2. set in crosscompile: Name = darwin, version = 10.6, Processor = i386, x86_64, c = gcc, c++ = g++, root = /Developer/SDKs/MacOSX10.6.sdk
... Modes = set all to "find from root then native system".
press configure once more , then boost is found in boostroot
3. generate
4. open XCode.project
5. set wished arcitectures to build ( default = 2 arch universal Intel )
6. build


If you wanna deploy LuxRender complete "static", use macdeployqt for bundling used Qt-frameworks into the app-bundle.

That for now, pls try and report.

EDIT: added same principally to 0.7-branch, but defaults to OSX10.5, thus 10.5.sdk




Jens
Last edited by jensverwiebe on Wed Feb 16, 2011 7:02 pm, edited 3 times in total.
User avatar
jensverwiebe
Developer
 
Posts: 3407
Joined: Wed Apr 02, 2008 4:34 pm

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby Eros » Fri Sep 24, 2010 2:06 pm

I have problems... mainly finding boost headers (but as i just get a billion errors regarding that im not sure what else could be wrong either)

SO
I got all the newest versions of the 3 files... uncompressed them into ~Desktop/LuxRender/
In this directory i have
>lux
>luxrays
>macos

I fire up CMAKE (the GUI) version 2.6 patch 4
I set the source to where luxrays is (in this case ~/Desktop/LuxRender/luxrays ((I used absolute paths as selected using the GUI)))
Clicking on Configure I recieve the popup asking me what i want to do, I select Xcode, and Specify options for cross compiling.

I hit Configure again and what was red go white, everything seems to find ok.... so for boost i have
Boost_INCLUDE_DIR /Users/ward/Desktop/LuxRender/macos/include

All looks good.

Clicking generate then opening the xcode project (XCode 3.2.3), it seems that regardless of what i try to do, if i try to then build it, i get boost/thread.hpp not found errors... in total i get something like 900 errors appearing to be from not finding includes.

*scratches head* strange.

If i try the usual cmake . method in the luxrays directory, once again everything seems to find perfectly fine.
trying to then make i get
/Users/ward/Desktop/LuxRender/luxrays/include/luxrays/core/utils.h:31:28: error: boost/thread.hpp: No such file or directory

This is also the same place i get the XCode Project error... I have the feeling i have missed something
User avatar
Eros
 
Posts: 418
Joined: Wed Jul 22, 2009 8:37 am

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby jensverwiebe » Fri Sep 24, 2010 2:16 pm

Lemme check if the commit failed perhaps, if i think of how bad checkout sometimes works :twisted:

I tried the building several times succesful, but indeed had the local ones i send later to repo, not the ckeckedout ones, in fact they should be exactly the same.

Edit: all fine so far, perhaps you missed a step ?

Jens
User avatar
jensverwiebe
Developer
 
Posts: 3407
Joined: Wed Apr 02, 2008 4:34 pm

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby Eros » Fri Sep 24, 2010 3:16 pm

OK so I think I have it

The header directory didnt propagate to the project file... meaning that i wasnt using any include paths or library paths at all (which kind of was my first guess)

So in the edit configuration I removed all the configurations except 'Release'
Then checked 'Always include user headers' and set the user headers path to the include in the macos folder... same for the librarys

Currently Compiling is now going forward seemingly without problems, only warnings. I get a report of build successful.

Huzzar! Luxrays works... Now for LuxRender :D
User avatar
Eros
 
Posts: 418
Joined: Wed Jul 22, 2009 8:37 am

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby Eros » Fri Sep 24, 2010 3:40 pm

OK so with LuxRender i have many many many errors regarding

This is in util.h

#if defined(__APPLE__)
#if (__GNUC__ == 3) || (__GNUC__ == 4)
extern "C" {
int isinf(float); <<<<<<<<<<<<<--------- Declaration of C Function 'int isinf(float)' which gives me 126 errors and such fails....
int isnan(double);
int isnanf(float);
}

I commented the line just to see if it compiles


[EDIT] It now compiles fine and appears to work in GPU mode (slowly i must admit as if i use more than 1 Thread on the GUI - the memory usage causes the whole system to lock up.
User avatar
Eros
 
Posts: 418
Joined: Wed Jul 22, 2009 8:37 am

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby jensverwiebe » Sat Sep 25, 2010 2:12 am

Eros, try again pls

- fixed in utils.h conflicting ininf() to double ( same as in lux.h )
- added additionall INCLUDE_DIRECTORIES ../macos include for OSX build

ATM i just wonder why i did not got this issues before :roll:
Anyway, the code neds cleanup later when coding nears completion for 0.8, so don´t worry..

BTW:
Hybridmode generates atm the threads very slow, so be patient. I saw on my
mashine the highest thread ( 12 ) was created after 58 seconds !
But hey, we are at the beginning of GPGPU-implementation .

Jens
User avatar
jensverwiebe
Developer
 
Posts: 3407
Joined: Wed Apr 02, 2008 4:34 pm

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby Eros » Sat Sep 25, 2010 12:37 pm

It also had me stumped but for what ever reason my cmake or xcode was acting a little strange.

luxrays now compiles straight out of the box with those changes. :D

:) the start of the lux-GPU work is really great, excited to test some of it out when i have more RAM, but its also good to see it working on my laptop also :D
User avatar
Eros
 
Posts: 418
Joined: Wed Jul 22, 2009 8:37 am

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby Daniel90 » Sun Sep 26, 2010 7:27 am

jensverwiebe wrote:- fixed in utils.h conflicting ininf() to double ( same as in lux.h )

ATM i just wonder why i did not got this issues before :roll:


I also got this issue when I wanted to compile and changed float to double it by hand. I just forgot to tell you ;)
Daniel90
 
Posts: 62
Joined: Sun Aug 23, 2009 8:42 am
Location: Germany

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby jeanphi » Mon Sep 27, 2010 1:31 am

Hi,

Regarding the isinf et al. issues, could you try to replace all the black wizardry with the following snippet:
Code: Select all
#include <cmath>
using std::isinf;

Add other required functions too. This will give seamless access to the overloaded functions of the C++ standard library. It works like a charm on CYGWIN but I didn't pushed the modification to avoid breaking MacOS builds.

Jeanphi
jeanphi
Developer
 
Posts: 7943
Joined: Mon Jan 14, 2008 7:21 am

Re: OSX-renewing buildprocess -out-of-the-box-compile -

Postby jensverwiebe » Mon Sep 27, 2010 1:44 am

Jeanphi

You can safely commit this for OSX too.
The problem was , these definitions in lux.h where redifined in utils.h of luxrays with other values, so as long as we are in sync here, thats o.k.
The wizard was for gcc3 mostly, thats not longer of interest nowadays.

Jens
User avatar
jensverwiebe
Developer
 
Posts: 3407
Joined: Wed Apr 02, 2008 4:34 pm

Next

Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 2 guests