Open fmv1992 opened 8 years ago
attn: @cgohlke since you are the only one I know that understands Windows-related compile issues.
Well, this is Cygwin, which should behave like Linux. It seems that HAVE_ISNAN
is defined even though the Cygwin headers don't have a isnan
function. Probably better to install the GEOS library using the Cygwin package management and set the environment variable GEOS_DIR
. Or try to patch the platform header to use std::isnan
.
I could make it work: On the original file include/geos/platform.h I changed (starting on line 87):
#if defined(HAVE_ISNAN)
# define ISNAN(x) (isnan(x))
#else
# if defined(_MSC_VER)
# define ISNAN(x) _isnan(x)
# elif defined(__MINGW32__)
// sandro furieri: sanitizing MinGW32
# define ISNAN(x) (std::isnan(x))
# elif defined(__OSX__) || defined(__APPLE__)
// 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(__sun) || defined(__sun__)
# include <math.h>
# define ISNAN(x) (::isnan(x))
# endif
#endif
to
# define ISNAN(x) (std::isnan(x))
# include <math.h>
# include <cmath>
Should I submit this bug somewhere else to get it corrected for cygwin users?
Yeah, you should check in with the geos folks to figure out what the correct patch should be. I am thinking that there is something special about 64-bit cygwin that is not getting captured by this file. Let me know what the final patch is, and I'll include it here as well.
On Tue, Aug 23, 2016 at 8:36 AM, fmv1992 notifications@github.com wrote:
I could make it work: On the original file include/geos/platform.h I changed (starting on line 87):
if defined(HAVE_ISNAN)
define ISNAN(x) (isnan(x))
else
if defined(_MSC_VER)
define ISNAN(x) _isnan(x)
elif defined(MINGW32)
// sandro furieri: sanitizing MinGW32
define ISNAN(x) (std::isnan(x))
elif defined(OSX) || defined(APPLE)
// Hack for OS/X
incorrectly re-defining isnan() into oblivion. // It does leave a version in std. define ISNAN(x) (std::isnan(x))
elif defined(sun) || defined(__sun)
include
define ISNAN(x) (::isnan(x))
endif
endif
to
define ISNAN(x) (std::isnan(x))
include
include
Should I submit this bug somewhere else to get it corrected for cygwin users?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/314#issuecomment-241716415, or mute the thread https://github.com/notifications/unsubscribe-auth/AARy-KcegKC_gr9PUQxO-5ksLZ8Ys4z5ks5qiuk3gaJpZM4JqOCf .
Looks like this has been reported issue for GEOS https://trac.osgeo.org/geos/ticket/630
I wonder if it has actually be patched in the GEOS repository. The basemap supplied version of GEOS is a few releases behind current release.
When I replace the line in include/geos/platform.h
and re-run the make;
make install` command the platform.h file gets overwritten resulting in the same error message.
Ah! Don't replace those lines in the include/geos/platform.h
dir, but rather in the basemap install directory .../basemap-1.0.7/geos-3.3.3/include/geos
Most of my testing for #532 and #582 was done on Cygwin, so I suspect this issue has gone away, one way or another.
As a note: this kind of thing on Cygwin Python packages tends to be a result of
#include <math.h>
#include <Python.h>
rather than the other way around, because Python.h
sets a lot of visibility macros that need to be set before any system header is read to be effective. That is, math.h
might define isnan
, but only if _XOPEN_SOURCE
is set, which Python.h
does, but with the #include
order, that happens only after math.h
is done defining things.
Dear all,
after struggling with the installation of basemap I decided to post here. I have tried a couple of different 'hacks' found in google but none worked.
Full error:
I am installing it on cygwin 64 bits.
I have also tried to use cygwin's binaries but they give errors on a tested script.
I am not sure of any additional relevant information.
Best regards,