[postgis-tickets] [PostGIS] #3795: Solaris build issues due to missing isfinite define

PostGIS trac at osgeo.org
Tue Jul 25 06:37:13 PDT 2017


#3795: Solaris build issues due to missing isfinite define
---------------------------+---------------------------
 Reporter:  zesoup         |      Owner:  pramsey
     Type:  defect         |     Status:  new
 Priority:  medium         |  Milestone:  PostGIS 2.3.4
Component:  postgis        |    Version:  2.3.x
 Keywords:  solaris build  |
---------------------------+---------------------------
 Good day,

 PostGIS 2.3 (most likely all versions since 2015) does not properly build
 on SOLARIS.

 postgres=# create extension postgis;
 ERROR:  could not load library "/data/postgres/postgres-
 bin/9.6/lib/postgis-2.3.so": ld.so.1: postgres: fatal: relocation error:
 file postgis-2.3.so: symbol isfinite: referenced symbol not found

 This is due to an issue with isfinite. 2014 a fix was introduced that
 basically defines isfinite as finite. This fix is present in
 postgis/gserialized_gist_nd.c and gserialized_gist_2d.c.

 The patch 79cebf829c introduces a new file that needs this workaround but
 currently lacks it.


 {{{
 79cebf829c (Paul Ramsey       2015-06-01 16:15:29 +0000 1157)   if (
 isnan(selectivity) || ! isfinite(selectivity) || selectivity < 0.0 )
 }}}



 The attached trivial patch fixes this incompatibility for Solaris.


 {{{
 diff --git a/postgis/gserialized_estimate.c
 b/postgis/gserialized_estimate.c
 index 5768dbdae..ea343495b 100644
 --- a/postgis/gserialized_estimate.c
 +++ b/postgis/gserialized_estimate.c
 @@ -93,6 +93,16 @@ dimensionality cases. (2D geometry) &&& (3D column),
 etc.
  #include <errno.h>
  #include <ctype.h>

 +/* Fall back to older finite() if necessary */
 +#ifndef HAVE_ISFINITE
 +# ifdef HAVE_GNU_ISFINITE
 +#  define _GNU_SOURCE
 +# else
 +#  define isfinite finite
 +# endif
 +#endif
 +
 +
  /* Prototypes */
  Datum gserialized_gist_joinsel(PG_FUNCTION_ARGS);
  Datum gserialized_gist_joinsel_2d(PG_FUNCTION_ARGS);
 }}}

 regards
 Julian Schauder

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3795>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list