build(deps): bump rules_python from 2.2.0 to 2.3.1 in /src (#667)
Bumps rules_python from 2.2.0 to 2.3.1.
updated-dependencies:
- dependency-name: rules_python dependency-version: 2.3.1 dependency-type: direct:production update-type: version-update:semver-minor …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
S2 Geometry Library
Overview
This is a package for manipulating geometric shapes. Unlike many geometry libraries, S2 is primarily designed to work with spherical geometry, i.e., shapes drawn on a sphere rather than on a planar 2D map. This makes it especially suitable for working with geographic data.
If you want to learn more about the library, start by reading the overview and quick start document, then read the introduction to the basic types.
S2 documentation can be found on s2geometry.io.
API/ABI Stability
Note that all releases are version 0.x, so there are no API or ABI stability guarantees. Starting with 1.0 we will adhere to SemVer and follow the Google OSS breaking change policy
The Python API is particularly unstable, and it is planned that the SWIGged API will be replaced by a pybind11 version with more Pythonic names and more complete functionality.
Requirements for End Users using Bazel
Build
This bazel build requires Bazel 8 or newer. Builds were tested using C++20 as set in .bazelrc. This setup relies on abseil-cpp and googletest from the bazel central repository as set in MODULE.bazel.
To build and test using bazel, from within s2geometry/src, run:
bazel test "//:*"To build the libary without testing, from within s2geometry/src, run:
bazel build //:s2Status
All tests enumerated in the BUILD.bazel file pass on x86 machines. On Apple M1, s2loop_measures_test fails due to a 6% excess accumlated error. This issue may require revision of boringssl or exactfloat.
Requirements for End Users using CMake
20260526(standard library extensions). This exact version must be used.On Ubuntu, all of these other than abseil can be installed via apt-get:
abseil-cpp may need to be installed from source if an LTS release is not packaged for the platform. See the use of
-DCMAKE_PREFIX_PATHin the build instructions below.On macOS, use MacPorts or Homebrew. For MacPorts:
Build and Install
You may either download the source as a ZIP archive, or clone the git repository.
Via ZIP archive
Download ZIP file
Via
git cloneBuilding
First, install Abseil. It must be configured with
-DCMAKE_POSITION_INDEPENDENT_CODE=ON. s2geometry must be configured to use the same C++ version that abseil uses. The easiest way to achieve this is to pass-DCMAKE_CXX_STANDARD=17tocmakewhen compiling both abseil and s2geometry.From the appropriate directory depending on how you got the source:
On macOS,
sysctl -n hw.logicalcpuis the equivalent ofnproc.Disable building of shared libraries with
-DBUILD_SHARED_LIBS=OFF.Enable the python interface with
-DWITH_PYTHON=ON.For Testing
If BUILD_TESTS is ‘on’ (the default), then OpenSSL must be available to build some tests:
If OpenSSL is installed in a non-standard location set
OPENSSL_ROOT_DIRbefore running configure, for example on macOS:Installing
From
buildsubdirectory:Prefix it with
sudoif needed:NOTE: There is not
uninstalltarget butinstall_manifest.txtmay be helpful.All files will be installed at location specified in
CMAKE_INSTALL_PREFIXvariable.Several suffix variables used for some file groups:
CMAKE_INSTALL_INCLUDEDIRincludeCMAKE_INSTALL_BINDIRbin*.dllfiles onDLL-based platformsCMAKE_INSTALL_LIBDIRlib*.so,*.a,*.libetc)If needed set this variables on command line as
cmakearguments with-Dprefix or edit frombuildsubdirectory:For more info read: The CMake Cache.
Python
If you want the Python interface, you need to run cmake using
-DWITH_PYTHON=ON. You will also need to install the following dependencies:which can be installed via
or on macOS:
SWIG version 4.0 is required.
Python 3.10 is required.
Creating wheels
First, make a virtual environment and install
buildinto it:Then build the wheel:
The resulting wheel will be in the
distdirectory.Other S2 implementations
Disclaimer
This is not an official Google product.