[Paraview] Library Linking

clinton at elemtech.com clinton at elemtech.com
Mon Nov 26 13:16:54 EST 2007


On Monday 26 November 2007 10:53:12 am jcremy at itv.rwth-aachen.de wrote:
> Hello ParaView Developers,
>
> I'm wondering how ParaView does the library linking.
> The binary is just ~75k, so it definitely doesn't use static linking. But
> all over the net it says that precompiled binaries in linux need static
> linked libraries (which results in a huge binary file). 

You don't *need* static linking to distribute binaries on Linux.

> I see that ParaView 
> comes with a bunch of libraries in the /lib folder. If I try this in my own
> project, it still doesn't work on other distributions. It seems as if the
> linker uses system libraries before the ones I supplied in my application
> directory. I took a look at the ParaView code but didn't see anything that
> helped my to understand. So, how did you solve this?

The paraview binary is just a wrapper that sets LD_LIBRARY_PATH to the lib 
folder.  So if there is a library on the system *and* in the paraview lib 
folder, the one in the paraview lib folder is used.
Some other projects use a shell script to set LD_LIBRARY_PATH then invoke the 
real executable.

You may also want to read up on LSB.
http://en.wikipedia.org/wiki/Linux_Standard_Base
If you use rpm/deb, you don't have to ship a copy of the system libraries for 
your application.

Clint


More information about the ParaView mailing list