> On Wed, Mar 12, 2008 at 11:12 PM, Jonathan Woithe > <[EMAIL PROTECTED]> wrote: > > I agree. What about running ldd on <prefix>/lib/plplot-*/cairo.so? > > Anything differences in this between the two working directories? > > > > The drivers are loaded dynamically on demand I think which is why the cairo > > libraries (for example) aren't explicitly required by the test application. > > This looks like it may be the culprit, though I don't know why. > > from the segfaulting location: > ~/Projects/ocaml/tmp$ ldd > ~/Applications/plplot/lib/plplot5.9.0/driversd/cairo.so > libplplotd.so.9 => /usr/lib/libplplotd.so.9 (0xb7f16000) > libcsirocsa.so.0 => ~/Applications/plplot/lib/libcsirocsa.so.0 > (0xb7e6d000) > libcsironn.so.0 => ~/Applications/plplot/lib/libcsironn.so.0 > (0xb7e65000) > > from the build directory (no segfaults): > ~/tmp/BUILD/plplot/plplot-svn/build/drivers$ ldd cairo.so > libplplotd.so.9 => > ~/tmp/BUILD/plplot/plplot-svn/build/src/libplplotd.so.9 (0xb7eda000) > libcsirocsa.so.0 => > ~/tmp/BUILD/plplot/plplot-svn/build/lib/csa/libcsirocsa.so.0 (0xb7bd7000) > libcsironn.so.0 => > ~/tmp/BUILD/plplot/plplot-svn/build/lib/nn/libcsironn.so.0 (0xb7bcf000) > > ~/Applications/plplot/* is my plplot-svn install, while /usr/lib/* > holds the Debian packages.
How do you normally switch between these two plplot environments? Do you use LD_LIBRARY_PATH? If so, was it active for any of the above tests? What command line did you use to compile the test application? I guess I'm curious to know how the compiler knows which of these to use when compiling and linking your test application. There is also the small matter of how your test application seemingly correctly picks libplplotd.so.9 from ~/Applications/plplot/lib/ in both cases - this puzzles me a bit. In the above, the libplplotd.so.9 is found in the build directory in the second test because the uninstalled cairo.so probably has a hardcoded path to it; this might be done to assist in debugging as it allows one to run things from the build directory without installing. The situation in the first test is a concern since the wrong libplplot.so is found. What's not clear is why, given that the ~/Applications/ version is located by the test application. > Is there a way to make LD_LIBRARY_PATH or similar hold for the dynamically > loaded cairo.so? In theory at least LD_LIBRARY_PATH should be consulted when loading cairo.so unless the underlying application is a setuid or setgid binary. Refer to the dlopen() manpage for details. I've just checked the plplot source code. The call to dlopen() uses a path to the driver which is returned by plGetDrvDir() in plcore.c. If you are anywhere in the build tree then the directory is forced to refer to the driver's directory in the build tree. If not, it tries to find the driver in the following places: * The directory specified by the PLPLOT_DRV_DIR environment variable * The ultimate install location of the drivers This explains how the driver itself is found. Resolving the driver's dependencies should occur as previously explained. I suspect there might be some issue going on between the different versions of plplot on your system. It would be nice to pinpoint the exact cause. Regards jonathan ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel