Page 1 of 1

Building blender as python module

Posted: Tue Apr 09, 2013 12:01 pm
by wbronchart
I'm trying to build blender as a python module by following these tutorials:
http://wiki.blender.org/index.php/Dev:2 ... lender/Mac
http://wiki.blender.org/index.php/User: ... AsPyModule

All works fine until when it starts linking I get this error. I'm compiline it on a mac osx 10.8

Code: Select all

Linking CXX shared module ../../bin/bpy.so
Undefined symbols for architecture x86_64:
  "_user_locale", referenced from:
      _bl_locale_set in libbf_intern_locale.a(boost_locale_wrapper.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea's how to fix this?

Posted: Tue Apr 09, 2013 3:37 pm
by stiv
Using an older version of Boost?

Posted: Tue Apr 09, 2013 3:38 pm
by wbronchart
I've checked out /lib/darwin-9.x.universal from blenders source. Is that old? Should I be using another one?

Posted: Tue Apr 09, 2013 3:46 pm
by stiv
Not sure if the lib stuff in svn is still valid for OSX (or any other platform) Our install_deps script does Boost 1.51.

Posted: Tue Apr 09, 2013 4:04 pm
by wbronchart
Hey thanks. I've looked into that, but it looks like the install_deps.sh script is broken:

Code: Select all

build_environment waldob$ sh install_deps.sh --help
cat: /proc/cpuinfo: No such file or directory
sed: illegal option -- r

(...)

Do you want to continue (Y/n)?Y
install_deps.sh: line 1618: [: =: unary operator expected
install_deps.sh: line 1629: [: =: unary operator expected
install_deps.sh: line 1648: [: =: unary operator expected
install_deps.sh: line 1674: [: too many arguments
install_deps.sh: line 1711: [: =: unary operator expected

install_deps.sh: line 1544: [: too many arguments
install_deps.sh: line 1546: [: =: unary operator expected
Building Python-3.3.0
Ensuring /opt/lib exists and is writable by us

Posted: Tue Apr 09, 2013 4:08 pm
by wbronchart
To clarify. I'm building on mac

Posted: Tue Apr 09, 2013 4:50 pm
by wbronchart
so uhm, I think that script only works on linux. I'm trying to update the boost library myself, but even if that works, I'm pretty sure there will be other issues

Undefined symbols for architecture x86_64

Posted: Sat Aug 31, 2013 12:29 pm
by yakupdogan
wbronchart wrote:so uhm, I think that script only works on linux. I'm trying to update the boost library myself, but even if that works, I'm pretty sure there will be other issues
Hey, I have the same problem on my Mac:

Undefined symbols for architecture x86_64:

I have an 64 Bit architecture platform and have checked out the darwin-9.x.universal lib. I could also compile blender. But the problem occurs, when I change the cmake-options for getting blender as module

WITH_PYTHON_INSTALL=OFF
WITH_PLAYER=OFF
WITH_PYTHON_MODULE=ON

You probably solved the problem and I would be happy, if you can post the solution..

Re: Undefined symbols for architecture x86_64

Posted: Thu Oct 10, 2013 1:10 am
by kureta
yakupdogan wrote:
wbronchart wrote:so uhm, I think that script only works on linux. I'm trying to update the boost library myself, but even if that works, I'm pretty sure there will be other issues
Hey, I have the same problem on my Mac:

Undefined symbols for architecture x86_64:

I have an 64 Bit architecture platform and have checked out the darwin-9.x.universal lib. I could also compile blender. But the problem occurs, when I change the cmake-options for getting blender as module

WITH_PYTHON_INSTALL=OFF
WITH_PLAYER=OFF
WITH_PYTHON_MODULE=ON

You probably solved the problem and I would be happy, if you can post the solution..
I have just registered to this site to answer your post. It has been a frustrating challange for me, so i suppose it was the same for you, considering you have never got an answer.

I just edited blender-2.68/intern/locale/boost_locale_wrapper.cpp file like this:

ORIGINAL:

Code: Select all

#ifdef __APPLE__
			extern char GHOST_user_locale[128]; // pulled from Ghost_SystemCocoa
			std::string locale_osx = GHOST_user_locale + std::string(".UTF-8");
			_locale = gen(locale_osx.c_str());
#else
NEW:

Code: Select all

#ifdef __APPLE__aaaa
			extern char GHOST_user_locale[128]; // pulled from Ghost_SystemCocoa
			std::string locale_osx = GHOST_user_locale + std::string(".UTF-8");
			_locale = gen(locale_osx.c_str());
#else
just to prevent it from entering into #ifdef

now localization does not work but everything else is ok.

Hope it helps.

Posted: Sat Oct 19, 2013 11:40 pm
by wbronchart
cool thanks! I'll give that another try.