Skip to content

[BUG] Configuration vs. compilation guard mismatch #905

@juan131

Description

@juan131

Describe the bug

As we can see in the svs.cmake, SVS isn't supported with GCC < 11:

# GCC < v11 does not support C++20 features required for SVS
# https://gcc.gnu.org/projects/cxx-status.html
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0")
        set(SVS_SUPPORTED 0)
        message(STATUS "Skipping SVS: requires GCC >= 11.")
    endif()
endif()

However, the SVS source files are added and they unconditionally include SVS headers regardless CMake detects GCC < 11.

To Reproduce

Steps to reproduce the behavior:

On a distro with GCC < 11 (e.g. Debian 11), run:

$ make (...)
(...)
-- Skipping SVS: requires GCC >= 11.
-- SVS support disabled
(...)
[ 30%] Building CXX object src/VecSim/CMakeFiles/VectorSimilarity.dir/index_factories/tiered_factory.cpp.o
[ 30%] Building CXX object src/VecSim/CMakeFiles/VectorSimilarity.dir/index_factories/index_factory.cpp.o
In file included from /modules/redisearch/src/deps/VectorSimilarity/src/VecSim/algorithms/svs/svs_tiered.h:5,
                 from /modules/redisearch/src/deps/VectorSimilarity/src/VecSim/index_factories/tiered_factory.h:16,
                 from /modules/redisearch/src/deps/VectorSimilarity/src/VecSim/index_factories/index_factory.cpp:13:
/modules/redisearch/src/deps/VectorSimilarity/src/VecSim/algorithms/svs/svs.h:21:10: fatal error: svs/index/vamana/dynamic_index.h: No such file or directory
   21 | #include "svs/index/vamana/dynamic_index.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /modules/redisearch/src/deps/VectorSimilarity/src/VecSim/algorithms/svs/svs_tiered.h:5,
                 from /modules/redisearch/src/deps/VectorSimilarity/src/VecSim/index_factories/tiered_factory.h:16,
                 from /modules/redisearch/src/deps/VectorSimilarity/src/VecSim/index_factories/tiered_factory.cpp:9:
/modules/redisearch/src/deps/VectorSimilarity/src/VecSim/algorithms/svs/svs.h:21:10: fatal error: svs/index/vamana/dynamic_index.h: No such file or directory
   21 | #include "svs/index/vamana/dynamic_index.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated. 

Expected behavior

Compilation should work disabling SVS.

Environment (please complete the following information):

  • OS: Debian 11
  • Version/branch: latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions