Skip to content

Commit 3ddba7b

Browse files
authored
[Issue pixelsdb#542] reorganize the pixels c++ reader (pixelsdb#554)
1. Integrate protobuf into pixels c++. Don't need to install protobuf anymore! 2. Remove pixels-reader directory. Now cpp is the top directory of c++ code 3. Set a separate pixels-cxx.properties for pixels c++ reader
1 parent 6901032 commit 3ddba7b

File tree

139 files changed

+56
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+56
-60
lines changed

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "cpp/duckdb"]
2-
path = cpp/duckdb
2+
path = cpp/third_party/duckdb
33
url = https://github.com/yuly16/duckdb
4+
[submodule "cpp/third_party/protobuf"]
5+
path = cpp/third_party/protobuf
6+
url = https://github.com/protocolbuffers/protobuf

cpp/CMakeLists.txt

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
cmake_minimum_required(VERSION 2.8.12)
2-
1+
cmake_minimum_required(VERSION 3.16)
2+
set(CMAKE_CXX_STANDARD 14)
33
# Set extension name here
44
set(TARGET_NAME pixels)
55

@@ -13,13 +13,20 @@ set(EXTENSION_SOURCES
1313
)
1414
add_library(${EXTENSION_NAME} STATIC ${EXTENSION_SOURCES})
1515

16+
find_package(Protobuf REQUIRED)
17+
include_directories(${Protobuf_INCLUDE_DIRS})
18+
19+
include_directories(${CMAKE_CURRENT_BINARY_DIR})
20+
21+
add_subdirectory(pixels-common)
22+
add_subdirectory(pixels-core)
23+
add_subdirectory(tests)
1624

17-
include_directories(pixels-reader/pixels-common/include)
18-
include_directories(pixels-reader/pixels-core/include)
19-
include_directories(${CMAKE_CURRENT_BINARY_DIR}/pixels-reader)
20-
include_directories(${CMAKE_CURRENT_BINARY_DIR}/pixels-reader/pixels-common/liburing/src/include)
25+
include_directories(pixels-common/include)
26+
include_directories(pixels-core/include)
27+
include_directories(${CMAKE_CURRENT_BINARY_DIR})
28+
include_directories(${CMAKE_CURRENT_BINARY_DIR}/pixels-common/liburing/src/include)
2129

22-
add_subdirectory(pixels-reader)
2330

2431

2532
target_link_libraries(
@@ -32,7 +39,7 @@ set(PARAMETERS "-warnings")
3239
build_loadable_extension(${TARGET_NAME} ${PARAMETERS} ${EXTENSION_SOURCES})
3340

3441
install(
35-
TARGETS ${EXTENSION_NAME} pixels-core pixels-common
36-
EXPORT "${DUCKDB_EXPORT_SET}"
37-
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
38-
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}")
42+
TARGETS ${EXTENSION_NAME} pixels-core pixels-common
43+
EXPORT "${DUCKDB_EXPORT_SET}"
44+
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
45+
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}")

cpp/Makefile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all clean debug release pull update
1+
.PHONY: all clean debug release pull update deps
22

33
all: release
44

@@ -18,32 +18,41 @@ ifeq ($(GEN),ninja)
1818
FORCE_COLOR=-DFORCE_COLORED_OUTPUT=1
1919
endif
2020

21-
BUILD_FLAGS=-DEXTENSION_STATIC_BUILD=1 -DBUILD_TPCH_EXTENSION=1 -DBUILD_BENCHMARKS=1 -DBUILD_PARQUET_EXTENSION=1 ${OSX_BUILD_UNIVERSAL_FLAG} ${STATIC_LIBCPP}
21+
PROTOBUF_DIR=third_party/protobuf
22+
BUILD_FLAGS=-DEXTENSION_STATIC_BUILD=1 -DBUILD_TPCH_EXTENSION=1 -DBUILD_BENCHMARKS=1 -DBUILD_PARQUET_EXTENSION=1 \
23+
${OSX_BUILD_UNIVERSAL_FLAG} ${STATIC_LIBCPP}
2224

