Hi, Ryan,

Yes, hashpipe is a framework that dynamically loads a user-supplied "plug-in" 
(aka shared library or shared object file).  These plug-ins provide the 
application specific functionality for the users pipeline.  Plug-ins are 
specified on the hashpipe command line via the `-p PLUGIN` option.  Upon 
parsing the `-p` option, hashpipe will `dlopen` the PLUGIN shared library.  
This will use the standard Linux dynamic linker/loader: `ld.so`.  The plug-ins 
can be located in any directory where `ld.so` will find them.  One complicating 
factor is that the `hashpipe` executable is owned by root and has the suid bit 
set.  This was done, for better or worse (probably worse), to simplify the 
usage of packet sockets which require elevated privileges to use.  There are 
better ways to do this and if there isn't already an issue for this on the 
hashpipe GitHub repo there probably should be.  Anyway, as `man ld.so` 
explains, that little detail means that the often used LD_LIBRARY_PATH variable 
is ignored when attempting to load dynamic objects.  One way around this is to 
specify the full path to the shared object instead of just the base name, so 
something like `-p /absolute/path/to/my/hashpipe/PLUGIN.so` instead of just `-p 
PLUGIN`.

I strongly advise not statically linking your app-specific code with the 
hashpipe framework.  It may be possible in theory, but it is really swimming 
against the current into unsupported waters.

HTH,
Dave

> On Nov 24, 2021, at 13:59, Ryan Lee <[email protected]> wrote:
> 
> Hi,Casperites
> 
> We have some general questions regarding the HASHPIPE program. We noticed 
> that in the Hashpipe demos, a fixed main program (/usr/local/bin/hashpipe)
> dynamically links application-specific functions from a .so in /usr/local/lib.
> Questions:
> 
> 1) Can the main program look for the .so in a non-system directory,
> e.g. the current directory?
> 
> 2) Can the main program be statically linked with the app-specific code?
> 
> Thanks,
> Ryan and Dave
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "[email protected]" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAL%3DWD3puL--hjfnR1FE1t5ZoYKD7qQ4v%2BNPU-1qwBd%2BMb9Ny1w%40mail.gmail.com
>  
> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAL%3DWD3puL--hjfnR1FE1t5ZoYKD7qQ4v%2BNPU-1qwBd%2BMb9Ny1w%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/60BC7E73-30BD-485A-BE37-B1366DF47BD7%40berkeley.edu.

Reply via email to