Oops, forgot to send this to the list in addition to Andrew and Hazen. Alan ---------- Forwarded message ---------- Date: Thu, 4 Mar 2010 01:22:08 -0800 (PST) From: Alan W. Irwin <ir...@beluga.phys.uvic.ca> To: Andrew Ross <andrewr...@users.sourceforge.net>, Hazen Babcock <hbabc...@mac.com> Subject: Peculiar pyqt4 linking error on Linux with Qt4.6.1
To Andrew and Hazen: I am addressing this primarily to you guys because of Andrew's python and linking expertise and Hazen's python and pyqt4 expertise. I am getting the following error message with the pytqt4 example (either in the build tree or the installed examples tree) softw...@raven> examples/python/pyqt4_example.py Traceback (most recent call last): File "examples/python/pyqt4_example.py", line 31, in <module> import plplot_pyqt4 ImportError: /home/software/qtsdk-2010.01/qt/lib/libQtXml.so.4: undefined symbol: _Z9qBadAllocv I find setting LD_LIBRARY_PATH=/home/software/qtsdk-2010.01/qt/lib solves the issue. Can you verify this issue for non-system (downloaded) versions of Qt4 that are installed in non-standard locations? This question is probably just for Andrew because I am pretty sure that downloaded Qt4 is not going to work on Hazen's dated Mac OS X system. I have found usually in such cases where LD_LIBRARY_PATH was necessary, the problem could be solved (at least on Linux) by rpath which tells the run-time loader AND dlopen where to find libraries. However, rpath appears not to solve the present problem. I came to that conclusion because the rpath information seems fine within our build system both for the build tree (handled automatically by CMake) and the install tree (handled by our special RPATH CMake logic). That is confirmed by the "ldd -r" command (without setting LD_LIBRARY_PATH) that shows bindings/python/_plplotcmodule.so bindings/python/plplot_widgetmodule.so bindings/qt_gui/libplplotqtd.so and bindings/qt_gui/pyqt4/plplot_pyqt4.so (and their installed counterparts) have no run-time loader linking issues (e.g., no issues like pointing to an incorrect system version of libQt4 rather than the special location for the downloaded Qt-4.6.1 libraries on my system). Similarly "ldd -r" shows no linking issues with _all_ libraries in /home/software/qtsdk-2010.01/qt/lib. I have also checked bindings/qt_gui/pyqt4/plplot_pyqt4.so and its installed version using, e.g., readelf -d /home/software/plplot_svn/installcmake/lib/python2.5/site-packages/plplot_pyqt4.so |less The readelf command (highly recommended by http://www.andihellmund.com/) shows directly that the rpath linker option has correctly set DT_RPATH. The man page for dlopen clearly states that DT_RPATH will be honored. Given these good "ldd -r" results and "readelf -d" results without setting LD_LIBRARY_PATH, the only working hypothesis that seems reasonable to me to explain the result that LD_LIBRARY_PATH is still required to run examples/python/pyqt4_example.py is that python itself has deliberately modified dlopen to ignore DT_RPATH. Do you think this is a reasonable idea or can you think of a more believable working hypothesis to explain these results? In future I plan to test DT_RUNPATH instead (which you get by combining the -rpath and --enable-new-dtags options for ld according to http://www.andihellmund.com). The purpose of DT_RUNPATH is to allow LD_LIBRARY_PATH to work (unlike the badly designed DT_RPATH), and it is possible that python deliberately ignores DT_RPATH when dynamically loading, and only pays attention to DT_RUNPATH. But that is contrary to the dlopen man page. I would like to add examples/python/pyqt4_example.py as one of our interactive tests run by the test_interactive target. At the same time, I encouraging those who can to use the latest downloadable version of Qt4 which usually implies a special install location. However, because rpath doesn't seem to work for this case, having to set the LD_LIBRARY_PATH environment variable on Linux makes it difficult to use this example as one of the tests that will automatically be run by anybody who runs the test_interactive target on Linux. So unless the above --enable-new-dtags idea works or somebody can come up with another way to get rpath to be recognized by python, I probably won't be using this example as part of automatic testing. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel