You are here

Problems with boost

3 posts / 0 new
Last post
Problems with boost
#1

Short story:

I get a segmentation fault when I issue:

from rosetta import *

in function PyInt_FromLong. But I am not sure what is wrong, since PyRosetta compilation worked fine.

Long story:

The binary distribution PyRosetta.MacOSX.SnowLeopard-r48781.64Bit works on my computer with the system python 2.6.1, but I would like to compile a version for the EPDPython 2.7, which I normally use. Also, I thought of this as training for a compilation on an older Centos system, for which there is no binary distribution.

I have:
-Mac OS X 10.6.8 32bit
-Python 2.7.1 |EPD 7.0-2 (64-bit)|
-PyRosetta from src/python/bindings of rosetta3.4

I installed gccxml and boost 1.49 using homebrew. Then I installed pygccxml, pyplusplus using pip.

Then I ran:

./BuildBindings.py -I/Library/Frameworks/EPD64.framework/Versions/Current/include/python2.7 -L/Library/Frameworks/EPD64.framework/Versions/Current/lib --boost_lib boost_python-mt

This didn't compile, because of missing files. I updated two extensions from .inc to .ipp in

src/core/graph/unordered_object_pool.hpp
include
include

Next, there was another problem in directory src/python/bindings/rosetta/core/scoring/ when building __scoring_all_at_once_.so

Undefined symbols:
"core::scoring::compute_jump_rmsd(core::pose::Pose const&, core::pose::Pose const&, boost::unordered::unordered_map, std::equal_to, std::allocator > >*)", referenced from:
__scoring_all_at_once__partial_1() in __scoring_all_at_once_.1.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

The problem is that "...boost::unordered::unordered_map..." is not defined but libmini contains boost::unordered_map
After looking around online, I guessed that boost 1.49 changed behavior of unordered_map.

I rolled boost back to 1.46.1 and then PyRosetta compiled fine.

However, when I issue:
from rosetta import *
I get a segmentation fault.

The backtrace from gdb tells me the seg fault is at:

#0 0x00000001006d7932 in PyInt_FromLong ()
#1 0x00000001093cf64b in boost::python::detail::keywords<1ul>::operator= ()
#2 0x00000001093a4047 in init_module___scoring_all_at_once_ ()
#3 0x0000000106ff5431 in boost::python::handle_exception_impl ()
#4 0x0000000106ff6596 in boost::python::handle_exception ()
#5 0x0000000106ff621b in boost::python::detail::init_module ()
#6 0x00000001000e6792 in _PyImport_LoadDynamicModule ()
...

Do you have any idea what is wrong or any advice what to change?
Thank you!

Post Situation: 
Mon, 2012-05-07 01:56
vasek

Hard to tell... but it looks like boost <--> python compatibility issus. I would recommend to double check if boost, Python and PyRosetta libs build with same arch type (ie 64 or 32bit). And double check all include/linking paths to make sure you compile/linking to appropriate versions. Have you used any extra flags when building boost, anything unusual?

Also, do you access to rosetta svn? If so, then you can try using DeployPyRosetta.py script to setup build environment (this is what we use when we build binaries).

Mon, 2012-05-07 10:59
Sergey

Thank you for your answer.
I finally resolved it by adding --python_lib python2.7
BuildBindings.py was using libpython2.5 by default.

Tue, 2012-05-08 02:04
vasek