Hi, I just started working with version 3.8.0, trying to build it on Windows. I ran into two issues:
1. Out of the box I can't build geos 3.8.0 with a fully-updated Visual Studio 2017, because geos wants cmake 3.13 and VS2017 only has 3.12. If I change line 22 of the top-level CMakeLists.txt to require only 3.12, then I can build fine in Release mode, either 32 or 64 bit, and ctest shows no failures. 2. If I build in Debug mode, with either VS2017 or VS2019, I get tons of assertion failures when I do ctest. They all come from line 115 of MonotoneChainBuilder.cpp, which on the last time through the loop causes an access of an element one past the end of a std::vector. Even if I ignore the assertion failures, the tests show as fails because the C runtime considers these to be fatal errors. Below is a patch that fixes these issues. Are these reasonable workarounds? Thanks! Asa Index: geos-3.8.0/CMakeLists.txt =================================================================== --- geos-3.8.0/CMakeLists.txt +++ geos-3.8.0/CMakeLists.tt @@ -19,7 +19,7 @@ # Require CMake 3.13+ with VS generator for complete support of VS versions # and support by AppVeyor. if(${CMAKE_GENERATOR} MATCHES "Visual Studio") - cmake_minimum_required(VERSION 3.13 FATAL_ERROR) + cmake_minimum_required(VERSION 3.12 FATAL_ERROR) endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") Index: geos-3.8.0/src/index/chain/MonotoneChainBuilder.cpp =================================================================== --- geos-3.8.0/src/index/chain/MonotoneChainBuilder.cpp +++ geos-3.8.0/src/index/chain/MonotoneChainBuilder.cpp @@ -111,8 +111,10 @@ } } ++last; - prev = curr; - curr = &pts[last]; + if (last < npts) { + prev = curr; + curr = &pts[last]; + } } #if GEOS_DEBUG std::cerr << "MonotoneChainBuilder::findChainEnd() returning" << std::endl; Asa Packer | Lead Systems Engineer BioSonics, Inc. 2356 W Commodore Way, Unit 110 Seattle WA 98199-1258 USA tel 206.782.2211 | biosonicsinc.com<http://www.biosonicsinc.com/>
_______________________________________________ geos-devel mailing list geos-devel@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/geos-devel