Building troubles on osx 10.6

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Mats78
Posts: 100
Joined: Thu Oct 17, 2002 5:06 pm
Location: Vantaa, Finland

Building troubles on osx 10.6

Post by Mats78 »

Hi, Blender doesn't want to build on osx 10.6. I'd appreciate all clues about what's going on.

Failing right from the beginning:

Code: Select all

Configuring program blender
scons: done reading SConscript files.
scons: Building targets ...
Compiling ==> 'SND_DummyDevice.cpp'
cc1plus: error: unrecognized command line option "-Wno-long-double"
scons: *** [/Users/mats/svn/trunk/build/darwin/intern/SoundSystem/dummy/SND_DummyDevice.o] Error 1
scons: building terminated because of errors.
Thanks all!
-mats

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv »

Assuming you made a user-config.py file, edit this line:
CC_WARN = ['-Wall', '-Wno-long-double']

to:
CC_WARN = ['-Wall']

Mats78
Posts: 100
Joined: Thu Oct 17, 2002 5:06 pm
Location: Vantaa, Finland

Post by Mats78 »

Thanks for that stiv, it worked fine.. except that it lead me to the next problem.

Code: Select all

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/mats/svn/trunk/build/darwin/intern/audaspace/intern/AUD_Buffer.o] Error 1
scons: building terminated because of errors.
Again, I've tried all sorts of things but can't seem to find what's wrong...

-mats

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv »

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
Those are standard C/C++ headers

The compiler looks in some standard places places for those. Either your include paths are wrong or the compiler is not installed properly.

Seeing the entire command might help. Running scons BF_QUIET=0 is your friend here.

Knowing the compiler version might be interesting, too.
gcc --version

Mats78
Posts: 100
Joined: Thu Oct 17, 2002 5:06 pm
Location: Vantaa, Finland

Post by Mats78 »

With BF_QUIET=0 this comes up:

Code: Select all

scons: done reading SConscript files.
scons: Building targets ...
g++ -o /Users/mats/svn/trunk/build/darwin/intern/audaspace/intern/AUD_Buffer.o -c -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -pipe -fPIC -funsigned-char -fpascal-strings -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -pipe -fPIC -funsigned-char -fpascal-strings -O2 -ftree-vectorize -msse -msse2 -msse3 -Wall -fpascal-strings -DWITH_SDL -I/Users/mats/svn/trunk/build/darwin/intern/audaspace -Iintern/audaspace -I/Users/mats/svn/trunk/build/darwin/intern/audaspace/intern -Iintern/audaspace/intern -I/Users/mats/svn/trunk/build/darwin/intern/audaspace/FX -Iintern/audaspace/FX -I/Users/mats/svn/trunk/build/darwin/intern/audaspace/SRC -Iintern/audaspace/SRC -I/Users/mats/svn/trunk/lib/darwin-8.x.i386/samplerate/include -I/Users/mats/svn/trunk/build/darwin/intern/audaspace/SDL -Iintern/audaspace/SDL -I/Users/mats/svn/trunk/lib/darwin-8.x.i386/sdl/include intern/audaspace/intern/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/mats/svn/trunk/build/darwin/intern/audaspace/intern/AUD_Buffer.o] Error 1
scons: building terminated because of errors.
And here's what gcc --version shows:

Code: Select all

i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)
And thanks again for your help :D

-mats

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

Post by Jens »

mats

If you use 10.4u.SDK it is mandatory to use gcc-4.0 !!
set: CC and CXX to gcc-4.0/g++-4.0

or

use gcc-4.0/g++-4.0 along with 10.5.SDK ( toolchain automatic 32bit )

or

Set SDK to 10.5 and gcc(-4.2) , but then you´ll have to add:

-m32 and -march=i386 to the c,cc ad linkflags, cause the standart-toolchain
for gcc-4.2 ( which is default now, symlinked !!! if you simply set gcc )
is 64bit now, which isn´t supported to build on OSX yet.
With -m32 and -march=i386 you define you are compiling 32bit-arch
on/for 32bit-mashine.

