Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,17 @@ option(FLS_ENABLE_VERBOSE_OUTPUT "Enable verbose output" OFF)
option(FLS_ENABLE_DATA "Enable Data" OFF)
option(FLS_ENABLE_FSST_TESTING_AND_BENCHMARKING "Build FSST" OFF)
option(FLS_ENABLE_GALP_TESTING_AND_BENCHMARKING "Build GALP" OFF)
option(FLS_ENABLE_COMPATIABLE_CXX17_HEADER "Enable compatible with c++17 header, provides tcb_span for missing <span> and hh_data.h for enhanced chrono etc. Turn on if building FastLanes with std c++17 header" OFF)

# Definitions: ---------------------------------------------------------------------------------------------------------
add_compile_definitions(FLS_CMAKE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")

if (FLS_ENABLE_COMPATIABLE_CXX17_HEADER)
message("---------------------------------------------------------------------------------------------------------")
message("-- FLS: Enable COMPATIABLE_CXX17_HEADER.")
add_compile_definitions(COMPATIABLE_CXX17_HEADER=1)
endif ()

if (FLS_ENABLE_CLANG_TIDY)
message("---------------------------------------------------------------------------------------------------------")
message("-- FLS: Enabling CLANG-TIDY.")
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ help-main:
@echo " CRATE_ROOT=$(CRATE_ROOT)"
@echo " NUM_JOBS=$(NUM_JOBS)"
@echo " VERBOSE=$(VERBOSE)"
@echo " CMAKE_EXTRA_FLAGS=$(CMAKE_EXTRA_FLAGS)"
10 changes: 6 additions & 4 deletions mk/cpp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ CMAKE ?= cmake
CMAKE_FLAGS ?= \
-DCMAKE_INSTALL_PREFIX=$(PREFIX) \
-DCMAKE_BUILD_TYPE=Release \
-DFLS_ENABLE_VERBOSE_OUTPUT=ON
-DFLS_ENABLE_VERBOSE_OUTPUT=ON \
$(CMAKE_EXTRA_FLAGS)

# Build in parallel using all available jobs
CMAKE_BUILD ?= $(CMAKE) --build $(PROJECT_ROOT)/$(BUILD_DIR) --parallel $(NUM_JOBS)
Expand Down Expand Up @@ -53,17 +54,18 @@ clean-cpp:
configure-cpp-tests:
$(call echo_start,Configuring C++ tests in $(TEST_BUILD_DIR) [$(TEST_BUILD_TYPE)]…)
@mkdir -p "$(TEST_BUILD_DIR)"
@cd "$(TEST_BUILD_DIR)" && cmake \
@cd "$(TEST_BUILD_DIR)" && $(CMAKE) \
-DCMAKE_INSTALL_PREFIX="$(PREFIX)" \
-DCMAKE_BUILD_TYPE="$(TEST_BUILD_TYPE)" \
-DFLS_BUILD_TESTING=ON \
-DFLS_ENABLE_VERBOSE_OUTPUT=ON \
$(CMAKE_EXTRA_FLAGS) \
"$(REPO_ROOT)"
$(call echo_done,Test configuration complete.)

build-cpp-tests: configure-cpp-tests
$(call echo_start,Building C++ tests…)
@cmake --build "$(TEST_BUILD_DIR)" --parallel $(NUM_JOBS)
$(CMAKE) --build "$(TEST_BUILD_DIR)" --parallel $(NUM_JOBS)
$(call echo_done,C++ tests built.)

test-cpp: build-cpp-tests
Expand All @@ -72,4 +74,4 @@ test-cpp: build-cpp-tests
$(call echo_done,C++ tests complete.)

# Keep "test" as the common entrypoint
test: test-cpp
test: test-cpp
9 changes: 9 additions & 0 deletions src/alp/src/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ void encoder<PT, is_null>::encode(const PT* input_vector,
encode_simdized(input_vector, exceptions, exceptions_positions, encoded_integers, stt, null_map);
}

#ifdef COMPATIABLE_CXX17_HEADER
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpass-failed"
#endif

template <typename PT, bool IS_NULL>
void encoder<PT, IS_NULL>::encode_simdized(const PT* data_p,
PT* exceptions,
Expand Down Expand Up @@ -176,6 +181,10 @@ void encoder<PT, IS_NULL>::encode_simdized(const PT* data_p,
stt.n_exceptions = current_exceptions_count;
}

#ifdef COMPATIABLE_CXX17_HEADER
#pragma clang diagnostic pop
#endif

template <typename PT, bool is_null>
void encoder<PT, is_null>::init(const PT* rowgroup_data_p,
const uint64_t rowgroup_size,
Expand Down
4 changes: 4 additions & 0 deletions src/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ Status Connection::verify_fls(const path& file_path) {
}

if (constexpr auto versions = Info::get_all_versions();
#ifdef COMPATIABLE_CXX17_HEADER
!std::any_of(versions.begin(), versions.end(), [&](uint64_t v) { return file_header.version == v; })) {
#else
std::ranges::none_of(versions, [&](uint64_t v) { return file_header.version == v; })) {
#endif
return Status::Error(Status::ErrorCode::ERR_6_INVALID_VERSION_BYTES);
}

Expand Down
4 changes: 4 additions & 0 deletions src/expression/rpn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ bool is_1_to_1(const OperatorToken token) {
OperatorToken::EXP_FSST12_DICT_STR_U08,
};

#ifdef COMPATIABLE_CXX17_HEADER
return one_to_one_set.find(token) != one_to_one_set.end();
#else
return one_to_one_set.contains(token);
#endif
}

} // namespace fastlanes
2 changes: 1 addition & 1 deletion src/include/flatbuffers/stl_emulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

#if defined(FLATBUFFERS_USE_STD_SPAN)
#include <array>
#include <span>
#include "fls/std/span.hpp"
#else
// Disable non-trivial ctors if FLATBUFFERS_SPAN_MINIMAL defined.
#if !defined(FLATBUFFERS_TEMPLATES_ALIASES)
Expand Down
1 change: 1 addition & 0 deletions src/include/fls/cuda/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#ifndef FLS_CUDA_COMMON_HPP
#define FLS_CUDA_COMMON_HPP

#include <climits> // For CHAR_BIT
#include "fls/cfg/cfg.hpp"
#include "fls/common/alias.hpp"
#include "fls/cuda/config.hpp"
Expand Down
29 changes: 29 additions & 0 deletions src/include/fls/std/chrono.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// ────────────────────────────────────────────────────────
// | FastLanes |
// ────────────────────────────────────────────────────────
// src/include/fls/std/chrono.hpp
// ────────────────────────────────────────────────────────
#ifndef FLS_STD_CHRONO_HPP
#define FLS_STD_CHRONO_HPP

#ifdef COMPATIABLE_CXX17_HEADER
#include "fls/std/hh_date.hpp"
namespace std { namespace chrono {
using date::January;

using date::day;
using date::month;
using date::year;
using date::year_month_day;

using date::days;
using date::sys_days;
}} // namespace std::chrono
#else
#include <chrono>
#endif

namespace fastlanes {
} // namespace fastlanes

#endif // FLS_STD_CHRONO_HPP
Loading