[geos-devel] Fwd: [PATCH] Several fixes for building GEOS on Solaris with GCC

Paul Ramsey pramsey at cleverelephant.ca
Mon Mar 7 17:42:20 EST 2011



Begin forwarded message:

> From: Art Haas <ahaas at impactweather.com>
> Date: March 7, 2011 1:35:05 PM PST
> To: <geos-devel-owner at lists.osgeo.org>
> Subject: [PATCH] Several fixes for building GEOS on Solaris with GCC
> 
> 
> Hi.
> 
> My initial mail to <geos-devel at lists.osgeo.org> was rejected
> with a message to send to this address, so here's my second
> attempt in submitting these changes ...
> 
> The patches below fix several build problems I encountered
> while trying to build GEOS on Solaris 10 (x86) with my
> GCC-4.6 buids and 'cmake' for configuration:
> 
> platform.h.cmake - add definitions for ISNAN(x) and FINITE(x)
> platform.h.in - untested but similar patches
> TaggedLineString.h - prefix several 'size_t' uses with 'std::'
> valid/SimpleNestedRingTester.h - include <cstring> for 'NULL'
> 
> These patches allow the build to get about 20% complete before the
> build fails with this error:
> 
> /export/home/arth/src/geos/src/operation/overlay/OverlayNodeFactory.cpp:31:33: error: uninitialized const 'geos::operation::overlay::onf' [-fpermissive]
> /export/home/arth/src/geos/include/geos/operation/overlay/OverlayNodeFactory.h:47:16: note: 'const class geos::operation::overlay::OverlayNodeFactory' has no user-provided default constructor
> make[2]: *** [src/CMakeFiles/geos.dir/operation/overlay/OverlayNodeFactory.cpp.o] Error 1
> make[1]: *** [src/CMakeFiles/geos.dir/all] Error 2
> make: *** [all] Error 2
> 
> Building GEOS on a current Fedora 14 system and GCC-4.6 results
> in a similar error message; a build with the system GCC-4.5 compiler
> completes without problem and passes 'make check'.
> 
> I'll work on the constructor problem as time permits; possibly others
> could try to install GCC-4.6 development builds and see what other
> changes the new compiler will require.
> 
> Thanks for your work on GEOS.
> 
> Art Haas
> 
> Index: include/geos/platform.h.cmake
> ===================================================================
> --- include/geos/platform.h.cmake	(revision 3266)
> +++ include/geos/platform.h.cmake	(working copy)
> @@ -130,6 +130,8 @@
> # define ISNAN(x) __inline_isnand(static_cast<double>(x))
> #elif defined(HAVE_ISNAND_XCODE)
> # define ISNAN(x) __isnand(static_cast<double>(x))
> +#elif defined(__GNUC__) && (__GNUC__ > 3)
> +# define ISNAN(x) (__builtin_isnan(x))
> #elif defined(HAVE_ISNAN)
> # if defined(_MSC_VER)
> #  define ISNAN(x) _isnan(static_cast<double>(x))
> @@ -146,6 +148,8 @@
> # define FINITE(x) isfinite(x)
> #elif defined(HAVE_FINITE)
> # define FINITE(x) _finite(static_cast<double>(x))
> +#elif defined(__GNUC__) && (__GNUC__ > 3)
> +# define FINITE(x) (__builtin_isfinite(x))
> #else
> # error "Could not find finite or isfinite function or macro!"
> #endif
> Index: include/geos/platform.h.in
> ===================================================================
> --- include/geos/platform.h.in	(revision 3266)
> +++ include/geos/platform.h.in	(working copy)
> @@ -78,6 +78,8 @@
> #else
> # if defined(_MSC_VER)
> #  define FINITE(x) _finite(static_cast<double>(x))    
> +# elif defined(__GNUC__) && (__GNUC__ > 3)
> +#  define FINITE(x) (__builtin_isfinite(x))
> # else
> #  define FINITE(x) (isfinite(x))
> # endif
> @@ -95,6 +97,8 @@
>    // Hack for OS/X <cmath> incorrectly re-defining isnan() into oblivion.
>    // It does leave a version in std.
> #  define ISNAN(x) (std::isnan(x))
> +# elif defined(__GNUC__) && (__GNUC__ > 3)
> +#  define ISNAN(x) (__builtin_isnan(x))
> # endif
> #endif
> 
> Index: include/geos/simplify/TaggedLineString.h
> ===================================================================
> --- include/geos/simplify/TaggedLineString.h	(revision 3266)
> +++ include/geos/simplify/TaggedLineString.h	(working copy)
> @@ -71,11 +71,11 @@
> 	typedef std::auto_ptr<geom::CoordinateSequence> CoordSeqPtr;
> 
> 	TaggedLineString(const geom::LineString* nParentLine,
> -			size_t minimumSize=2);
> +                         std::size_t minimumSize=2);
> 
> 	~TaggedLineString();
> 
> -	size_t getMinimumSize() const;
> +        std::size_t getMinimumSize() const;
> 
> 	const geom::LineString* getParent() const;
> 
> @@ -83,7 +83,7 @@
> 
> 	CoordSeqPtr getResultCoordinates() const;
> 
> -	size_t getResultSize() const;
> +        std::size_t getResultSize() const;
> 
> 	TaggedLineSegment* getSegment(std::size_t);
> 
> @@ -109,7 +109,7 @@
> 	// TaggedLineSegments owned by this object
> 	std::vector<TaggedLineSegment*> resultSegs;
> 
> -	size_t minimumSize;
> +        std::size_t minimumSize;
> 
> 	void init();
> 
> Index: include/geos/operation/valid/SimpleNestedRingTester.h
> ===================================================================
> --- include/geos/operation/valid/SimpleNestedRingTester.h	(revision 3266)
> +++ include/geos/operation/valid/SimpleNestedRingTester.h	(working copy)
> @@ -22,7 +22,7 @@
> #define GEOS_OP_SIMPLENESTEDRINGTESTER_H
> 
> #include <geos/export.h>
> -
> +#include <cstring>
> #include <vector>
> 
> #ifdef _MSC_VER

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geos-devel/attachments/20110307/f1345429/attachment.html


More information about the geos-devel mailing list