However, on investigation, I found I was actually dynamically linking to boost, when I intended to statically link. Once I fixed that, though, I still had a similar, though slightly different error:
AttributeError: 'NoneType' object has no attribute 'iex'
When I fired up a debugger, it seemed the error was on this line, in PyIlmBase/PyImath/imathmodule.cpp, in init_module_imath (created form the BOOST_PYTHON_MODULE(imath) macro):
scope().attr("iex") = iex;
The problem was that scope() was returning "None", when it should have been returning the scope for the imath module - which should be set up by boost::python::detail::init_module(). However, this didn't seem to be running properly.
However, when I simply "manually expanded" the BOOST_PYTHON_MODULE, and "manually inlined" boost::python::detail::init_module(), it magically started working. That's what the included patch file does. I have no idea why this would make a difference - it should be essentially the same as what the macro expands out to. It's possible it's some sort of bug with Boost.Python, or even with gcc itself... so here are the exact versions of everything I was using:
boost-1.55.0
gcc-4.8.3
ilmbase-2.2.0
alembic-1.5.8
Anyway, perhaps this patch will help someone, or someone else will be able to dig deeper and figure out why the BOOST_PYTHON_MODULE(imath) version doesn't work. I'd be curious to see what happened with a different compiler, for instance (say, clang).
- Paul