Skip to content

Commit 1660caa

Browse files
committed
add geos library as an optional dependency
1 parent a1b4ee7 commit 1660caa

File tree

7 files changed

+42
-2
lines changed

7 files changed

+42
-2
lines changed

.github/workflows/linux-build-base.yml

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
GTest_SOURCE: BUNDLED
4040
simdjson_SOURCE: BUNDLED
4141
xsimd_SOURCE: BUNDLED
42+
geos_SOURCE: BUNDLED
4243
CUDA_VERSION: "12.4"
4344
USE_CLANG: "${{ inputs.use-clang && 'true' || 'false' }}"
4445
steps:
@@ -88,6 +89,7 @@ jobs:
8889
"-DVELOX_ENABLE_BENCHMARKS=ON"
8990
"-DVELOX_ENABLE_EXAMPLES=ON"
9091
"-DVELOX_ENABLE_ARROW=ON"
92+
"-DVELOX_ENABLE_GEO=ON"
9193
"-DVELOX_ENABLE_PARQUET=ON"
9294
"-DVELOX_ENABLE_HDFS=ON"
9395
"-DVELOX_ENABLE_S3=ON"

CMake/resolve_dependency_modules/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ by Velox. See details on bundling below.
4141
| DuckDB (testing) | 0.8.1 | Yes |
4242
| cpr (testing) | 1.10.15 | Yes |
4343
| arrow | 15.0.0 | Yes |
44+
| geos | 3.13.0 | Yes |
4445

4546
# Bundled Dependency Management
4647
This module provides a dependency management system that allows us to automatically fetch and build dependencies from source if needed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
include_guard(GLOBAL)
15+
16+
# GEOS Configuration
17+
set(VELOX_GEOS_BUILD_VERSION 3.13.0)
18+
set(VELOX_GEOS_BUILD_SHA256_CHECKSUM
19+
47ec83ff334d672b9e4426695f15da6e6368244214971fabf386ff8ef6df39e4)
20+
string(CONCAT VELOX_GEOS_SOURCE_URL "https://download.osgeo.org/geos/"
21+
"geos-${VELOX_GEOS_BUILD_VERSION}.tar.bz2")
22+
23+
velox_resolve_dependency_url(GEOS)
24+
25+
FetchContent_Declare(
26+
geos
27+
URL ${VELOX_GEOS_SOURCE_URL}
28+
URL_HASH ${VELOX_GEOS_BUILD_SHA256_CHECKSUM})
29+
set(BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})
30+
FetchContent_MakeAvailable(geos)

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ option(VELOX_ENABLE_ABFS "Build Abfs Connector" OFF)
138138
option(VELOX_ENABLE_HDFS "Build Hdfs Connector" OFF)
139139
option(VELOX_ENABLE_PARQUET "Enable Parquet support" ON)
140140
option(VELOX_ENABLE_ARROW "Enable Arrow support" OFF)
141+
option(VELOX_ENABLE_GEO "Enable Geospatial support" OFF)
141142
option(VELOX_ENABLE_REMOTE_FUNCTIONS "Enable remote function support" OFF)
142143
option(VELOX_ENABLE_CCACHE "Use ccache if installed." ON)
143144

@@ -626,4 +627,9 @@ if(VELOX_ENABLE_ARROW)
626627
velox_resolve_dependency(Arrow)
627628
endif()
628629

630+
if(VELOX_ENABLE_GEO)
631+
velox_set_source(geos)
632+
velox_resolve_dependency(geos)
633+
endif()
634+
629635
add_subdirectory(velox)

scripts/setup-centos9.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function install_velox_deps_from_dnf {
7878
dnf_install libevent-devel \
7979
openssl-devel re2-devel libzstd-devel lz4-devel double-conversion-devel \
8080
libdwarf-devel elfutils-libelf-devel curl-devel libicu-devel bison flex \
81-
libsodium-devel zlib-devel
81+
libsodium-devel zlib-devel geos-devel-3.10.1
8282

8383
# install sphinx for doc gen
8484
pip install sphinx sphinx-tabs breathe sphinx_rtd_theme

scripts/setup-macos.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ NPROC=${BUILD_THREADS:-$(getconf _NPROCESSORS_ONLN)}
4141
BUILD_DUCKDB="${BUILD_DUCKDB:-true}"
4242
VELOX_BUILD_SHARED=${VELOX_BUILD_SHARED:-"OFF"} #Build folly shared for use in libvelox.so.
4343
DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)}
44-
MACOS_VELOX_DEPS="bison flex gflags glog googletest icu4c libevent libsodium lz4 lzo openssl protobuf@21 snappy xz zstd"
44+
MACOS_VELOX_DEPS="bison flex gflags glog googletest icu4c libevent libsodium lz4 lzo openssl geos protobuf@21 snappy xz zstd"
4545
MACOS_BUILD_DEPS="ninja cmake"
4646
FB_OS_VERSION="v2024.07.01.00"
4747
FMT_VERSION="10.1.1"

scripts/setup-ubuntu.sh

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ function install_velox_deps_from_apt {
145145
liblzo2-dev \
146146
libelf-dev \
147147
libdwarf-dev \
148+
libgeos++-dev \
148149
bison \
149150
flex \
150151
libfl-dev \

0 commit comments

Comments
 (0)