[vtk-developers] Dropping the "lib" prefix from VTK python modules

David Gobbi david.gobbi at gmail.com
Tue Dec 8 12:59:17 EST 2009


On Tue, Dec 8, 2009 at 10:36 AM, Mathieu Malaterre
<mathieu.malaterre at gmail.com> wrote:
> Hi David,
>
> On Tue, Dec 8, 2009 at 6:27 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>> Hi All,
>>
>> The "lib" prefix on python modules has always aggravated me a bit.  It
>> means that when I build my own local VTK classes, I always need to
>> have an "if os.name == 'posix':" conditional when I load them into my
>> python scripts.
>>
>> CMake can build the python modules without the prefix, it would be an
>> easy thing for me to change.  I could leave a flag in the
>> CMakeLists.txt so that people can add the prefix back if their code
>> depends on it.  Either that, or the flag could add soft links for
>> compatibility e.g. libvtkCommonPython.so -> vtkCommonPython.so with
>> internal "init" functions for both module names.
>>
>> Opinions?
>
> the only case I can think of, is when people create pseudo python/c++
> module/library. So the libBLAPython is actually the lib used to create
> executable (main function) and at the same time is the lib used when
> loaded in python.
>
> Removing the lib prefix might help user in the future understand this
> is a private library that can only be loaded from python.
>
> If you ever work on this, could please remove the SONAMing mechanism.
> I could never understand why python/java module used the unix
> mechanism, while python or java do not rely on them (ie. only provide
> a libBLAPython.so not the SOVersion'ed one libBLAPython.so.5.4).
>
> 2cts
> --
> Mathieu

Yes, the module/library issue is important.  I didn't know that anyone
used the python modules that way.  I've actually thought of doing that
myself, though, as a way of building a static VTK with dynamic python
modules, kind of like the way things were before the PythonD libraries
were introduced and the various VTK python modules linked to each
other.  Maybe soft links would make it possible to have things both
ways.

When I build VTK cvs, I don't see the SO versions on the python
modules.  Maybe someone has fixed that already?

   David



More information about the vtk-developers mailing list