[gdal-dev] Python Wheels for gdal

Sean Gillies sean at mapbox.com
Fri Jan 31 11:57:14 PST 2020


Hi Even,

On Fri, Jan 31, 2020 at 7:53 AM Even Rouault <even.rouault at spatialys.com>
wrote:

> On vendredi 31 janvier 2020 15:14:39 CET Mateusz Loskot wrote:
> > On Fri, 31 Jan 2020 at 10:58, Christoph Paulik <cpaulik at vandersat.com>
> wrote:
> > > My initial motivation was that I would like `pip install gdal` to just
> > > work.
> > I do share your view.
> > The pip install is always the canonical Pythonic way for me and
> > I'd be very happy myself to be able to install GDAL that way.
> >
> > > I guess that it is unrealistic to fix any of that, so let's get back on
> > > topic.
> > My point is that, IMO, such initiative is best to be run as a project
> > independent from GDAL development, outside GDAL repository,
> > for practical reasons.
>
> Except that if we wanted "pip install gdal" to include wheels, that should
> be
> done as part of the gdal Pyython package that is managed in swig/python of
> GDAL repository. Something outside should use another package name
>

Speaking of package name, "gdal" and "ogr" are modules of an "osgeo"
package. Maybe it should be "pip install osgeo"? Doesn't need to be, of
course, but it's nice when distribution and package names match.


> <brainstorming>
> Thinking about Sean's very valid point about wheels and symbol clashes
> when
> loading different version of the same library (or perhaps even the same
> version twice), I'm wondering if using symbol versioning, at least on
> Linux,
> wouldn't solve this. Imagine that you'd recompile GDAL and all its
> dependencies such that all exported symbols (functions & global
> variables),
> with some "gdal_wheel" marker, then those libraries would be effectively
> private to the Python package. I know that at some past point (GDAL 1.8 I
> think), Debian packaged GDAL with versionned symbols (from a distribution
> point of view, versionned symbols aren't necessarily that great from what
> I
> read, but for the use case we discuss here, that could perhaps be an
> option).
>
> Hopefully, there would be some existing tools to automate this. At linking
> time. Or perhaps as a post processing stage, messing directly with the ELF
> format.
>

There are existing tools. Multibuild uses https://github.com/pypa/auditwheel.
It says in the project README that the result is "like static linking", but
as I've found between rasterio and h5py wheels (which both have been
through auditwheel), it's not proof against conflicts.

https://github.com/matthew-brett/delocate is the OS X analog of auditwheel.


> I could imagine thought that symbol renaming/versionning wouldn't fly very
> well with dlopen()/dlsym() use that libraries could make. But I don't
> think
> this is extensive used in the GDAL use case. On top of my head, a few
> cases
> might be:
> * typically the old way GDAL loaded PROJ4. But no longer an issue with
> GDAL 3,
> or can be avoided with GDAL 2.x as well when building with --with-
> [static-]proj[4])
> * the OGDI library loading its plugin. But OGDI is sufficiently a odd
> beast
> that we don't need/want this in a general purpose wheel.
> </brainstorming>
>
> Even
>

Even though I'm not a user of GDAL's python bindings, it's clear that my
project is going to benefit from having your Linux expertise focussed on
the problem of getting GDAL and its dependencies to Python users, and I'm
grateful for that.

-- 
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200131/6a507588/attachment.html>


More information about the gdal-dev mailing list