Building pyalembic on Mac, Homebrew

833 views
Skip to first unread message

Murphy

unread,
Feb 23, 2013, 9:02:50 PM2/23/13
to alembic-d...@googlegroups.com
I've successfully built pyalembic on the mac.
I'm using a version of Python that I've installed through homebrew.
I've built Boost-1.44 using the correct flags and commands as instructed in the doc directory of the Alembic source (although, it included something like the compiler name in the name of the compiled library, and I had to remove that by hand before CMake could find the compiled libraries).
I've built PyImath from source using the same homebrew python.

In order to build pyalembic, I had to edit the CMake files by hand to point to the homebrew Python (2.7) instead of the system Python (2.6).
After building, I run 'make' and 'make test' in the alembic_build/python directory. The test passes successfully.

Here are the parts wehre I'm getting confused: alembicmodule.so is being built as alembicmodule.dylib. Before moving it by hand into the Python's site-packages folder, I change it's extension to .so (Are they the same thing?)
When then launch Python and type `import alembic` I get this response:

TypeError: No Python class registered for C++ class PyImath::FixedArray<unsigned char>

I get no errors when I `import imath`, but if I run `dur(imath)` I don't see FixedArray anywhere in the list.

Any ideas what might be going on?

Thanks!

Ravi Jagannadhan

unread,
Feb 23, 2013, 9:05:45 PM2/23/13
to alembic-d...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "alembic-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan

Murphy

unread,
Feb 24, 2013, 1:08:23 AM2/24/13
to alembic-d...@googlegroups.com
Thanks, Ravi!

I just found this post by virtue of Google (why didin't I find it before?)

It seems that imath must be imported before alembic is, and the code to auto import is failing for me (I don't know why).

Once I did the imports in the correct order, I was set.
Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discussion+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Murphy

unread,
Feb 24, 2013, 2:04:33 AM2/24/13
to alembic-d...@googlegroups.com
Here's a more in-depth solution:

Ravi Jagannadhan

unread,
Feb 24, 2013, 2:09:21 AM2/24/13
to alembic-d...@googlegroups.com
Hey, that guy has the same name as you! What're the odds?

Seriously though, nicely done.


To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discuss...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeremy Cowles

unread,
Feb 24, 2013, 2:10:47 AM2/24/13
to alembic-d...@googlegroups.com
Yeah, nice write up!

--
Jeremy

Murphy

unread,
Mar 5, 2013, 12:44:31 PM3/5/13
to alembic-d...@googlegroups.com
Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discussion+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan

--
You received this message because you are subscribed to the Google Groups "alembic-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discussion+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan

Ryan Galloway

unread,
Mar 6, 2013, 7:27:56 PM3/6/13
to alembic-d...@googlegroups.com

> Look at all of those nasty parameters

If there is common root for all of your deps, you can try the much simpler --dependency-install-root argument to the build script, i.e.

--dependency-install-root=/usr/local/


> I don’t know why these came out as dylibs instead of sos

I noticed in your writeup that some of the other libs also have the .dylib suffix:

/usr/local/lib/libPyImath.1.0.0.dylib
/usr/lib/libz.1.2.5.dylib

Apparently, this is something cmake does for OSX builds.

http://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-osx

We may be able to trick it into using the shared library naming conventions used by Linux, etc. but is it necessary? Can you confirm whether you can import the alembicmodule.dylib in Python on OSX?



To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discuss...@googlegroups.com.

Murphy

unread,
Mar 12, 2013, 8:20:48 PM3/12/13
to alembic-d...@googlegroups.com
Thanks for your reply, Ryan! That information is helpful.

In response, I can verify that Python will not recognize 'alembicmodule.dylib' as an importable module. 
If I rename it to '.so' I can import it (but I can't actually use it. I get runtime errors as seen in this thread: http://goo.gl/wxtTV).

Francois

unread,
Jan 27, 2014, 1:01:35 AM1/27/14
to alembic-d...@googlegroups.com

I'm actually getting an error similar to the one from this thread, but the import imath
command before the import alembic doesn't sort it out...
It looks like some demangling on the symbol isn't done or something ..

has anyone got this one before ?

>>> import imath
>>> import alembic
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: No Python class registered for C++ class N7PyImath10FixedArrayIbEE

Francois

unread,
Jan 27, 2014, 1:21:18 AM1/27/14
to alembic-d...@googlegroups.com
After a bit more playing around ... found out that I was compiling 
the python module with the Intel compiler , compiling it with gcc
still gives me an error but no name mangling anymore :

>>> import imath
>>> import wPyAbc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: No Python class registered for C++ class PyImath::FixedArray<bool>

Francois

unread,
Jan 27, 2014, 3:07:27 PM1/27/14
to alembic-d...@googlegroups.com
Found the solution in another thread, this made it work :

import DLFCN 
import sys 
sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL) 

import imath
import alembic

Egor Litvinchuk

unread,
Jul 16, 2014, 4:15:08 PM7/16/14
to alembic-d...@googlegroups.com
Hello!

Im trying to build pyilmbase library (1.0) and face 15 errors on make.
At first I'd like to thank you, Murphy, for an excellent post you've made on building Alembic, it helped me a lot. 
i did everything like you've described there, exept the version of boost, as 1.44 doesn't make after, so i used 1.48.
configuration went successfully, but i get errors on make:

PyImathStringTable.cpp:47:46: error: expected expression

    const StringSet &strings = _table.get<1>();

                                             ^

PyImathStringTable.cpp:62:45: error: expected expression

    const IndexSet &indices = _table.get<0>();

                                            ^

PyImathStringTable.cpp:77:46: error: expected expression

    const StringSet &strings = _table.get<1>();

                                             ^

PyImathStringTable.cpp:105:46: error: expected expression

    const StringSet &strings = _table.get<1>();

                                             ^

PyImathStringTable.cpp:114:45: error: expected expression

    const IndexSet &indices = _table.get<0>();

                                            ^

PyImathStringTable.cpp:47:22: error: declaration of reference variable 'strings' requires an initializer

    const StringSet &strings = _table.get<1>();

                     ^~~~~~~

PyImathStringTable.cpp:121:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<char> >::lookup' requested here

template class PYIMATH_EXPORT StringTableT<std::string>;

                              ^

PyImathStringTable.cpp:62:21: error: declaration of reference variable 'indices' requires an initializer

    const IndexSet &indices = _table.get<0>();

                    ^~~~~~~

PyImathStringTable.cpp:121:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<char> >::lookup' requested here

template class PYIMATH_EXPORT StringTableT<std::string>;

                              ^

PyImathStringTable.cpp:77:22: error: declaration of reference variable 'strings' requires an initializer

    const StringSet &strings = _table.get<1>();

                     ^~~~~~~

PyImathStringTable.cpp:121:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<char> >::intern' requested here

template class PYIMATH_EXPORT StringTableT<std::string>;

                              ^

PyImathStringTable.cpp:105:22: error: declaration of reference variable 'strings' requires an initializer

    const StringSet &strings = _table.get<1>();

                     ^~~~~~~

PyImathStringTable.cpp:121:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<char> >::hasString' requested here

template class PYIMATH_EXPORT StringTableT<std::string>;

                              ^

PyImathStringTable.cpp:114:21: error: declaration of reference variable 'indices' requires an initializer

    const IndexSet &indices = _table.get<0>();

                    ^~~~~~~

PyImathStringTable.cpp:121:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<char> >::hasStringIndex' requested here

template class PYIMATH_EXPORT StringTableT<std::string>;

                              ^

PyImathStringTable.cpp:47:22: error: declaration of reference variable 'strings' requires an initializer

    const StringSet &strings = _table.get<1>();

                     ^~~~~~~

PyImathStringTable.cpp:122:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<wchar_t> >::lookup' requested here

template class PYIMATH_EXPORT StringTableT<std::wstring>;

                              ^

PyImathStringTable.cpp:62:21: error: declaration of reference variable 'indices' requires an initializer

    const IndexSet &indices = _table.get<0>();

                    ^~~~~~~

PyImathStringTable.cpp:122:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<wchar_t> >::lookup' requested here

template class PYIMATH_EXPORT StringTableT<std::wstring>;

                              ^

PyImathStringTable.cpp:77:22: error: declaration of reference variable 'strings' requires an initializer

    const StringSet &strings = _table.get<1>();

                     ^~~~~~~

PyImathStringTable.cpp:122:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<wchar_t> >::intern' requested here

template class PYIMATH_EXPORT StringTableT<std::wstring>;

                              ^

PyImathStringTable.cpp:105:22: error: declaration of reference variable 'strings' requires an initializer

    const StringSet &strings = _table.get<1>();

                     ^~~~~~~

PyImathStringTable.cpp:122:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<wchar_t> >::hasString' requested here

template class PYIMATH_EXPORT StringTableT<std::wstring>;

                              ^

PyImathStringTable.cpp:114:21: error: declaration of reference variable 'indices' requires an initializer

    const IndexSet &indices = _table.get<0>();

                    ^~~~~~~

PyImathStringTable.cpp:122:31: note: in instantiation of member function 'PyImath::StringTableT<std::__1::basic_string<wchar_t> >::hasStringIndex' requested

      here

template class PYIMATH_EXPORT StringTableT<std::wstring>;

                              ^

15 errors generated.


I've attached full trace of configure and make.

System: osx 10.9, boost: 1.48, pyilmbase: 1.0


Hope for your help.

Thanks in advance!


config.rtf
make.rtf
Reply all
Reply to author
Forward
0 new messages