help with issues compiling blender for osx with scons

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
aloyr
Posts: 0
Joined: Mon Mar 14, 2011 3:06 pm
Location: US

help with issues compiling blender for osx with scons

Post by aloyr » Mon Mar 14, 2011 3:36 pm

is anyone else having issues compiling blender for osx using scons?

the previous to latest update of the universal libs had broken blender for me, but i could still rollback the revision on subversion and get it to compile. now it seems that blender requires python 3.2 (present in the libs) but it will just not compile.

here is the beginning of the compiling output:

Code: Select all

scons: done reading SConscript files.
scons: Building targets ...
Compiling ==> 'AUD_Buffer.cpp'
intern/audaspace/intern/AUD_Buffer.cpp:35:19: error: cstring: No such file or directory
intern/audaspace/intern/AUD_Buffer.cpp:36:19: error: cstdlib: No such file or directory
intern/audaspace/intern/AUD_Buffer.cpp: In constructor ‘AUD_Buffer::AUD_Buffer(int)’:
intern/audaspace/intern/AUD_Buffer.cpp:43: 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:48: 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:65: error: ‘malloc’ was not declared in this scope
intern/audaspace/intern/AUD_Buffer.cpp:67: error: ‘memcpy’ was not declared in this scope
intern/audaspace/intern/AUD_Buffer.cpp:69: error: ‘free’ was not declared in this scope
intern/audaspace/intern/AUD_Buffer.cpp:73: error: ‘realloc’ was not declared in this scope
Compiling ==> 'AUD_C-API.cpp'
In file included from intern/audaspace/intern/AUD_PyInit.h:36,
                 from intern/audaspace/intern/AUD_C-API.cpp:38:
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:11:20: error: limits.h: No such file or directory
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:14:2: error: #error "Something's broken.  UCHAR_MAX should be defined in limits.h."
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:18:2: error: #error "Python's source code assumes C's unsigned char is an 8-bit type."
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:25:19: error: stdio.h: No such file or directory
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:27:5: error: #error "Python.h requires that stdio.h define NULL."
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:30:20: error: string.h: No such file or directory
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:32:19: error: errno.h: No such file or directory
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:34:20: error: stdlib.h: No such file or directory
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:36:20: error: unistd.h: No such file or directory
/Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:48:20: error: assert.h: No such file or directory
In file included from /Users/peter/workspace/blender-build/lib/darwin-9.x.universal/python/include/python3.2/Python.h:50,
and hundreds of error lines later i get this:

Code: Select all

intern/audaspace/intern/AUD_C-API.cpp: In function ‘int AUD_readSound(AUD_Sound*, sample_t*, int)’:
intern/audaspace/intern/AUD_C-API.cpp:926: error: ‘floor’ was not declared in this scope
scons: *** [/Users/peter/workspace/blender-build/build/darwin/intern/audaspace/intern/AUD_C-API.o] Error 1
scons: building terminated because of errors.
i got the latest xcode that was released last week, and my gcc version is below:

Code: Select all

gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
thanks in advance for any help.

aloyr
Posts: 0
Joined: Mon Mar 14, 2011 3:06 pm
Location: US

Re: help with issues compiling blender for osx with scons

Post by aloyr » Mon Mar 14, 2011 4:37 pm

as it turns out, reverting xcode to 3.2.5 fixed the issue. it seems that xcode 4.0 does not come with the osx 10.4 sdk...

ton
Site Admin
Posts: 350
Joined: Wed Oct 16, 2002 12:13 am
Contact:

Re: help with issues compiling blender for osx with scons

Post by ton » Mon Mar 14, 2011 5:06 pm

It seems new XCode 4 won't compile Blender at all... better stay away from it until we've investigated it...

aloyr
Posts: 0
Joined: Mon Mar 14, 2011 3:06 pm
Location: US

Re: help with issues compiling blender for osx with scons

Post by aloyr » Mon Mar 14, 2011 6:37 pm

