skeskinen / bert.cpp

ggml implementation of BERT
MIT License
463 stars 58 forks source link

How do I properly build this on windows? #42

Closed qwbarch closed 9 months ago

qwbarch commented 9 months ago

Sorry for the dumb question, but I noticed Windows support was added: https://github.com/skeskinen/bert.cpp/pull/29.

I'm struggling to get a proper build for the native binaries. For example, if I run this step:

mkdir build
cd build
cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release
make
cd ..

This fails due to windows not support pthread. This was fixed by using the mingw64 cmake:

cmake .. -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles"
mingw32-make

This results in the following files:

libbert.dll.a
bin/libbert.dll
bin/libggml.dll

The rest of the files are generated files that aren't needed, so I've left them out.

Do you know why this is missing the server/client's executables? Is it missing anything else that's necessary to make it run?

qwbarch commented 9 months ago

Sorry I'm an idiot, didn't realize I had -DBUILD_SHARED_LIBS set to ON when it should've been OFF.
Looks like the examples don't work on windows though, perhaps it should be noted on the README?