Jens

Mats78
Posts: 100
Joined: Thu Oct 17, 2002 5:06 pm
Location: Vantaa, Finland

Post by Mats78 »

Humm.. under /Developer/SDKs/ I only have MacOSX10.5.sdk and MacOSX10.6.sdk. This is a clean osx 10.6 installation, and I installed the xcode tools that came with it (on the dvd). Why is it trying to use something 10.4?

On osx 10.5 building worked fine, so this seems to be a problem that was caused by 10.6, right? In that case many others should have the same problem.

Cheers,
-mats

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

Post by Jens »

Just do as advised.

You missed simply to install 10.4u-sdk when installing xcode.
It is not default, just additional install for crosscompiling.

Use option 2:

Change config :

else:
MAC_MIN_VERS = '10.5'
MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'

and add the flags, no problem, just a change.
10.6 is now a mainsream 64bit OS !
10.5 a 64bit capable 32bit OS !


Jens

Mats78
Posts: 100
Joined: Thu Oct 17, 2002 5:06 pm
Location: Vantaa, Finland

Post by Mats78 »

Ok.. now I got it to compile, but linking fails. The output is so long, I put it here: http://www.pasteall.org/7919

-mats

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

Post by Jens »

Hey
Take simply my config --> http://www.jensverwiebe.de/temp/user-config.py.zip

Put it in maindir of trunk.

Edit: removed broken trunk note, all fine again, just built B 2.5


Jens

kattkieru
Posts: 17
Joined: Wed Oct 16, 2002 3:30 pm

Post by kattkieru »

I wanted to make a note:

I couldn't get this building with the SVN tree as of the 19th of September-- things failed for me at the OpenEXR libs during the link phase. Other people have had the issue and turned EXR off in their user configs, but I wanted EXRs.

For anyone who wants to get this working, I recommend installing OpenEXR through MacPorts. It installs a metric boatload of unnecessary stuff with it, but if you change the directories in the user_setup.py above it'll work.

ibis
Posts: 0
Joined: Tue Oct 20, 2009 6:32 pm
Location: San Francisco Bay Area

user-config.py repost?

Post by ibis »

Jens,
Would you mind re-posting that user-config? I'm interesting in trying to tinker and maybe put together a fairly robust darwin user-config.py. I'm good with python and know the Mac platform pretty well, but the intricacies of gcc flags is a little beyond me.

Thanks for any help you can give!

Eric
Jens wrote:Hey
Take simply my config --> http://www.jensverwiebe.de/temp/user-config.py.zip

Put it in maindir of trunk.

Edit: removed broken trunk note, all fine again, just built B 2.5


Jens

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

Re: user-config.py repost?

Post by Jens »

Wait a few days, i haven´t finished the new adaptions for scons yet.

I´ve put together now:

-64bit capable ( universal), libs ( in trunk )
-patch for building with cocoa
-user-config prepared for 10.5sdk

TODO:

-setup a choice for OSX_ARCHITECTURE in scons for unzipping
the right arch only ( saving diskspace not having all python-modules
multiarch in app-package )

If you wanna help us with that, visit us at IRC #blendercoders

Jens





ibis wrote:Jens,
Would you mind re-posting that user-config? I'm interesting in trying to tinker and maybe put together a fairly robust darwin user-config.py. I'm good with python and know the Mac platform pretty well, but the intricacies of gcc flags is a little beyond me.

Thanks for any help you can give!

Eric
Jens wrote:Hey
Take simply my config --> http://www.jensverwiebe.de/temp/user-config.py.zip

Put it in maindir of trunk.

Edit: removed broken trunk note, all fine again, just built B 2.5


Jens

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

Post by Jens »

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

lancelet
Posts: 0
Joined: Fri Jul 02, 2004 3:34 pm

Thanks for the patch!

Post by lancelet »

Hi Jens,

Thanks for your recent patch. It Works For Me (TM) - OS X 10.6; default XCode install, etc. I was having a few problems prior to this, so thanks heaps for working on it! :D

Jonathan Merritt.

Post Reply