[vtkusers] Help building Python wheels for VTK
taylor at braun-jones.org
Wed Aug 6 17:40:56 EDT 2014
I believe SimpleITK uses cmake to build their python wheels. Might be worth
checking out so you don't have to re-invent the *ahem* wheel :-)
On Wed, Aug 6, 2014 at 11:17 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Tue, Aug 5, 2014 at 6:59 PM, Matthew Brett <matthew.brett at gmail.com>
> > On Tue, Aug 05, 2014 at 04:25 PM, David Gobbi <david.gobbi at gmail.com>
> >> On Tue, Aug 5, 2014 at 5:02 PM, Matthew Brett <matthew.brett at gmail.com>
> >>> Yes, in principle it's possible to create a directory with the correct
> >>> structure, then pack it into a zip file. Did you have a chance to look
> >>> at the wheel file format? Basically someone (oh dear is that me?)
> >>> to move all the files that need installing into that directory tree in
> >>> the correct places, and record the manifest etc in the RECORD, WHEEL
> >>> METADATA sections, then zip it up with the right filename. Maybe if
> >>> could come up with a list we can see if we can get somewhere...
> >> I glanced at the two PEPs. CMake can be told where to put the python
> >> modules via the VTK_INSTALL_PYTHON_MODULE_DIR variable, but
> >> that by itself is probably not sufficient.
> > So the wheel usually consists of the package directory as it will be
> > copied into the Python installation - I guess VTK in your case, and then
> > a (say) VTK-<version>.data directory with files that need to be copied
> > elsewhere in the file system, and then the housekeeping stuff like the
> > manifest and so on. So, if VTK only installs file into the VTK Python
> > package directory, then that would be almost enough.
> The relevant parts of VTK install tree look like this (on OS X):
> Let me look at the wheel structure more closely, and I'll get back to you
> with some info on how CMake can be coerced to make the job easier.
> >> One tricky thing, of course, is that the python modules depend upon the
> >> VTK dylibs, and I'm not clear on how relocation is to be handled. Do
> >> wheel tools have the ability to change the loader path of shared
> >> Will the dylibs always be placed at a known location relative to the
> >> installed python .so files?
> > I wrote an OSX utility to copy / relocate dynamic libs for OSX called
> > delocate  - so we could at least handle OSX that way.
> >  https://pypi.python.org/pypi/delocate
> That could definitely be useful. CMake can also inject the path during
> the build process, if we end up with cmake building the wheel directly.
> - David
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> Please keep messages on-topic and check the VTK FAQ at:
> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers