I have installed the kenlm library correctly before, but when I try to execute the command
cmake .. -DCMAKE_BUILD_TYPE=Release -DCRITERION_BACKEND=CUDA
the error occurred:
-- Looking for KenLM
CMake Error at cmake/Findkenlm.cmake:47 (message):
kenlm library not found; please set CMAKE_LIBRARY_PATH or KENLM_LIB
Call Stack (most recent call first):
src/decoder/CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
I don't know where to set the CMAKE_LIBRARY_PATH or KENLM_LIB
I installed kenlm to my /data/zd directory
If you've built KenLM, you can set the environment variable KENLM_ROOT_DIR to point to its directory. On Linux, this is export KENLM_ROOT_DIR=[KenLM directory] — in your case, export KENLM_ROOT_DIR=/data/zd/kenlm.
Putting this here in case someone faces the same problem, you can add the following lines in your /bindings/python/setup.py in the build_extensions method in the cmake_args list:
"-DCMAKE_INCLUDE_PATH="+"<PATH-TO-KENLM>/kenlm",
"-DKENLM_LIB="+"<PATH-TO-KENLM>/kenlm",
"-DKENLM_UTIL_LIB="+"<PATH-TO-KENLM>/kenlm/util",
"-DKENLM_INC="+"<PATH-TO-KENLM>/kenlm/lm"
Most helpful comment
Putting this here in case someone faces the same problem, you can add the following lines in your /bindings/python/setup.py in the build_extensions method in the cmake_args list: