C++ Templates · Installation

Installation

8122c932

Ask your coding agent about this page, or add the docs server to it

curl -s 'https://www.unum.cloud/docs/usearch/templates/installation.md' | claude -p "How would this fit my code?"

§ Getting Them

usearch::header is the in-RAM basic tier: basic/ram_index.hpp, basic/ram_indexes.hpp and the eight utilities/ headers under them, over the standard library and the C types of usearch::abi, with nothing to compile. An install carries it, so a program finds it as it finds the libraries:

find_package(usearch CONFIG REQUIRED)
target_link_libraries(your_target PRIVATE usearch::header)

The rest, the dense kits, the NVMe and VRAM tiers and the sequence, shapes and geospatial modalities, includes NumKong, ForkUnion, StringZilla and SmashTable, so no install carries it. Vendor USearch through FetchContent, which fetches those siblings at the commits USearch pins, and link their targets beside usearch::header:

FetchContent_Declare(usearch GIT_REPOSITORY https://github.com/unum-cloud/USearch.git GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(usearch)
target_link_libraries(your_target PRIVATE usearch::header numkong::types forkunion::header forkunion::cpp
                                          stringzilla::types smashtable::header)