Building troubles on osx 10.6

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

wilkolak
Posts: 0
Joined: Sun Oct 25, 2009 10:22 pm

Post by wilkolak »

Hi,
I have problems building blender.. I've tried go after tutor in wiki but it doesn't work. I don't know blender from the source compilation side. What steps should I do to compile it properly?

I'm on Snow Leopard, with XCode installed with checked all options.

Code: Select all

Oskar:blender oskar$ gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646)
This is my error output. http://pastebin.com/m403ef487
Jens wrote:Hi

..almost done now.

I finished the patch for compiling all OSX-architectures including
new cocoa-stuff now. We should think about reorganizing the darwin-config.py, maybe setup the -arches more automatic, but due OSX is always multi-arch, this is a tricky task.

Here´s the patch and a user-config setup for 64bit-intel:
http://www.jensverwiebe.de/Blender/Blen ... _stuff.zip

Be aware you have still to set -arch-flags depending on what platform and compiler you build ( default toolchain 64bit on SnowLeo but 32bit on other OSX ).

Don´t forget to checkout the new libs for darwin-9.x.universal in trunk.


Jens

Jens
Posts: 0
Joined: Sat Aug 26, 2006 7:24 pm
Location: Hamburg, Germany

Post by Jens »

dunno what you set up yourself, but log shows you try to compile carbon 64bit, which is not possibe.

Use my patch, btw latest:
http://www.jensverwiebe.de/Blender/Blen ... patch4.zip

patch with: patch -p0 < OSX_cocoa_scons4.txt

and use the user-config as it is for 64bit_cocoa.

The new one has more automatism, up to you is to set :

WITH_GHOST_COCOA=True
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64

other stuff up to you: omp, perhaps 10.6.sdk, whatever

Again: for 64bit , GHOST_COCOA=True is needed.


Jens

wilkolak
Posts: 0
Joined: Sun Oct 25, 2009 10:22 pm

Post by wilkolak »

I hadn't set anything myself. I've just followed wiki. Now I see the patching part and will try it when I will be on my mac tommorow.

Thanks for your quick reply.
And just a random thought - maybe you can update wiki page that low experience users (like me) won't run into trouble... It would be very helpfull.

Sebo
Posts: 0
Joined: Sun Oct 25, 2009 11:50 am

Post by Sebo »

Thnx Jens,

nice one ...
... this solved my issues with building bf-2.5 osx ... 8)

mp3man4
Posts: 0
Joined: Wed Oct 28, 2009 6:41 am

Post by mp3man4 »

Hey,
I'm on a macbook pro 1st Gen- Intel Core Duo. I'm using that user-config.py and getting this error:

Code: Select all

sh: /Users/ryan/bf-blender/B2.5-py3.1_cocoa_64_leo-build/darwin/makesdna: Bad CPU type in executable
scons: *** [/Users/ryan/bf-blender/B2.5-py3.1_cocoa_64_leo-build/darwin/source/blender/makesdna/intern/dna.c] Error 126
scons: building terminated because of errors.
I'm guessing its trying to build 64 bit and my computer is 32. I've tried changing the arch type etc... but thats not helping. I'm using 10.6 Snow Leopard... Any advice?

Thanks

Jens
Posts: 0
Joined: Sat Aug 26, 2006 7:24 pm
Location: Hamburg, Germany

OSX-compiling !!!!

Post by Jens »

Hi

You may have noticed i removed the patches and such.

It is all in trunk now !!!!!

Instructions:

WITH_GHOST_COCOA = True/False
MACOSX_ARCHITECTURE = 'arch' # valid archs: ppc, i386, ppc64, x86_64

..is the only decision to be done for out-of the box-compiling now.
All flags are set automatic by this, even right compiler.


Attention: PPC64 lib´s not ready yet


Jens

mp3man4
Posts: 0
Joined: Wed Oct 28, 2009 6:41 am

Post by mp3man4 »

Sorry if this is a dumb question but does this mean that there is a user-config.py in trunk that I can't find or that we don't need one? and if we don't need one which file do we edit to change those flags?

Jens
Posts: 0
Joined: Sat Aug 26, 2006 7:24 pm
Location: Hamburg, Germany

Post by Jens »

mp3man4 wrote:Sorry if this is a dumb question but does this mean that there is a user-config.py in trunk that I can't find or that we don't need one? and if we don't need one which file do we edit to change those flags?
If you read the darwin-config.py there is mentioned how to handle that.
#
# Note : if you want to alter this file
# copy it as a whole in the upper folder
# as user-config.py
# dont create a new file with only some
# vars changed.
Got it?

Jens

mp3man4
Posts: 0
Joined: Wed Oct 28, 2009 6:41 am

Post by mp3man4 »

In a way:) I understand where the trunk config file comes from and where I should be changing stuff now but it doesn't make it nearly as far along in the compile for me with that config file as it did with yours. Yours made it to a CPU error pretty far in, this one errors out right away with this message:

Code: Select all

scons: done reading SConscript files.
scons: Building targets ...
Compiling ==> 'AUD_Buffer.cpp'
intern/audaspace/intern/AUD_Buffer.cpp:29:19: error: cstring: No such file or directory
intern/audaspace/intern/AUD_Buffer.cpp:30:20: error: stdlib.h: No such file or directory
intern/audaspace/intern/AUD_Buffer.cpp: In constructor ‘AUD_Buffer::AUD_Buffer(int)’:
intern/audaspace/intern/AUD_Buffer.cpp:37: error: ‘malloc’ was not declared in this scope
intern/audaspace/intern/AUD_Buffer.cpp: In destructor ‘AUD_Buffer::~AUD_Buffer()’:
intern/audaspace/intern/AUD_Buffer.cpp:42: error: ‘free’ was not declared in this scope
intern/audaspace/intern/AUD_Buffer.cpp: In member function ‘void AUD_Buffer::resize(int, bool)’:
intern/audaspace/intern/AUD_Buffer.cpp:57: error: ‘malloc’ was not declared in this scope
intern/audaspace/intern/AUD_Buffer.cpp:61: error: ‘memcpy’ was not declared in this scope
intern/audaspace/intern/AUD_Buffer.cpp:63: error: ‘free’ was not declared in this scope
scons: *** [/Users/ryan/bf-blender/build/darwin/intern/audaspace/intern/AUD_Buffer.o] Error 1
scons: building terminated because of errors.

Jens
Posts: 0
Joined: Sat Aug 26, 2006 7:24 pm
Location: Hamburg, Germany

Post by Jens »

Hi

From your errors it looks like you miss something essentially.

The needs:

- checkout blender trunk
- checkout libs, have the in the same dir as blender-source
( so the Blender-folder and Lib-folder are in the same level !!!)
-have xcode installed
- have scons installed

So starting without any user-config, it should give you an build:
i386 with cocoa using 10.5.sdk on you mashine ( default )


Here´s the clou now:
I'm on a macbook pro 1st Gen- Intel Core Duo.
this limits you to 32bit ( i386 ) !

and:
sh: /Users/ryan/bf-blender/B2.5-py3.1_cocoa_64_leo-build/darwin/makesdna: Bad CPU type in executable
this shows you used my older user-config, thats a nono !


Again:
Copy the darwin-config and rename to user-config and put it on top-dir
( blender, where also sconstruct resides )
Do you personal settings in this user-config, it overrides the other.
You should not mix my former one with actual trunk, cause we
moved switches.


Check if you got svn-conflicts if you had attached my patch formerly.
If so, delete the affected files and redo an svn update or do a new checkout.

If you still get errors try without -msse3 flags, iám not 100% sure
CoreDuo firstgen supports it.

Jens

mp3man4
Posts: 0
Joined: Wed Oct 28, 2009 6:41 am

Post by mp3man4 »

Hey thanks for the comments they helped me figure it out. Because of my architecture, it was forcing me to build with 10.4 sdk (I only have 10.5 and 10.6 on my machine). By comparing it with your user-config which let me get past that part, I was able to narrow down and fix the problem. Many thanks:)

wechundavon
Posts: 0
Joined: Sat Oct 31, 2009 5:17 pm
Location: Germany

Post by wechundavon »

Jens wrote: The new one has more automatism, up to you is to set :

WITH_GHOST_COCOA=True
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64

other stuff up to you: omp, perhaps 10.6.sdk, whatever

Again: for 64bit , GHOST_COCOA=True is needed.


Jens
Thanks Jens for this tip - worked great for me. Finally I could render well known ;) images with Blender on OS X at all. Since it needed 3GB++ the 32-Bit Blender crashed.

http://www.flickr.com/photos/30073773@N ... 576543279/

Greetings from southern Germany

Martin

peko
Posts: 0
Joined: Thu Apr 29, 2010 1:21 am

MAC_CUR_VER detection error

Post by peko »

Seems like this lines at *-config.py is wrong:

Code: Select all

32: elif cmd_res[0]=='10':
33:	MAC_CUR_VER='10.6'
if cmd_res = '10.*.*'
cmd_res[0] will be '1' but not '10'

-------

So, configs for SDK 10.5, 10.6 still don't work properly

halley
Posts: 0
Joined: Fri Nov 11, 2005 5:41 pm

Post by halley »

peko is right, but just fixing that line doesn't work either.
Jens wrote:The needs:
- sudo port install ffmpeg
- checkout blender trunk
- checkout libs, have the in the same dir as blender-source
(so the Blender-folder and Lib-folder are in the same level !!!)
- have xcode installed
- have scons installed

So starting without any user-config, it should give you an build:
i386 with cocoa using 10.5.sdk on your machine (default)
Stock 2010 MBP Snow Leopard (10.6), following the above needs, still gives a bad INCLUDE path setup:

Code: Select all

scons: done reading SConscript files.
scons: Building targets ...
Compiling ==> 'AUD_Buffer.cpp'
intern/audaspace/intern/AUD_Buffer.cpp:29:19: error: cstring: No such file or directory
intern/audaspace/intern/AUD_Buffer.cpp:30:19: error: cstdlib: No such file or directory
Just confirming that my /Developer tree does have 10.5 and 10.6 SDK.

An even longer list of errors is given if I copy down user_config.py, choose architecture x64_64, and so on. I am still under the impression you need to correct the ffmpeg paths and library list in your user_config.py.
[ e d @ h a l l e y . c c ]

Post Reply