kpu / kenlm

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

In standalone Python extension, actually use the CMake build #441

Open sdrobert opened 1 year ago

sdrobert commented 1 year ago

Hello,

Thanks Ken for the great library!

I noticed that #417 didn't delete the old Extension source (FILES), which was causing the code to be compiled via the normal build_ext routine after CMake compiled its own extension. I believe CMake's standalone library was put into site-packages as libkenlm.so but never used. You can verify yourself by watching the output of

pip install -vv .

This PR removes the old Extension source and makes sure the CMake library is loaded and named correctly. I've tested it on GCC and MSVC but not OSX. I'd appreciate someone else giving this PR a run before merging.

Thank you! Sean