-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move from bazel to cmake; fix fd leak in transaction
- Loading branch information
Showing
1,254 changed files
with
101,929 additions
and
4,895 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ bazel-* | |
.bazelrc | ||
|
||
test_temp/ | ||
build/ | ||
|
||
### Python | ||
# Byte-compiled / optimized / DLL files | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
cmake_minimum_required(VERSION 3.11) | ||
|
||
project(Kuzu VERSION 0.0.1 LANGUAGES CXX) | ||
|
||
find_package(Threads REQUIRED) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED True) | ||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
||
find_program(CCACHE_PROGRAM ccache) | ||
if (CCACHE_PROGRAM) | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") | ||
else () | ||
find_program(CCACHE_PROGRAM sccache) | ||
if (CCACHE_PROGRAM) | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") | ||
endif () | ||
endif () | ||
|
||
set(INSTALL_LIB_DIR | ||
lib | ||
CACHE PATH "Installation directory for libraries") | ||
set(INSTALL_BIN_DIR | ||
bin | ||
CACHE PATH "Installation directory for executables") | ||
set(INSTALL_INCLUDE_DIR | ||
include | ||
CACHE PATH "Installation directory for header files") | ||
set(INSTALL_CMAKE_DIR | ||
${DEF_INSTALL_CMAKE_DIR} | ||
CACHE PATH "Installation directory for CMake files") | ||
|
||
option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer." FALSE) | ||
option(ENABLE_THREAD_SANITIZER "Enable thread sanitizer." FALSE) | ||
option(ENABLE_UBSAN "Enable undefined behavior sanitizer." FALSE) | ||
if(${ENABLE_THREAD_SANITIZER}) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-common -fpermissive") | ||
endif() | ||
if(${ENABLE_ADDRESS_SANITIZER}) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common -fpermissive") | ||
endif() | ||
if(${ENABLE_UBSAN}) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-common -fpermissive") | ||
endif() | ||
|
||
function(link_threads LIBRARY) | ||
if (CMAKE_VERSION VERSION_LESS "3.1") | ||
target_link_libraries(${LIBRARY} pthread) | ||
else () | ||
target_link_libraries(${LIBRARY} Threads::Threads) | ||
endif () | ||
endfunction() | ||
|
||
function(add_kuzu_test TEST_NAME) | ||
set(SRCS ${ARGN}) | ||
add_executable(${TEST_NAME} ${SRCS}) | ||
target_link_libraries(${TEST_NAME} PRIVATE test_helper) | ||
target_include_directories(${TEST_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/test/include) | ||
include(GoogleTest) | ||
gtest_discover_tests(${TEST_NAME}) | ||
endfunction() | ||
|
||
add_definitions(-DKUZU_ROOT_DIRECTORY="${PROJECT_SOURCE_DIR}") | ||
|
||
include_directories(src/include) | ||
include_directories(third_party/antlr4_cypher/include) | ||
include_directories(third_party/antlr4_runtime/src) | ||
include_directories(third_party/spdlog) | ||
include_directories(third_party/nlohmann_json) | ||
include_directories(third_party/utf8proc/include) | ||
|
||
add_subdirectory(third_party) | ||
add_subdirectory(src) | ||
add_subdirectory(test) | ||
add_subdirectory(tools) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.PHONY: all release debug test clean | ||
|
||
all: release | ||
|
||
GENERATOR= | ||
FORCE_COLOR= | ||
NUM_THREADS= | ||
SANITIZER_FLAG= | ||
ROOT_DIR=$(PWD) | ||
|
||
ifndef $(NUM_THREADS) | ||
NUM_THREADS=1 | ||
endif | ||
|
||
ifeq ($(GEN),ninja) | ||
GENERATOR=-G "Ninja" | ||
FORCE_COLOR=-DFORCE_COLORED_OUTPUT=1 | ||
endif | ||
|
||
ifeq ($(ASAN), 1) | ||
SANITIZER_FLAG=-DENABLE_ADDRESS_SANITIZER=TRUE -DENABLE_THREAD_SANITIZER=FALSE -DENABLE_UBSAN=FALSE | ||
endif | ||
ifeq ($(TSAN), 1) | ||
SANITIZER_FLAG=-DENABLE_ADDRESS_SANITIZER=FALSE -DENABLE_THREAD_SANITIZER=TRUE -DENABLE_UBSAN=FALSE | ||
endif | ||
ifeq ($(UBSAN), 1) | ||
SANITIZER_FLAG=-DENABLE_ADDRESS_SANITIZER=FALSE -DENABLE_THREAD_SANITIZER=TRUE -DENABLE_UBSAN=TRUE | ||
endif | ||
|
||
release: | ||
mkdir -p build/release && \ | ||
cd build/release && \ | ||
cmake $(GENERATOR) $(FORCE_COLOR) $(SANITIZER_FLAG) -DCMAKE_BUILD_TYPE=Release ../.. && \ | ||
cmake --build . --config Release -- -j $(NUM_THREADS) | ||
|
||
debug: | ||
mkdir -p build/debug && \ | ||
cd build/debug && \ | ||
cmake $(GENERATOR) $(FORCE_COLOR) $(SANITIZER_FLAG) -DCMAKE_BUILD_TYPE=Debug ../.. && \ | ||
cmake --build . --config Debug -- -j $(NUM_THREADS) | ||
|
||
|
||
test: | ||
cd $(ROOT_DIR)/build/release/test && \ | ||
ctest && \ | ||
cd $(ROOT_DIR)/tools/python_api/test && \ | ||
pytest | ||
|
||
clean: | ||
rm -rf build |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
add_subdirectory(binder) | ||
add_subdirectory(catalog) | ||
add_subdirectory(common) | ||
add_subdirectory(expression_evaluator) | ||
add_subdirectory(function) | ||
add_subdirectory(main) | ||
add_subdirectory(parser) | ||
add_subdirectory(planner) | ||
add_subdirectory(processor) | ||
add_subdirectory(storage) | ||
add_subdirectory(transaction) | ||
|
||
add_library(kuzu STATIC ${ALL_OBJECT_FILES}) | ||
target_link_libraries(kuzu PUBLIC antlr4_cypher antlr4_runtime utf8proc Threads::Threads) | ||
target_include_directories( | ||
kuzu PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.