kpu / kenlm

KenLM: Faster and Smaller Language Model Queries
http://kheafield.com/code/kenlm/
Other
2.5k stars 513 forks source link

Isolate binary and Boost-dependent build components #418

Open jacobkahn opened 1 year ago

jacobkahn commented 1 year ago

Adds the BUILD_TOOLS (and BUILD_BENCHMARKS) options to the CMake build, which allows users to easily toggle building or not building binary-related components (that are also Boost-dependent). Getting a build of KenLM that doesn't depend on Boost (and thus doesn't build any binary components such as builder or interpolate) is now as simple as

cmake .. -DBUILD_TOOLS=OFF

Also adds BUILD_BENCHMARKS, which modulates building benchmarks.

All defaults are set such that there is no behavior change from the current build if these options aren't specified.

kpu commented 1 year ago

This is nice. Though the build_binary and query programs come Boost free, so BUILD_TOOLS is perhaps the wrong name. Query only (there is compile_query_only.sh) or something about Boost?

jacobkahn commented 1 year ago

Renamed to BUILD_WITH_BOOST and re-enabled building query, fragment, and build_binary since they aren't boost dependent, as you say 👍 . I've tested in a few limited environments, but it would be good to test in other places.