Wav2letter: cmake error: kenlm library not found

Created on 2 Jan 2019  Â·  2Comments  Â·  Source: flashlight/wav2letter

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

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:

        "-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"

All 2 comments

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"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhengqun picture zhengqun  Â·  5Comments

megharangaswamy picture megharangaswamy  Â·  5Comments

EdwinWenink picture EdwinWenink  Â·  4Comments

abhinavkulkarni picture abhinavkulkarni  Â·  3Comments

tarang-jain picture tarang-jain  Â·  3Comments