2325
CLIENT_FLAGS :=
2426

2527
# These flags will make DuckDB build the extension
26-
EXTENSION_FLAGS=-DDUCKDB_OOT_EXTENSION_NAMES="pixels" -DDUCKDB_OOT_EXTENSION_PIXELS_PATH="$(PROJ_DIR)" -DDUCKDB_OOT_EXTENSION_PIXELS_SHOULD_LINK="TRUE" -DDUCKDB_OOT_EXTENSION_PIXELS_INCLUDE_PATH="$(PROJ_DIR)include"
28+
EXTENSION_FLAGS=-DDUCKDB_OOT_EXTENSION_NAMES="pixels" -DDUCKDB_OOT_EXTENSION_PIXELS_PATH="$(PROJ_DIR)" \
29+
-DDUCKDB_OOT_EXTENSION_PIXELS_SHOULD_LINK="TRUE" -DDUCKDB_OOT_EXTENSION_PIXELS_INCLUDE_PATH="$(PROJ_DIR)include" \
30+
-DCMAKE_PREFIX_PATH=$(PROJ_DIR)third_party/protobuf/cmake/build
2731

2832
pull:
2933
git submodule init
30-
git submodule update --recursive --remote
34+
git submodule update --recursive --init
3135

3236
update:
3337
git submodule update --remote --merge
3438

39+
deps: pull
40+
mkdir -p "${PROTOBUF_DIR}/cmake/build" && cd "third_party/protobuf/cmake/build" && \
41+
cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../.. -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
42+
-Dprotobuf_BUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=./ && \
43+
make -j install
44+
3545
clean:
3646
rm -rf build
37-
rm -rf testext
38-
cd duckdb && make clean
47+
cd third_party/duckdb && make clean
3948

4049
# Main build
41-
debug:
50+
debug: deps
4251
mkdir -p build/debug && \
43-
cmake $(GENERATOR) $(FORCE_COLOR) $(EXTENSION_FLAGS) ${CLIENT_FLAGS} -DEXTENSION_STATIC_BUILD=1 -DCMAKE_BUILD_TYPE=Debug ${BUILD_FLAGS} -S ./duckdb/ -B build/debug && \
52+
cmake $(GENERATOR) $(FORCE_COLOR) $(EXTENSION_FLAGS) ${CLIENT_FLAGS} -DEXTENSION_STATIC_BUILD=1 -DCMAKE_BUILD_TYPE=Debug ${BUILD_FLAGS} -S third_party/duckdb/ -B build/debug && \
4453
cmake --build build/debug --config Debug
4554

46-
release:
55+
release: deps
4756
mkdir -p build/release && \
48-
cmake $(GENERATOR) $(FORCE_COLOR) $(EXTENSION_FLAGS) ${CLIENT_FLAGS} -DEXTENSION_STATIC_BUILD=1 -DCMAKE_BUILD_TYPE=Release ${BUILD_FLAGS} -S ./duckdb/ -B build/release && \
57+
cmake $(GENERATOR) $(FORCE_COLOR) $(EXTENSION_FLAGS) ${CLIENT_FLAGS} -DEXTENSION_STATIC_BUILD=1 -DCMAKE_BUILD_TYPE=Release ${BUILD_FLAGS} -S third_party/duckdb/ -B build/release && \
4958
cmake --build build/release --config Release

cpp/README.md

Lines changed: 7 additions & 17 deletions

cpp/duckdb

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

cpp/pixels-reader/pixels-common/include/exception/InvalidArgumentException.h renamed to cpp/pixels-common/include/exception/InvalidArgumentException.h

File renamed without changes.

cpp/pixels-reader/pixels-common/include/physical/BufferPool.h renamed to cpp/pixels-common/include/physical/BufferPool.h

File renamed without changes.

0 commit comments

Comments
 (0)