[geos-devel] [GEOS] #983: Problem with 3.7 branch and shapely

GEOS geos-trac at osgeo.org
Mon Aug 12 04:52:52 PDT 2019


#983: Problem with 3.7 branch and shapely
------------------------+--------------------------
 Reporter:  aom         |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  Default     |    Version:  3.7.0
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 Hi,

 == problem

 Using the git 3.7 branch (which I guess provides the current 3.7.x
 distribution), the GEOSversion function returns:

 ``3.7.3-CAPI-1.11.3 3.7.2-6-ge1399c2``

 Which makes the shapely installation fails, as it expect a "%d.%d.%d blah
 %d.%d.%d" format and assert otherwise:
 {{{
 # pip install shapely --no-binary shapely
 Collecting shapely
   Using cached
 https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz
     Complete output from command python setup.py egg_info:
     Traceback (most recent call last):
       File "<string>", line 1, in <module>
       File "/tmp/pip-install-2spcnx3e/shapely/setup.py", line 80, in
 <module>
         from shapely._buildcfg import geos_version_string, geos_version, \
       File "/tmp/pip-install-2spcnx3e/shapely/shapely/_buildcfg.py", line
 248, in <module>
         geos_version_string, geos_version, geos_capi_version =
 _geos_version()
       File "/tmp/pip-install-2spcnx3e/shapely/shapely/_buildcfg.py", line
 242, in _geos_version
         assert len(res) == 2, res
     AssertionError: [('3', '7', '3'), ('1', '11', '3'), ('3', '7', '2')]
 }}}

 As a result, it is impossible to use that branch through the python
 biding.

 Although it could be considered an issue with the python bidings.

 == To reproduce

 {{{
 (moonflash) 170135 13:26:30 [root at gemini ~]# more src/geosversion.c
 #include <stdio.h>

 extern char const *GEOSversion();

 int main() {
   printf("Got %s\n", GEOSversion());
   return 0;
 }
 (moonflash) 170135 13:26:34 [root at gemini ~]# icc ./src/geosversion.c
 /trinity/shared/OCA/softs/geos-3.7-intel19/lib/libgeos_c.so.1.11.3
 /trinity/shared/OCA/softs/geos-3.7-intel19/lib/libgeos.so
 (moonflash) 170135 13:26:38 [root at gemini ~]# ./a.out
 Got 3.7.3-CAPI-1.11.3 3.7.2-6-ge1399c2
 (moonflash) 170135 13:26:40 [root at gemini ~]#
 }}}

 == Possible cause

 In that branch, the current definition of GEOSversion
 {{{
 const char* GEOSversion()
 {
   static char version[256];
   sprintf(version, "%s " GEOS_REVISION, GEOS_CAPI_VERSION);
   return version;
 }
 }}}

 And GEOS_REVISION contains more than the git revision:

 {{{
 [alainm at gemini build]$ more geos_revision.h
 #define GEOS_REVISION "3.7.2-6-ge1399c2"
 [alainm at gemini build]$ more geos_revision.h.in
 #define GEOS_REVISION "@GEOS_REVISION@"
 [alainm at gemini build]$ more geos_revision.h.in
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/geos/ticket/983>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list