ggml
ggml copied to clipboard
It won't build on Windows
I keep getting this error, nothing builds:
6>C:\Users\spook\Dropbox\Desktop\ggml\examples\gpt-j\main.cpp(15,10): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory 5>C:\Users\spook\Dropbox\Desktop\ggml\examples\stablelm\main.cpp(15,10): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory 8>C:\Users\spook\Dropbox\Desktop\ggml\examples\dolly-v2\main.cpp(15,10): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory 8>Done building project "dollyv2.vcxproj" -- FAILED. 6>Done building project "gpt-j.vcxproj" -- FAILED. 7>C:\Users\spook\Dropbox\Desktop\ggml\examples\gpt-2\main.cpp(15,10): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory 5>Done building project "stablelm.vcxproj" -- FAILED. 7>Done building project "gpt-2.vcxproj" -- FAILED.
I noticed that yesterday .... is able to build almost all binaries except those :-/
had same errors for starcoder, you need to make 4 changes in examples\starcoder\main.cpp to compile: 15: #include <io.h> (instead of #include <unistd.h>) 204: struct ggml_init_params params = { ctx_size, NULL, false }; instead of: struct ggml_init_params params = { .mem_size = ctx_size, .mem_buffer = NULL, .no_alloc = false, }; 430: struct ggml_init_params params = { buf_size, buf, false }; instead of: struct ggml_init_params params = { .mem_size = buf_size, .mem_buffer = buf, .no_alloc = false, }; 724: if( !isatty(_fileno(stdin)) ){ instead of: if( !isatty(STDIN_FILENO) ){
scratch that i'm not getting any output from it so that 724 line is probably wrong
@ukiyocode Your solution is correct, but you also need to call ggml_time_init(); at the beginning of the main().
I think it's specific to MSVC/MINGW compilers for whatever reason (check ggml.c:403).
@eublefar Thx, it works now. Someone already added your line to the repo, so all you have to do now is the 4 changes i mentioned b4.