thanks, ton.

this xcode 4 update is pretty weird. it removed all older sdks from my mac (10.5 and 10.4, leaving only 10.6). it also costs $4.99, which is a weird price for an sdk... anyway, the good news is that installing xcode 3.2.6 fixed it.

shul
Posts: 1
Joined: Thu Apr 01, 2004 4:12 pm

Re: help with issues compiling blender for osx with scons

Post by shul » Mon Mar 28, 2011 4:51 am

ton wrote:It seems new XCode 4 won't compile Blender at all... better stay away from it until we've investigated it...
Hi,
I managed compiling and running blender in xcode 4.

download cmake 2.8.4 and install it.

After following the instructions at:
http://wiki.blender.org/index.php/Dev:2 ... lender/Mac

run "cmake-gui ../blender/"

Make sure you create an xcode project.

CMAKE_CXX_COMPILER should be /usr/bin/c++

config and generate the project.

Open the project within xcode4 and choose from the sub projects drop
down "install". press the "build and run" button.

After this step ends choose "blender" from the dropdown and build and
run. at this stage blender runs on my setup.

shul[/url]

dfelinto
Posts: 0
Joined: Wed May 17, 2006 8:44 pm
Location: Rio de Janeiro, Brasil

Post by dfelinto » Sun Jul 03, 2011 8:56 am

hi, I have xcode 3.25 and yet can't compile with scons here (same problem as mention in the top (Compiling ==> 'AUD_Buffer.cpp'
intern/audaspace/intern/AUD_Buffer.cpp:35:19: error: cstring: No such file or directory
...)

CMake builds fine here. Any suggestions?
Thanks
Rio de Janeiro - Brasil
http://blenderecia.orgfree.com

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

Post by stiv » Sun Jul 03, 2011 1:46 pm

error: cstring: No such file or directory
This is a C++ header file. Either you do not have the C++ compiler (g++) installed, or the include file paths are wrong.

Running 'g++ --version' will tell you if the compiler is available.

dfelinto
Posts: 0
Joined: Wed May 17, 2006 8:44 pm
Location: Rio de Janeiro, Brasil

Post by dfelinto » Mon Jul 04, 2011 11:05 am

stiv wrote:Running 'g++ --version' will tell you if the compiler is available.
My g++ says: i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)

As I said it builds fine with CMake (for both XCode and make). So the problem is probably in the paths for scons or something particular to my system. Anyone running into that? I'm in an OSX 10.6.8

Thanks
Rio de Janeiro - Brasil
http://blenderecia.orgfree.com

dfelinto
Posts: 0
Joined: Wed May 17, 2006 8:44 pm
Location: Rio de Janeiro, Brasil

Post by dfelinto » Mon Jul 04, 2011 10:13 pm

problem solved. I didn't specify the architecture in the user-config.py file. thanks everyone
Rio de Janeiro - Brasil
http://blenderecia.orgfree.com

Baset
Posts: 0
Joined: Mon Sep 12, 2011 2:11 pm

Post by Baset » Mon Sep 12, 2011 2:15 pm

Does anyone know if it's possible to build using scons with the above setup, using a more modern compiler than the venerable gcc-4.0?

When I used to build with make, compiling using gcc-4.2, 4.4 and 4.5.1 was a relatively trouble free process. I've had no such luck with scons so far.

Does anyone have any insights they could share?

Many thanks,

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

Post by stiv » Mon Sep 12, 2011 2:39 pm

Most Linux distros are shipping gcc 4.5 or something in that neighborhood.
Does anyone have any insights they could share?
Sure! Error messages mean something is wrong. Generally speaking, compile problems are either bad paths or something not installed. Correct the problem and run scons again.

Yes, that is not really useful, but if you tell us the *actual* error messages, we can do something about it. You can also get help compiling on the #blendercoders IRC channel on freenode.net .

The contents of .../doc/build_systems might also be of interest.

Post Reply