From c0eab0ed1e97d2ce3dac491428e0ac89a17e946c Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:39:16 +0100 Subject: [PATCH 01/15] Follow nlohmann-json best practices for cmake --- CMakeLists.txt | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e2a41f3c4..2d40bd0625 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,19 +76,7 @@ FetchContent_Declare( ################################ # NLOHMANN JSON ################################ -FetchContent_Declare( - nlohmann-json - GIT_REPOSITORY https://github.com/nlohmann/json.git - GIT_TAG 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03 # release-3.11.3 -) -# We only want to include a single file from the nlohmann GitHub repository, so we initialize the submodule -# manually -FetchContent_GetProperties(nlohmann-json) -if (NOT nlohmann-json_POPULATED) - FetchContent_Populate(nlohmann-json) - include_directories(SYSTEM ${nlohmann-json_SOURCE_DIR}/single_include) -endif () - +FetchContent_Declare(nlohmann-json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz) ############################### # ANTLR CPP RUNTIME FOR THE SPARQL PARSER @@ -184,7 +172,7 @@ find_package(OpenSSL REQUIRED) function(qlever_target_link_libraries target) target_link_libraries(${target} ${ARGN} absl::flat_hash_map absl::flat_hash_set absl::strings absl::str_format ICU::uc - ICU::i18n OpenSSL::SSL OpenSSL::Crypto GTest::gtest GTest::gmock stxxl fsst) + ICU::i18n OpenSSL::SSL OpenSSL::Crypto GTest::gtest GTest::gmock stxxl fsst nlohmann_json::nlohmann_json) # memorySize is a utility library for defining memory sizes. if (NOT ${target} STREQUAL "memorySize") @@ -338,7 +326,7 @@ FetchContent_Declare( ################################ # Apply FetchContent ################################ -FetchContent_MakeAvailable(googletest ctre abseil re2 stxxl fsst s2) +FetchContent_MakeAvailable(googletest ctre abseil re2 stxxl fsst s2 nlohmann-json) # Disable some warnings in RE2, STXXL, and GTEST target_compile_options(s2 PRIVATE -Wno-sign-compare -Wno-unused-parameter -Wno-class-memaccess -Wno-comment -Wno-redundant-move -Wno-unknown-warning-option -Wno-maybe-uninitialized -Wno-class-memaccess) target_compile_options(re2 PRIVATE -Wno-unused-parameter) From d459b340ab4956fad0ee801bd914aeba1ea2e7d0 Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 02:57:39 +0100 Subject: [PATCH 02/15] Simplify cmake configuration for antlr --- CMakeLists.txt | 20 +++++--------------- src/parser/sparqlParser/CMakeLists.txt | 1 + 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d40bd0625..90646b1e6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,26 +81,14 @@ FetchContent_Declare(nlohmann-json URL https://github.com/nlohmann/json/releases ############################### # ANTLR CPP RUNTIME FOR THE SPARQL PARSER ############################### +set(ANTLR_BUILD_CPP_TESTS OFF CACHE BOOL "don't try to build googletest twice") FetchContent_Declare( antlr GIT_REPOSITORY https://github.com/antlr/antlr4.git GIT_TAG 9239e6ff444420516b44b7621e8dc7691fcf0e16 + SOURCE_SUBDIR runtime/Cpp ) -# From ANTLR we actually don't want the toplevel directory (which doesn't -# have a proper `CMakeLists.txt` anyway), but only the C++ runtime which -# resides in a subdirectory. We additionally need to suppress some warnings -# only for ANTLR. We therefore have to perform the initialization for -# ANTLR using `FetchContent` manually. -FetchContent_GetProperties(antlr) -if (NOT antlr_POPULATED) - FetchContent_Populate(antlr) - set(ANTLR_BUILD_CPP_TESTS OFF CACHE BOOL "don't try to build googletest twice") - add_subdirectory(${antlr_SOURCE_DIR}/runtime/Cpp EXCLUDE_FROM_ALL) - target_compile_options(antlr4_static PRIVATE -Wno-all -Wno-extra -Wno-unqualified-std-cast-call -Wno-error -Wno-deprecated-declarations) - include_directories(SYSTEM ${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src) -endif () - ################################ # Threading ################################ @@ -326,7 +314,7 @@ FetchContent_Declare( ################################ # Apply FetchContent ################################ -FetchContent_MakeAvailable(googletest ctre abseil re2 stxxl fsst s2 nlohmann-json) +FetchContent_MakeAvailable(googletest ctre abseil re2 stxxl fsst s2 nlohmann-json antlr) # Disable some warnings in RE2, STXXL, and GTEST target_compile_options(s2 PRIVATE -Wno-sign-compare -Wno-unused-parameter -Wno-class-memaccess -Wno-comment -Wno-redundant-move -Wno-unknown-warning-option -Wno-maybe-uninitialized -Wno-class-memaccess) target_compile_options(re2 PRIVATE -Wno-unused-parameter) @@ -338,6 +326,8 @@ include_directories(${ctre_SOURCE_DIR}/single-header) target_compile_options(fsst PRIVATE -Wno-extra -Wno-all -Wno-error) target_compile_options(fsst12 PRIVATE -Wno-extra -Wno-all -Wno-error) include_directories(${fsst_SOURCE_DIR}) +target_compile_options(antlr4_static PRIVATE -Wno-all -Wno-extra -Wno-unqualified-std-cast-call -Wno-error -Wno-deprecated-declarations) +include_directories(SYSTEM "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src") message(STATUS ---) message(STATUS "CXX_FLAGS are : " ${CMAKE_CXX_FLAGS}) diff --git a/src/parser/sparqlParser/CMakeLists.txt b/src/parser/sparqlParser/CMakeLists.txt index 3ba1f47429..608283af60 100644 --- a/src/parser/sparqlParser/CMakeLists.txt +++ b/src/parser/sparqlParser/CMakeLists.txt @@ -5,6 +5,7 @@ add_library(sparqlParser SparqlQleverVisitor.h generated/SparqlAutomaticParser.h generated/SparqlAutomaticParser.cpp generated/SparqlAutomaticVisitor.h generated/SparqlAutomaticVisitor.cpp) qlever_target_link_libraries(sparqlParser antlr4_static sparqlExpressions rdfEscaping util) +target_precompile_headers(sparqlParser PRIVATE "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src/antlr4-runtime.h") # Silence warnings in files that are auto-generated by ANTLR. # TODO Submit a pull request to ANTLR to fix those warnings. target_compile_options(sparqlParser PRIVATE -Wno-logical-op-parentheses -Wno-parentheses) From b4240967ea0b2b00adb0cb59b3c2df1af4b4682e Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 02:58:04 +0100 Subject: [PATCH 03/15] Optimize header structure --- src/parser/sparqlParser/DatasetClause.h | 16 ++++++++++++++++ src/parser/sparqlParser/SparqlQleverVisitor.h | 10 +--------- src/util/http/UrlParser.h | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 src/parser/sparqlParser/DatasetClause.h diff --git a/src/parser/sparqlParser/DatasetClause.h b/src/parser/sparqlParser/DatasetClause.h new file mode 100644 index 0000000000..37d3c978de --- /dev/null +++ b/src/parser/sparqlParser/DatasetClause.h @@ -0,0 +1,16 @@ +// Copyright 2024, University of Freiburg, +// Chair of Algorithms and Data Structures. +// Author: Robin Textor-Falconi + +#pragma once + +#include "parser/TripleComponent.h" + +// A named or default graph +struct DatasetClause { + TripleComponent::Iri dataset_; + bool isNamed_; + + // For testing + bool operator==(const DatasetClause& other) const = default; +}; diff --git a/src/parser/sparqlParser/SparqlQleverVisitor.h b/src/parser/sparqlParser/SparqlQleverVisitor.h index 724fa531e3..e22b3f4e86 100644 --- a/src/parser/sparqlParser/SparqlQleverVisitor.h +++ b/src/parser/sparqlParser/SparqlQleverVisitor.h @@ -12,6 +12,7 @@ #include "engine/sparqlExpressions/NaryExpression.h" #include "engine/sparqlExpressions/StdevExpression.h" #include "parser/data/GraphRef.h" +#include "parser/sparqlParser/DatasetClause.h" #undef EOF #include "parser/sparqlParser/generated/SparqlAutomaticVisitor.h" #define EOF std::char_traits::eof() @@ -28,15 +29,6 @@ class Reversed { auto end() { return _iterable.rend(); } }; -// A named or default graph -struct DatasetClause { - TripleComponent::Iri dataset_; - bool isNamed_; - - // For testing - bool operator==(const DatasetClause& other) const = default; -}; - /** * This is a visitor that takes the parse tree from ANTLR and transforms it into * a `ParsedQuery`. diff --git a/src/util/http/UrlParser.h b/src/util/http/UrlParser.h index bc1374504f..33ebc86b1d 100644 --- a/src/util/http/UrlParser.h +++ b/src/util/http/UrlParser.h @@ -11,7 +11,7 @@ #include #include -#include "parser/sparqlParser/SparqlQleverVisitor.h" +#include "parser/sparqlParser/DatasetClause.h" #include "util/HashMap.h" /** From f0013e3e1bb2e69438c7c1f3bca55d13297d5d9e Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 03:04:08 +0100 Subject: [PATCH 04/15] Add precompiled antlr headers where it makes sense. --- src/util/ConfigManager/CMakeLists.txt | 1 + src/util/http/HttpParser/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/util/ConfigManager/CMakeLists.txt b/src/util/ConfigManager/CMakeLists.txt index 5ef4c9d541..15e673f9d0 100644 --- a/src/util/ConfigManager/CMakeLists.txt +++ b/src/util/ConfigManager/CMakeLists.txt @@ -2,3 +2,4 @@ add_library(configManager ConfigManager.cpp ConfigOption.cpp generated/ConfigShorthandLexer.cpp generated/ConfigShorthandParser.cpp ConfigShorthandVisitor.cpp ConfigUtil.cpp ConfigExceptions.cpp Validator.cpp) qlever_target_link_libraries(configManager antlr4_static util) +target_precompile_headers(configManager PRIVATE "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src/antlr4-runtime.h") diff --git a/src/util/http/HttpParser/CMakeLists.txt b/src/util/http/HttpParser/CMakeLists.txt index 794322bd58..6efbc60c9a 100644 --- a/src/util/http/HttpParser/CMakeLists.txt +++ b/src/util/http/HttpParser/CMakeLists.txt @@ -5,3 +5,4 @@ add_library(httpParser AcceptHeaderQleverVisitor.h AcceptHeaderQleverVisitor.cpp generated/AcceptHeaderParser.h generated/AcceptHeaderParser.cpp generated/AcceptHeaderVisitor.h generated/AcceptHeaderVisitor.cpp) qlever_target_link_libraries(httpParser antlr4_static util) +target_precompile_headers(httpParser PRIVATE "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src/antlr4-runtime.h") From b7ad6143c57bd75817a51eefe720251e8f9937c3 Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 03:17:55 +0100 Subject: [PATCH 05/15] Specify hash and add clarifying comment --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90646b1e6a..bf4c3ad475 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,13 @@ FetchContent_Declare( ################################ # NLOHMANN JSON ################################ -FetchContent_Declare(nlohmann-json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz) +# Use URL to avoid downloading large repository as recommended here: +# https://json.nlohmann.me/integration/cmake/#fetchcontent +FetchContent_Declare( + nlohmann-json + URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz + URL_HASH SHA3_224=b9237e8e8242e915de5be631aa944369c38a377c5e79aa505ba741a9 +) ############################### # ANTLR CPP RUNTIME FOR THE SPARQL PARSER From 6b4040713bc993775ea441a7704481203b3fb87d Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 03:43:05 +0100 Subject: [PATCH 06/15] Try different approach to suppress warnings --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf4c3ad475..65cd5a108d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,7 +332,7 @@ include_directories(${ctre_SOURCE_DIR}/single-header) target_compile_options(fsst PRIVATE -Wno-extra -Wno-all -Wno-error) target_compile_options(fsst12 PRIVATE -Wno-extra -Wno-all -Wno-error) include_directories(${fsst_SOURCE_DIR}) -target_compile_options(antlr4_static PRIVATE -Wno-all -Wno-extra -Wno-unqualified-std-cast-call -Wno-error -Wno-deprecated-declarations) +set_target_properties(antlr4_static PROPERTIES COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags} -Wno-all -Wno-extra -Wno-unqualified-std-cast-call -Wno-error -Wno-deprecated-declarations") include_directories(SYSTEM "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src") message(STATUS ---) From 7a425637d4726b3f3444a41c71a9f21223b6d81c Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 03:55:48 +0100 Subject: [PATCH 07/15] Avoid building shared antlr library --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65cd5a108d..a843b1cd42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,7 @@ FetchContent_Declare( # ANTLR CPP RUNTIME FOR THE SPARQL PARSER ############################### set(ANTLR_BUILD_CPP_TESTS OFF CACHE BOOL "don't try to build googletest twice") +set(ANTLR_BUILD_SHARED OFF CACHE BOOL "We're only interested in the static library") FetchContent_Declare( antlr GIT_REPOSITORY https://github.com/antlr/antlr4.git @@ -332,7 +333,7 @@ include_directories(${ctre_SOURCE_DIR}/single-header) target_compile_options(fsst PRIVATE -Wno-extra -Wno-all -Wno-error) target_compile_options(fsst12 PRIVATE -Wno-extra -Wno-all -Wno-error) include_directories(${fsst_SOURCE_DIR}) -set_target_properties(antlr4_static PROPERTIES COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags} -Wno-all -Wno-extra -Wno-unqualified-std-cast-call -Wno-error -Wno-deprecated-declarations") +target_compile_options(antlr4_static PRIVATE -Wno-all -Wno-extra -Wno-unqualified-std-cast-call -Wno-error -Wno-deprecated-declarations) include_directories(SYSTEM "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src") message(STATUS ---) From b3f19045be0442d81eb597fe5a035d4e686bd7d6 Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 04:31:08 +0100 Subject: [PATCH 08/15] Bump ANTLR version so flag has effect --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a843b1cd42..89464d77da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,7 +92,7 @@ set(ANTLR_BUILD_SHARED OFF CACHE BOOL "We're only interested in the static libra FetchContent_Declare( antlr GIT_REPOSITORY https://github.com/antlr/antlr4.git - GIT_TAG 9239e6ff444420516b44b7621e8dc7691fcf0e16 + GIT_TAG cc82115a4e7f53d71d9d905caa2c2dfa4da58899 # 4.13.12 SOURCE_SUBDIR runtime/Cpp ) From 223406f9e62dfe96b861fa6983442c57e9157adb Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 04:37:51 +0100 Subject: [PATCH 09/15] Remove fixed warning suppression --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89464d77da..10c9a0b1ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -333,7 +333,7 @@ include_directories(${ctre_SOURCE_DIR}/single-header) target_compile_options(fsst PRIVATE -Wno-extra -Wno-all -Wno-error) target_compile_options(fsst12 PRIVATE -Wno-extra -Wno-all -Wno-error) include_directories(${fsst_SOURCE_DIR}) -target_compile_options(antlr4_static PRIVATE -Wno-all -Wno-extra -Wno-unqualified-std-cast-call -Wno-error -Wno-deprecated-declarations) +target_compile_options(antlr4_static PRIVATE -Wno-all -Wno-extra -Wno-error -Wno-deprecated-declarations) include_directories(SYSTEM "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src") message(STATUS ---) From 8533ed2fa3546e621c70aa8c726ac4a71fd3a6bc Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 04:41:08 +0100 Subject: [PATCH 10/15] Add clarifying comment --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10c9a0b1ec..c12ba535cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -334,6 +334,7 @@ target_compile_options(fsst PRIVATE -Wno-extra -Wno-all -Wno-error) target_compile_options(fsst12 PRIVATE -Wno-extra -Wno-all -Wno-error) include_directories(${fsst_SOURCE_DIR}) target_compile_options(antlr4_static PRIVATE -Wno-all -Wno-extra -Wno-error -Wno-deprecated-declarations) +# Only required because a lot of classes that do not explicitly link against antlr4_static use the headers. include_directories(SYSTEM "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src") message(STATUS ---) From 2123f904a51c5ab8205e0df5624e517e1ee5cb61 Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 05:05:49 +0100 Subject: [PATCH 11/15] Properly undefine EOF --- src/util/ConfigManager/ConfigShorthandVisitor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/ConfigManager/ConfigShorthandVisitor.h b/src/util/ConfigManager/ConfigShorthandVisitor.h index 31fa5b82b5..279031182f 100644 --- a/src/util/ConfigManager/ConfigShorthandVisitor.h +++ b/src/util/ConfigManager/ConfigShorthandVisitor.h @@ -3,6 +3,8 @@ // Author: Andre Schlegel (March of 2023, schlegea@informatik.uni-freiburg.de) #pragma once +// ANTLR runtime uses this as a variable name. +#undef EOF #include #include "util/ConfigManager/generated/ConfigShorthandParser.h" From a6e04c6c736143c3195d579fbbea2b6c17ae2167 Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 05:16:24 +0100 Subject: [PATCH 12/15] Drop precompiled header again due to complications --- src/util/ConfigManager/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/util/ConfigManager/CMakeLists.txt b/src/util/ConfigManager/CMakeLists.txt index 15e673f9d0..5ef4c9d541 100644 --- a/src/util/ConfigManager/CMakeLists.txt +++ b/src/util/ConfigManager/CMakeLists.txt @@ -2,4 +2,3 @@ add_library(configManager ConfigManager.cpp ConfigOption.cpp generated/ConfigShorthandLexer.cpp generated/ConfigShorthandParser.cpp ConfigShorthandVisitor.cpp ConfigUtil.cpp ConfigExceptions.cpp Validator.cpp) qlever_target_link_libraries(configManager antlr4_static util) -target_precompile_headers(configManager PRIVATE "${antlr_SOURCE_DIR}/runtime/Cpp/runtime/src/antlr4-runtime.h") From 8894d91dbabaa2dac946c0434de14bd78600d7e1 Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 12:13:57 +0100 Subject: [PATCH 13/15] Address PR comments --- .github/workflows/macos.yml | 6 +++--- CMakeLists.txt | 4 ++-- src/util/ConfigManager/ConfigShorthandVisitor.h | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 5c4ea14f85..dc6058bab0 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -38,7 +38,7 @@ jobs: pip3 install pyaml pyicu - name: Install dependencies - run: | + run: | brew install llvm@16 brew install conan@2 echo 'export PATH="/usr/local/opt/llvm@16/bin:$PATH"' >> ~/.bash_profile @@ -66,10 +66,10 @@ jobs: conan install .. -pr:b=../conanprofiles/clang-16-macos -pr:h=../conanprofiles/clang-16-macos -of=. --build=missing; - name: Configure CMake # For std::ranges::join_view we need the -fexperimental-library flag on libc++16, which on Mac requires to manually tinker with the linking flags. - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.build-type}} -DCMAKE_TOOLCHAIN_FILE="$(pwd)/build/conan_toolchain.cmake" -DUSE_PARALLEL=true -DRUN_EXPENSIVE_TESTS=false -DENABLE_EXPENSIVE_CHECKS=true -DCMAKE_CXX_COMPILER=clang++ -DADDITIONAL_COMPILER_FLAGS="-fexperimental-library" -D_NO_TIMING_TESTS=ON -DADDITIONAL_LINKER_FLAGS="-L$(brew --prefix llvm)/lib/c++" + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_TOOLCHAIN_FILE="$(pwd)/build/conan_toolchain.cmake" -DUSE_PARALLEL=true -DRUN_EXPENSIVE_TESTS=false -DENABLE_EXPENSIVE_CHECKS=true -DCMAKE_CXX_COMPILER=clang++ -DADDITIONAL_COMPILER_FLAGS="-fexperimental-library" -D_NO_TIMING_TESTS=ON -DADDITIONAL_LINKER_FLAGS="-L$(brew --prefix llvm)/lib/c++" - name: Build - # Build your program with the given configuration + # Build your program with the given configuration # Sourcing the conanrun.sh even for building is required to make gtest_discover_tests pass reliably. run: > df -h; diff --git a/CMakeLists.txt b/CMakeLists.txt index c12ba535cb..93b36e3105 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -230,11 +230,11 @@ FetchContent_Declare( ################################ # S2 Geometry ################################ -SET (BUILD_TESTS OFF CACHE BOOL "no tests for s2") +set(BUILD_TESTS OFF CACHE BOOL "no tests for s2") FetchContent_Declare( s2 GIT_REPOSITORY https://github.com/google/s2geometry.git - GI_TAG 5b5eccd54a08ae03b4467e79ffbb076d0b5f221e #version 0.11.1 + GIT_TAG 5b5eccd54a08ae03b4467e79ffbb076d0b5f221e #version 0.11.1 SYSTEM ) diff --git a/src/util/ConfigManager/ConfigShorthandVisitor.h b/src/util/ConfigManager/ConfigShorthandVisitor.h index 279031182f..d4de4de11c 100644 --- a/src/util/ConfigManager/ConfigShorthandVisitor.h +++ b/src/util/ConfigManager/ConfigShorthandVisitor.h @@ -8,6 +8,7 @@ #include #include "util/ConfigManager/generated/ConfigShorthandParser.h" +#define EOF std::char_traits::eof() #include "util/json.h" /* From 1affa8a7698fab541ffe0a4383b089f3738eeffc Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 12:36:42 +0100 Subject: [PATCH 14/15] Suppress compiler warnings --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93b36e3105..0503cd210f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,7 +323,7 @@ FetchContent_Declare( ################################ FetchContent_MakeAvailable(googletest ctre abseil re2 stxxl fsst s2 nlohmann-json antlr) # Disable some warnings in RE2, STXXL, and GTEST -target_compile_options(s2 PRIVATE -Wno-sign-compare -Wno-unused-parameter -Wno-class-memaccess -Wno-comment -Wno-redundant-move -Wno-unknown-warning-option -Wno-maybe-uninitialized -Wno-class-memaccess) +target_compile_options(s2 PRIVATE -Wno-sign-compare -Wno-unused-parameter -Wno-class-memaccess -Wno-comment -Wno-redundant-move -Wno-unknown-warning-option -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-unused-but-set-variable -Wno-unused-function) target_compile_options(re2 PRIVATE -Wno-unused-parameter) target_compile_options(stxxl PRIVATE -Wno-deprecated-declarations) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") From 99378114e056076f2ffb7fc5071fed612d2e0c77 Mon Sep 17 00:00:00 2001 From: RobinTF <83676088+RobinTF@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:01:01 +0100 Subject: [PATCH 15/15] Try to fix build errors with macro redefinition --- src/util/ConfigManager/ConfigShorthandVisitor.h | 2 ++ src/util/Log.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/util/ConfigManager/ConfigShorthandVisitor.h b/src/util/ConfigManager/ConfigShorthandVisitor.h index d4de4de11c..633478b438 100644 --- a/src/util/ConfigManager/ConfigShorthandVisitor.h +++ b/src/util/ConfigManager/ConfigShorthandVisitor.h @@ -4,7 +4,9 @@ #pragma once // ANTLR runtime uses this as a variable name. +#ifdef EOF #undef EOF +#endif #include #include "util/ConfigManager/generated/ConfigShorthandParser.h" diff --git a/src/util/Log.h b/src/util/Log.h index 8358510039..1ba7277fb0 100644 --- a/src/util/Log.h +++ b/src/util/Log.h @@ -20,6 +20,11 @@ #define LOGLEVEL INFO #endif +// Abseil does also define its own LOG macro, so we need to undefine it here. +#ifdef LOG +#undef LOG +#endif + #define LOG(x) \ if (x > LOGLEVEL) \ ; \