[vtk-developers] VTK Python & BUILD_SHARED_LIBS=OFF

David Gobbi david.gobbi at gmail.com
Tue Sep 11 02:44:04 EDT 2018


Hi Utkarsh,

The following MR will address some of the issues:
https://gitlab.kitware.com/vtk/vtk/merge_requests/3075

Relevant changes the MR are:
1) The VTK Python extension modules are exported as targets.
2) When an extension module is imported, it imports the extension modules
that it depends on.

 - David


On Sun, 9 Sep 2018, 05:36 Utkarsh Ayachit, <utkarsh.ayachit at kitware.com>
wrote:

> Burlen,
>
> You're correct an all accounts. That's indeed an issue. I am not sure
> what's the best way: should we install the header and export the
> libraries, or create a new library/api that dependent projects can
> call to init the static Python modules or something even more
> creative. If we go the truly modular route, CMakeLoadAllPythonModules
> is an anathema. It inits all modules that VTK was built with and not
> the only the modules that the app depends on. Ideally, it'd be the
> latter. Not sure how we could do that. Ben/David, any ideas?
>
> Utkarsh
> On Sat, Sep 8, 2018 at 2:09 PM Burlen Loring <burlen.loring at gmail.com>
> wrote:
> >
> > Hi Folks,
> >
> > I'm using VTK in an embedded Python interpreter. In my case VTK is an
> external project dependency, and to configure my library I point to an
> externally  installed VTK.  Works great when I compile VTK with
> BUILD_SHARED_LIBS=ON, but with this set OFF I can't "import vtk". Some of
> the Python modules are not found. Since vtkpython works, I know there is a
> way. If I understand correctly I need to have the following before I
> initialize the interpreter.
> >
> > #include "vtkpythonmodules.h"
> >
> > CMakeLoadAllPythonModules();
> >
> > I'm stuck on the CMake code to locate the header and link dependencies.
> how do I locate the include directory of  vtkpythonmodules.h? the file is
> not installed, which seems to be a problem. Then also how can I access the
> list of link libraries needed? These seem to be stored in an internal
> variable, but are they exported to the install?
> >
> > Burlen
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Search the list archives at:
> http://markmail.org/search/?q=vtk-developers
> >
> > Follow this link to subscribe/unsubscribe:
> > https://public.kitware.com/mailman/listinfo/vtk-developers
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtk-developers/attachments/20180911/8b6d25d4/attachment.html>


More information about the vtk-developers mailing list