Closed mikepurvis closed 5 years ago
Building the bindings lib with VERBOSE=1
yields a bunch of compile lines like:
g++ -c -std=c++11 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -W -D_REENTRANT -DNDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -I/home/administrator/rviz_ws/src/rviz/src -I/home/administrator/rviz_ws/install/include -I/home/administrator/rviz_ws/install/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -I/usr/include -I/usr/include/eigen3 -I/usr/include/python3.5m -I/usr/share/qt5/mkspecs/linux-g++ -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/X11R6/include -o siplibrviz_siprviz.o siplibrviz_siprviz.cpp
And a link line like:
g++ -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-rpath,"/home/administrator/rviz_ws/devel/rviz/lib" -shared -Wl,--version-script="/home/administrator/rviz_ws/devel/rviz/lib/python3/dist-packages/rviz/librviz_sip".exp -o "/home/administrator/rviz_ws/devel/rviz/lib/python3/dist-packages/rviz/librviz_sip".so siplibrviz_sipcmodule.o siplibrviz_siprvizYamlConfigReader.o siplibrviz_siprvizYamlConfigWriter.o siplibrviz_siprvizConfigMapIterator.o siplibrviz_siprvizConfig.o siplibrviz_siprvizOgreLogging.o siplibrviz_siprvizToolManager.o siplibrviz_siprvizTool.o siplibrviz_siprvizViewManager.o siplibrviz_siprvizViewController.o siplibrviz_siprvizPanelDockWidget.o siplibrviz_siprvizBoolProperty.o siplibrviz_siprvizDisplayGroup.o siplibrviz_siprvizDisplay.o siplibrviz_siprvizProperty.o siplibrviz_siprvizVisualizationManager.o siplibrviz_siprvizVisualizationFrame.o siplibrviz_siprviz.o -L/home/administrator/rviz_ws/devel/rviz/lib -L/usr/lib/x86_64-linux-gnu -L/usr/X11R6/lib -lrviz -lQt5Core -lQt5Gui -lXext -lX11 -lm -lpthread
Looks like the problem is not coming in via sip but is rather because librviz.so
itself is being linked with -lpython2.7
:
$ ldd lib/librviz.so | grep python
libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007f3fa40c3000)
Oh blah, this might be particular to my setup. Going to close it for now and investigate further.
Just to circle back here— the issue was trying to build a hybrid workspace with rviz and its dependency tree against Python 3 while portions of the system underlay were built for Python 2 or dual-built. The libpython2.7.so
linkage is actually coming in via roslib and rospack, because librospack links against Python 2:
https://github.com/ros/rospack/blob/lunar-devel/src/rospack.cpp#L28
When building rviz from source on Xenial with
-DPYTHON_EXECUTABLE=python3
I end up with the following in my installspace:Seems reasonable enough, however, the Python bindings are linked against the wrong libpython:
Other bindings in this same workspace are doing the right thing:
So it's not clear to me if this is an issue with the SIP generator (the other bindings are non-SIP) or a problem with rviz's use of it, but for now I'm ticketing the issue here.