Skip to content

Commit

Permalink
start to update
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jun 2, 2024
1 parent 03827c5 commit a50a2e7
Show file tree
Hide file tree
Showing 267 changed files with 18,689 additions and 10,921 deletions.
11 changes: 4 additions & 7 deletions data-raw/update-s2.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
library(tidyverse)

# download S2
source_url <- "https://github.com/google/s2geometry/archive/v0.9.0.zip"
source_url <- "https://github.com/google/s2geometry/archive/v0.11.1.zip"
curl::curl_download(source_url, "data-raw/s2-source.tar.gz")
unzip("data-raw/s2-source.tar.gz", exdir = "data-raw")

Expand All @@ -11,15 +11,13 @@ s2_dir <- list.files("data-raw", "^s2geometry-[0-9.]+", include.dirs = TRUE, ful
stopifnot(dir.exists(s2_dir), length(s2_dir) == 1)
src_dir <- file.path(s2_dir, "src/s2")

# headers live in inst/include
# keeping the directory structure means that
# we don't have to update any source files (beause of header locations)
# Process headers
headers <- tibble(
path = list.files(file.path(s2_dir, "src", "s2"), "\\.(h|inc)$", full.names = TRUE, recursive = TRUE),
final_path = str_replace(path, ".*?s2/", "inst/include/s2/")
final_path = str_replace(path, ".*?s2/", "src/s2/")
)

# Put S2 compilation units in src/s2/...
# Process compilation units
source_files <- tibble(
path = list.files(file.path(s2_dir, "src", "s2"), "\\.cc$", full.names = TRUE, recursive = TRUE),
final_path = str_replace(path, ".*?src/", "src/") %>%
Expand All @@ -29,7 +27,6 @@ source_files <- tibble(

# clean current headers and source files
unlink("src/s2", recursive = TRUE)
unlink("inst/include/s2", recursive = TRUE)

# create destination dirs
dest_dirs <- c(
Expand Down
34 changes: 19 additions & 15 deletions src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,6 @@ OBJECTS = $(ABSL_LIBS) \
s2-lnglat.o \
s2-matrix.o \
wk-impl.o \
s2geography/accessors.o \
s2geography/accessors-geog.o \
s2geography/linear-referencing.o \
s2geography/distance.o \
s2geography/build.o \
s2geography/coverings.o \
s2geography/geography.o \
s2geography/predicates.o \
s2/base/stringprintf.o \
s2/base/strtoint.o \
s2/encoded_s2cell_id_vector.o \
s2/encoded_s2point_vector.o \
s2/encoded_s2shape_index.o \
Expand All @@ -132,11 +122,14 @@ OBJECTS = $(ABSL_LIBS) \
s2/s1chord_angle.o \
s2/s1interval.o \
s2/s2boolean_operation.o \
s2/s2buffer_operation.o \
s2/s2builder_graph.o \
s2/s2builder.o \
s2/s2builderutil_closed_set_normalizer.o \
s2/s2builderutil_find_polygon_degeneracies.o \
s2/s2builderutil_get_snapped_winding_delta.o \
s2/s2builderutil_lax_polygon_layer.o \
s2/s2builderutil_lax_polyline_layer.o \
s2/s2builderutil_s2point_vector_layer.o \
s2/s2builderutil_s2polygon_layer.o \
s2/s2builderutil_s2polyline_layer.o \
Expand Down Expand Up @@ -165,6 +158,7 @@ OBJECTS = $(ABSL_LIBS) \
s2/s2edge_tessellator.o \
s2/s2error.o \
s2/s2furthest_edge_query.o \
s2/s2hausdorff_distance_query.o \
s2/s2latlng_rect_bounder.o \
s2/s2latlng_rect.o \
s2/s2latlng.o \
Expand All @@ -175,6 +169,7 @@ OBJECTS = $(ABSL_LIBS) \
s2/s2loop.o \
s2/s2max_distance_targets.o \
s2/s2measures.o \
s2/s2memory_tracker.o \
s2/s2metrics.o \
s2/s2min_distance_targets.o \
s2/s2padded_cell.o \
Expand All @@ -198,22 +193,31 @@ OBJECTS = $(ABSL_LIBS) \
s2/s2shape_index_measures.o \
s2/s2shape_index.o \
s2/s2shape_measures.o \
s2/s2shape_nesting_query.o \
s2/s2shapeutil_build_polygon_boundaries.o \
s2/s2shapeutil_coding.o \
s2/s2shapeutil_contains_brute_force.o \
s2/s2shapeutil_conversion.o \
s2/s2shapeutil_edge_iterator.o \
s2/s2shapeutil_get_reference_point.o \
s2/s2shapeutil_range_iterator.o \
s2/s2shapeutil_testing.o \
s2/s2shapeutil_visit_crossing_edge_pairs.o \
s2/s2testing.o \
s2/s2text_format.o \
s2/s2wedge_relations.o \
s2/strings/ostringstream.o \
s2/strings/serialize.o \
s2/s2winding_operation.o \
s2/thread_testing.o \
s2/util/bits/bit-interleave.o \
s2/util/bits/bits.o \
s2/util/coding/coder.o \
s2/util/coding/varint.o \
s2/util/math/exactfloat/exactfloat.o \
s2/util/math/mathutil.o \
s2/util/units/length-units.o
s2/util/units/length-units.o \
s2geography/accessors-geog.o \
s2geography/accessors.o \
s2geography/build.o \
s2geography/coverings.o \
s2geography/distance.o \
s2geography/geography.o \
s2geography/linear-referencing.o \
s2geography/predicates.o
16 changes: 10 additions & 6 deletions src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ S2LIBS = $(ABSL_LIBS) \
s2geography/coverings.o \
s2geography/geography.o \
s2geography/predicates.o \
s2/base/stringprintf.o \
s2/base/strtoint.o \
s2/encoded_s2cell_id_vector.o \
s2/encoded_s2point_vector.o \
s2/encoded_s2shape_index.o \
Expand All @@ -128,11 +126,14 @@ S2LIBS = $(ABSL_LIBS) \
s2/s1chord_angle.o \
s2/s1interval.o \
s2/s2boolean_operation.o \
s2/s2buffer_operation.o \
s2/s2builder_graph.o \
s2/s2builder.o \
s2/s2builderutil_closed_set_normalizer.o \
s2/s2builderutil_find_polygon_degeneracies.o \
s2/s2builderutil_get_snapped_winding_delta.o \
s2/s2builderutil_lax_polygon_layer.o \
s2/s2builderutil_lax_polyline_layer.o \
s2/s2builderutil_s2point_vector_layer.o \
s2/s2builderutil_s2polygon_layer.o \
s2/s2builderutil_s2polyline_layer.o \
Expand Down Expand Up @@ -161,6 +162,7 @@ S2LIBS = $(ABSL_LIBS) \
s2/s2edge_tessellator.o \
s2/s2error.o \
s2/s2furthest_edge_query.o \
s2/s2hausdorff_distance_query.o \
s2/s2latlng_rect_bounder.o \
s2/s2latlng_rect.o \
s2/s2latlng.o \
Expand All @@ -171,6 +173,7 @@ S2LIBS = $(ABSL_LIBS) \
s2/s2loop.o \
s2/s2max_distance_targets.o \
s2/s2measures.o \
s2/s2memory_tracker.o \
s2/s2metrics.o \
s2/s2min_distance_targets.o \
s2/s2padded_cell.o \
Expand All @@ -194,20 +197,21 @@ S2LIBS = $(ABSL_LIBS) \
s2/s2shape_index_measures.o \
s2/s2shape_index.o \
s2/s2shape_measures.o \
s2/s2shape_nesting_query.o \
s2/s2shapeutil_build_polygon_boundaries.o \
s2/s2shapeutil_coding.o \
s2/s2shapeutil_contains_brute_force.o \
s2/s2shapeutil_conversion.o \
s2/s2shapeutil_edge_iterator.o \
s2/s2shapeutil_get_reference_point.o \
s2/s2shapeutil_range_iterator.o \
s2/s2shapeutil_testing.o \
s2/s2shapeutil_visit_crossing_edge_pairs.o \
s2/s2testing.o \
s2/s2text_format.o \
s2/s2wedge_relations.o \
s2/strings/ostringstream.o \
s2/strings/serialize.o \
s2/s2winding_operation.o \
s2/thread_testing.o \
s2/util/bits/bit-interleave.o \
s2/util/bits/bits.o \
s2/util/coding/coder.o \
s2/util/coding/varint.o \
s2/util/math/exactfloat/exactfloat.o \
Expand Down
12 changes: 6 additions & 6 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1344,12 +1344,12 @@ BEGIN_RCPP
END_RCPP
}

RcppExport SEXP c_s2_geography_writer_new(SEXP, SEXP, SEXP, SEXP);
RcppExport SEXP c_s2_handle_geography(SEXP, SEXP);
RcppExport SEXP c_s2_handle_geography_tessellated(SEXP, SEXP);
RcppExport SEXP c_s2_projection_mercator(SEXP);
RcppExport SEXP c_s2_projection_orthographic(SEXP);
RcppExport SEXP c_s2_projection_plate_carree(SEXP);
RcppExport SEXP c_s2_geography_writer_new(void *, void *, void *, void *);
RcppExport SEXP c_s2_handle_geography(void *, void *);
RcppExport SEXP c_s2_handle_geography_tessellated(void *, void *);
RcppExport SEXP c_s2_projection_mercator(void *);
RcppExport SEXP c_s2_projection_orthographic(void *);
RcppExport SEXP c_s2_projection_plate_carree(void *);
RcppExport SEXP c_s2_trans_s2_lnglat_new(void);
RcppExport SEXP c_s2_trans_s2_point_new(void);

Expand Down
11 changes: 1 addition & 10 deletions src/s2/_fp_contract_off.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@
// appears before the first non-inline function definition. It is
// named with an underscore so that it is included first among the S2 headers.

// TODO(compiler-team): Figure out how to do this in a portable way.
#if defined(HAVE_ARMEABI_V7A)
// Some android builds use a buggy compiler that runs out of memory while
// parsing the pragma (--cpu=armeabi-v7a).

#elif defined(__ANDROID__)
// Other android builds use a buggy compiler that crashes with an internal
// error (Android NDK R9).

#elif defined(__clang__)
#if defined(__clang__)
// Clang supports the standard C++ pragma for turning off this optimization.
#pragma STDC FP_CONTRACT OFF

Expand Down
Loading

0 comments on commit a50a2e7

Please sign in to comment.