From 26a4c3c363de3def800f8cd487dfdcf483b578b7 Mon Sep 17 00:00:00 2001 From: Luke Gallagher Date: Tue, 19 Nov 2024 22:16:13 +1100 Subject: [PATCH 1/3] Fix benchmark build --- external/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 8096e06b..394036f2 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -9,7 +9,7 @@ target_compile_options(FastPFor PRIVATE -Wno-cast-align) # Add CLI11 if (NOT PISA_SYSTEM_CLI11 AND PISA_BUILD_TOOLS) - set(CLI11_TESTING OFF CACHE BOOL "skip trecpp testing") + set(CLI11_TESTING OFF CACHE BOOL "skip cli11 testing") add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/CLI11 EXCLUDE_FROM_ALL) endif() @@ -113,7 +113,7 @@ if (NOT PISA_SYSTEM_ONETBB) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/oneTBB) endif() -if (PISA_ENABLE_TESTING AND NOT PISA_SYSTEM_GOOGLE_BENCHMARK) +if (PISA_ENABLE_BENCHMARKING AND NOT PISA_SYSTEM_GOOGLE_BENCHMARK) set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "skip Google Benchmark testing") set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "skip Google Benchmark testing") set(BENCHMARK_ENABLE_WERROR OFF CACHE BOOL "disable -Werror") From 0ce289feb61486acf8d8e1f92971241924dca234 Mon Sep 17 00:00:00 2001 From: Luke Gallagher Date: Tue, 19 Nov 2024 22:25:55 +1100 Subject: [PATCH 2/3] Set `CMAKE_INSTALL_RPATH` for non-system install prefix During install set RPATH so that libtbb can be found when building with the oneTBB submodule. The following programs in the tools directory require libtbb: - compress_inverted_index - evaluate_queries - invert - parse_collection - partition_fwd_index - reorder-docids - shards See #242 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57c25974..02a82b2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,12 @@ if (UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") # Add debug info anyway endif() + # modify RPATH when installing to a non-system directory (e.g. /usr/local). + # required to find libtbb with non-system libtbb. + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if(NOT PISA_SYSTEM_ONETBB AND "${isSystemDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + endif() endif() find_package(OpenMP) From 20c39705671d62ab7f4d0c02e5ce25321f9437c8 Mon Sep 17 00:00:00 2001 From: Luke Gallagher Date: Fri, 29 Nov 2024 10:44:54 +1100 Subject: [PATCH 3/3] Update cli test build Add step to install tools in default path before running tests (#242). --- .github/workflows/commit.yml | 5 +++++ test/cli/setup.sh | 6 ++++-- test/cli/test_count_postings.sh | 2 -- test/cli/test_taily_stats.sh | 2 -- test/cli/test_wand_data.sh | 3 --- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 042f9df0..95b11a5c 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -70,6 +70,11 @@ jobs: working-directory: ${{runner.workspace}}/build run: cmake --build . --config Debug -- -j 4 + - name: Install + shell: bash + working-directory: ${{runner.workspace}}/build + run: sudo make install + - name: Test CLI shell: bash working-directory: ${{runner.workspace}}/build diff --git a/test/cli/setup.sh b/test/cli/setup.sh index 0f7f6a78..d180053a 100644 --- a/test/cli/setup.sh +++ b/test/cli/setup.sh @@ -3,8 +3,10 @@ # This script should be executed within the build directory that is directly # in the project directory, e.g., /path/to/pisa/build -PISA_BIN="./bin" -export PATH="$PISA_BIN:$PATH" +command -v compress_inverted_index >/dev/null 2>&1 || { + echo >&2 "tools not available in default path" + exit 1 +} test_dir=${TEST_DIR:-../test} diff --git a/test/cli/test_count_postings.sh b/test/cli/test_count_postings.sh index 67f3deba..5f78dbf4 100644 --- a/test/cli/test_count_postings.sh +++ b/test/cli/test_count_postings.sh @@ -2,8 +2,6 @@ set +x -PISA_BIN="bin" -export PATH="$PISA_BIN:$PATH" DIR=$(dirname "$0") @test "Extract posting counts" { diff --git a/test/cli/test_taily_stats.sh b/test/cli/test_taily_stats.sh index 3bb15da2..d0d5e377 100644 --- a/test/cli/test_taily_stats.sh +++ b/test/cli/test_taily_stats.sh @@ -2,8 +2,6 @@ set +x -PISA_BIN="bin" -export PATH="$PISA_BIN:$PATH" DIR=$(dirname "$0") echo_int () { diff --git a/test/cli/test_wand_data.sh b/test/cli/test_wand_data.sh index e843149a..ec4504d9 100644 --- a/test/cli/test_wand_data.sh +++ b/test/cli/test_wand_data.sh @@ -2,9 +2,6 @@ set +x -PISA_BIN="bin" -export PATH="$PISA_BIN:$PATH" - queries=$(cat <