[vtk-developers] Version number in library filenames

Brad King brad.king at kitware.com
Mon Apr 9 16:54:38 EDT 2012


On Mon, Apr 9, 2012 at 4:27 PM, Marcus D. Hanwell <marcus.hanwell at kitware.com> wrote:
> On Mon, Apr 9, 2012 at 4:20 PM, Brad King <brad.king at kitware.com> wrote:
>> Correct.  This allows installation into $prefix/lib so that someone with
>> LD_LIBRARY_PATH=$prefix/lib set can run without RPATHs.  Also the version
>> number belongs in the library name rather than the soname because VTK's
>> version numbers do not follow any dynamic loader conventions for ABI
>> compatibility.  Each major.minor version is its own distinct interface.

I forgot to mention that having the version in the library name is
necessary on Windows because there is no separate soname.

For those using CMake to build their application they only have to
write the imported target name (which has no version number at all)
anyway so it doesn't matter much what the file is called on disk.

> For Linux packaging this would just require that VTK bump the SO
> number every release, to indicate a break in the ABI.

IIRC the dynamic loaders on some platforms actually try to interpret
the version numbers and will honor a soname whose number is "compatible"
with that requested by the application even if it is not identical.  I
can't name one off the top of my head, but VTK's numbering scheme is
almost certainly not consistent with the definition of "compatible"
on such a platform.

> I think it would
> be helpful for packagers, who do not seem to be supporting multiple
> VTK versions with their package managers, to more closely follow
> standard practices.

I don't want upstream to prevent multiple library versions from being
installed in a single prefix.  If packagers decide to disable this
capability then that is their choice.

> We could introduce an advanced option to remove versioning from
> include directories, library names etc. It is clear that many
> packagers choose to do the same with Boost despite them following a
> similar pattern of adding version numbers to include paths etc.
>
> My $0.02 as a Gentoo packager/Arch user.

I have no problem with an option.  In fact for the install locations
packagers can already set cache entries like

   -DVTK_INSTALL_INCLUDE_DIR=include/vtk \
   -DVTK_INSTALL_PACKAGE_DIR=lib/cmake/vtk

for modular VTK.  We could add a switch to move the version from
the library name back to the soname.  That will still support multiple
*runtime* library package versions but allow only one *development*
package version.

-Brad



More information about the vtk-developers mailing list