Skip to content

Commit

Permalink
GPKG: change default value of OGR_GPKG_ALLOW_THREADED_RTREE to NO on …
Browse files Browse the repository at this point in the history
…OSX Arm64
  • Loading branch information
rouault committed Apr 16, 2024
1 parent f1c2ab7 commit c945847
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2644,8 +2644,19 @@ void OGRGeoPackageTableLayer::SetDeferredSpatialIndexCreation(bool bFlag)
m_bAllowedRTreeThread =
m_poDS->GetLayerCount() == 0 && sqlite3_threadsafe() != 0 &&
CPLGetNumCPUs() >= 2 &&
CPLTestBool(
CPLGetConfigOption("OGR_GPKG_ALLOW_THREADED_RTREE", "YES"));
CPLTestBool(CPLGetConfigOption("OGR_GPKG_ALLOW_THREADED_RTREE",
// For a not yet understood reason, threaded RTree building
// (randomly?) fails on OSX Arm64. This may not be at all specific
// to that platform, but a more general problem, but it can't be
// reproduced elsewhere.
// Cf https://gis.stackexchange.com/questions/479958/how-to-fix-failed-to-prepare-sql-error-when-creating-gpkg-file-from-osm-extrac/479964#479964
// and random (frequent) failures on GDAL CI (https://github.com/OSGeo/gdal/commit/a83942422fd67471aee23ae11c5d06af27db2857)
#if defined(__arm64__) && defined(__APPLE__)
"NO"
#else
"YES"
#endif
));

// For unit tests
if (CPLTestBool(CPLGetConfigOption(
Expand Down

0 comments on commit c945847

Please sign in to comment.