Opened 7 years ago
Closed 7 years ago
#3795 closed defect (fixed)
Solaris build issues due to missing isfinite define
Reported by: | zesoup | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.3.4 |
Component: | postgis | Version: | 2.3.x |
Keywords: | solaris build | Cc: |
Description
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
In 15510: