duckdb_spatial
duckdb_spatial copied to clipboard
Build from source in Alpine Linux
CMake Error at build/release/_deps/spatial_extension_fc-src/CMakeLists.txt:55 (find_package):
Could not find a package configuration file provided by
"unofficial-sqlite3" with any of the following names:
unofficial-sqlite3Config.cmake
unofficial-sqlite3-config.cmake
Add the installation prefix of "unofficial-sqlite3" to CMAKE_PREFIX_PATH or
set "unofficial-sqlite3_DIR" to a directory containing one of the above
files. If "unofficial-sqlite3" provides a separate development package or
SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
make: *** [Makefile:339: release] Error 1
How can we get the unofficial sqlite3 package for building?
Hello! You need to setup VCPKG to pull in the required dependencies to build spatial. unofficial-sqlite3 is the name for the sqlite package in VCPKG.
Same problem on FreeBSD (and maybe elsewhere where vcpkg is not used).
I can pass configuration with this patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2853057..7b472ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,22 +46,21 @@ add_library(${EXTENSION_NAME} STATIC ${EXTENSION_SOURCES})
# annoyingly for expat on windows
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} MD.lib)
-set(ZLIB_USE_STATIC_LIBS ON)
+set(ZLIB_USE_STATIC_LIBS OFF)
set(OPENSSL_USE_STATIC_LIBS ON)
find_package(ZLIB REQUIRED)
find_package(PROJ CONFIG REQUIRED)
find_package(GDAL CONFIG REQUIRED)
find_package(EXPAT REQUIRED)
-find_package(unofficial-sqlite3 CONFIG REQUIRED)
+find_package(SQLite3 REQUIRED)
# Important: The link order matters, its the reverse order of dependency
-set(EXTENSION_DEPENDENCIES GDAL::GDAL PROJ::proj EXPAT::EXPAT
- unofficial::sqlite3::sqlite3 ZLIB::ZLIB)
+set(EXTENSION_DEPENDENCIES GDAL::GDAL PROJ::proj EXPAT::EXPAT ${SQLite3_LIBRARIES} ${ZLIB_LIBRARIES})
if(SPATIAL_USE_GEOS)
message(STATUS "Building with GEOS functionality")
find_package(GEOS REQUIRED)
- set(EXTENSION_DEPENDENCIES ${EXTENSION_DEPENDENCIES} GEOS::geos_c)
+ set(EXTENSION_DEPENDENCIES ${EXTENSION_DEPENDENCIES} GEOS::geos_c GEOS::geos)
add_definitions(-DSPATIAL_USE_GEOS=1)
endif()
cc @yurivict