[visit-users] Making a database reader plugin using a third party library.

Mark Miller miller86 at llnl.gov
Mon Mar 15 12:18:10 EDT 2010


Hi Olivier,

Not sure if someone already answered but the simplest thing to do is to
link your lib directly into the plugin .so's.

You can do this by NOT passing '-L<path-to-lib-dir>' and '-l<libname>'
when linking the plugin's .so's and instead link them by passing the
path to the lib's .a file itself as in... '/foo/bar/lib/mylib.a'

I think there may be another way to achieve same end with appropriate
use of '-static' linker flags (gcc) but have never tried it that way.

We used to do this will all our HDF5 plugins but then that means each
instance of an HDF5 plugin loads the WHOLE HDF5 library into memory
(that lib is pretty big) and is wasteful, so when we have HDF5 lib
support built in, we include a link to it from our 'lib' directory (I am
describing pre-2.0 behavior) and do the rpath thing.

Mark

On Sat, 2010-03-13 at 10:37, Olivier Cessenat wrote:
> Hello,
> 
> I'm using a database reader plug-in that uses a third party (dynamic)
> library (tp.so).
> I can install the third party lib at the same place as the plug-in,
> typically in a user directory - I do not necessarily have write access
> to VisIt's installation directory.
> When visit loads the plug-in, it complains that it cannot find the third
> party lib :
> <<
> Error opening plugin
> file: /home/cessenat/VISITTRUNK/src/plugins/databases/libMdonDatabase.so
> (libtp.so: cannot open shared object file: No such file or directory)
> >>
> This is rooted in the fact that the LD_LIBRARY_PATH is not set to the
> plugin directory, only to visit's third party libs directory.
> On Macos, the DYLD_LIBRARY_PATH in the legacylauncher is set to
> $ENV{HOME}/.visit/$archdir/plugins, but not to 
> $ENV{HOME}/.visit/$archdir/plugins/databases.
> 
> How can I make VisIt load the third-party lib that lies on the same
> directory as the used plug-in ? Can I do that in a client/server mode ?
> Thanks for the hints !
> 
> Sincerely,
> 
> Olivier Cessenat.
> 
> PS: probably an already asked question... sorry.
> 
> 
> 
> 
> 
> --
> List subscription information: https://*email.ornl.gov/mailman/listinfo/visit-users
> Searchable list archives: https://*email.ornl.gov/pipermail/visit-users
> VisIt Users Wiki: http://*visitusers.org/
> Frequently Asked Questions for VisIt: http://*visit.llnl.gov/FAQ.html
-- 
Mark C. Miller, Lawrence Livermore National Laboratory
================!!LLNL BUSINESS ONLY!!================
miller86 at llnl.gov      urgent: miller86 at pager.llnl.gov
T:8-6 (925)-423-5901     M/W/Th:7-12,2-7 (530)-753-851



More information about the visit-users mailing list