Opened 10 years ago

Last modified 6 weeks ago

#42233 new defect

libraries compiled by the boost port with variant +python33 do not have match the symbols of regular builds — at Initial Version

Reported by: NeilGirdhar (Neil) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc:
Port: boost

Description

See my question here: http://stackoverflow.com/questions/21302238/link-error-with-boost-python-installed-by-macports-on-mavericks

I upgraded to maverics and now the macports version of boost-python doesn't work.

I installed ports: gcc48 and boost +python33.

I tried to compile this program with c++11 or without c++11:

#include <boost/python.hpp> class A {}; BOOST_PYTHON_MODULE(libblah) {

boost::python::class_<A>("A");

}

I used cmake, but the build commands generated are below along with the linker error that I get:

[100%] Building CXX object CMakeFiles/a.dir/a.cc.o g++ -Da_EXPORTS -std=gnu++0x -save-temps=obj -arch x86_64 -fPIC -I/Users/neil/nn/src -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/Library/Frameworks/Python.framework/Headers -F/usr/local/Qt-5.2.0/lib -I/usr/local/Qt-5.2.0/lib/QtCore.framework/Headers -I/usr/local/Qt-5.2.0/mkspecs/macx-clang -I/usr/local/Qt-5.2.0/lib/QtGui.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers -I/usr/local/Qt-5.2.0/lib/QtOpenGL.framework/Headers -I/usr/local/Qt-5.2.0/lib/QtWidgets.framework/Headers -I/opt/local/Library/Frameworks/Python.framework/Versions/3.3/include/python3.3m -I/Users/neil/nn/src/. -o CMakeFiles/a.dir/a.cc.o -c /Users/neil/nn/src/a.cc Linking CXX shared module liba.so g++ -std=gnu++0x -save-temps=obj -arch x86_64 -bundle -Wl,-headerpad_max_install_names -o liba.so CMakeFiles/a.dir/a.cc.o -L/opt/local/lib -L/Users/neil/nn/src /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/libpython3.3.dylib /opt/local/lib/libboost_python-mt.dylib -Wl,-rpath,/opt/local/lib -Wl,-rpath,/Users/neil/nn/src Undefined symbols for architecture x86_64:

"boost::python::objects::function_object(boost::python::objects::py_function const&, std::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&)", referenced from:

boost::python::api::object boost::python::detail::make_function_aux<void (*)(_object*), boost::python::default_call_policies, boost::mpl::vector2<void, _object*>, mpl_::int_<0> >(void (*)(_object*), boost::python::default_call_policies const&, boost::mpl::vector2<void, _object*> const&, std::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&, mpl_::int_<0>) in a.cc.o

"boost::python::objects::register_dynamic_id_aux(boost::python::type_info, std::pair<void*, boost::python::type_info> (*)(void*))", referenced from:

void boost::python::objects::register_dynamic_id<A>(A*) in a.cc.o

ld: symbol(s) not found for architecture x86_64

How can I work around this bug without installing boost by myself. As with this [Related question][1], the symbols in the library

nm libboost_python-mt.dylib | c++filt | grep boost::python::objects::function_object

are found:

0000000000013d60 T boost::python::objects::function_object(boost::python::objects::py_function const&) 0000000000013d00 T boost::python::objects::function_object(boost::python::objects::py_function const&, std::1::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&)

However, they have std::1 prefixes, which do not match what is expected in the undefined symbols errors.

[1]: http://stackoverflow.com/questions/20134223/building-a-boost-python-application-on-macos-10-9-mavericks/20135600#comment32086701_20135600

Change History (0)

Note: See TracTickets for help on using tickets.