kpu / kenlm

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

python installation problem #391

Closed j3rk0 closed 2 years ago

j3rk0 commented 2 years ago

when i try to pip install -e . inside the kenlm top folder it fail to compile returning:

util/usage.cc:185:1: error: no return statement in function returning non-void [-Werror=return-type]
  185 | }
      | ^
cc1plus: some warnings being treated as errors
error: command '/usr/bin/gcc' failed with exit code 1
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

i try to run python-config --cflags and one of the compiler flag was -Werror=return-type. i find two possible solution:

the first solution is the best but i don't know how to change the compiler flag. the second solution is fast but i don't know if it break some library functions. i don't know if this is the correct place to report this error but it takes me a lot to solve it and i tought it could be useful for someone.

kpu commented 2 years ago

What platform are you on? Indeed return 0.0 will work, I'll add that.

j3rk0 commented 2 years ago

What platform are you on? Indeed return 0.0 will work, I'll add that.

Intel x86_64 notebook running openSuse tumbleWeed with linux kernel 5-18.4. i run pip from a python 3.8 virtual enviroment

kpu commented 2 years ago

Ah we're defining HAVE_CLOCKGETTIME from cmake but not the python build.

kpu commented 2 years ago

Try bcd4af6 .

j3rk0 commented 2 years ago

it worked. thank you very much. this is a very awsome implementation