Skip to content

Commit

Permalink
add geos library as an optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wraymo committed Feb 5, 2025
1 parent a1b4ee7 commit ceb8bd5
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux-build-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
"-DVELOX_ENABLE_BENCHMARKS=ON"
"-DVELOX_ENABLE_EXAMPLES=ON"
"-DVELOX_ENABLE_ARROW=ON"
"-DVELOX_ENABLE_GEO=ON"
"-DVELOX_ENABLE_PARQUET=ON"
"-DVELOX_ENABLE_HDFS=ON"
"-DVELOX_ENABLE_S3=ON"
Expand Down
1 change: 1 addition & 0 deletions CMake/resolve_dependency_modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ by Velox. See details on bundling below.
| DuckDB (testing) | 0.8.1 | Yes |
| cpr (testing) | 1.10.15 | Yes |
| arrow | 15.0.0 | Yes |
| geos | 3.13.0 | Yes |

# Bundled Dependency Management
This module provides a dependency management system that allows us to automatically fetch and build dependencies from source if needed.
Expand Down
30 changes: 30 additions & 0 deletions CMake/resolve_dependency_modules/geos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include_guard(GLOBAL)

# GEOS Configuration
set(VELOX_GEOS_BUILD_VERSION 3.13.0)
set(VELOX_GEOS_BUILD_SHA256_CHECKSUM
47ec83ff334d672b9e4426695f15da6e6368244214971fabf386ff8ef6df39e4)
string(CONCAT VELOX_GEOS_SOURCE_URL "https://download.osgeo.org/geos/"
"geos-${VELOX_GEOS_BUILD_VERSION}.tar.bz2")

velox_resolve_dependency_url(GEOS)

FetchContent_Declare(
geos
URL ${VELOX_GEOS_SOURCE_URL}
URL_HASH ${VELOX_GEOS_BUILD_SHA256_CHECKSUM})
set(BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})
FetchContent_MakeAvailable(geos)
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ option(VELOX_ENABLE_ABFS "Build Abfs Connector" OFF)
option(VELOX_ENABLE_HDFS "Build Hdfs Connector" OFF)
option(VELOX_ENABLE_PARQUET "Enable Parquet support" ON)
option(VELOX_ENABLE_ARROW "Enable Arrow support" OFF)
option(VELOX_ENABLE_GEO "Enable Geospatial support" OFF)
option(VELOX_ENABLE_REMOTE_FUNCTIONS "Enable remote function support" OFF)
option(VELOX_ENABLE_CCACHE "Use ccache if installed." ON)

Expand Down Expand Up @@ -626,4 +627,9 @@ if(VELOX_ENABLE_ARROW)
velox_resolve_dependency(Arrow)
endif()

if(VELOX_ENABLE_GEO)
velox_set_source(geos)
velox_resolve_dependency(geos)
endif()

add_subdirectory(velox)
2 changes: 1 addition & 1 deletion scripts/setup-centos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function install_velox_deps_from_dnf {
dnf_install libevent-devel \
openssl-devel re2-devel libzstd-devel lz4-devel double-conversion-devel \
libdwarf-devel elfutils-libelf-devel curl-devel libicu-devel bison flex \
libsodium-devel zlib-devel
libsodium-devel zlib-devel geos-devel

# install sphinx for doc gen
pip install sphinx sphinx-tabs breathe sphinx_rtd_theme
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ NPROC=${BUILD_THREADS:-$(getconf _NPROCESSORS_ONLN)}
BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
VELOX_BUILD_SHARED=${VELOX_BUILD_SHARED:-"OFF"} #Build folly shared for use in libvelox.so.
DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)}
MACOS_VELOX_DEPS="bison flex gflags glog googletest icu4c libevent libsodium lz4 lzo openssl protobuf@21 snappy xz zstd"
MACOS_VELOX_DEPS="bison flex gflags glog googletest icu4c libevent libsodium lz4 lzo openssl geos protobuf@21 snappy xz zstd"
MACOS_BUILD_DEPS="ninja cmake"
FB_OS_VERSION="v2024.07.01.00"
FMT_VERSION="10.1.1"
Expand Down
1 change: 1 addition & 0 deletions scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function install_velox_deps_from_apt {
liblzo2-dev \
libelf-dev \
libdwarf-dev \
libgeos++-dev \
bison \
flex \
libfl-dev \
Expand Down

0 comments on commit ceb8bd5

Please sign in to comment.