Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It won't build on Windows #135

Open
peter-ch opened this issue May 8, 2023 · 5 comments
Open

It won't build on Windows #135

peter-ch opened this issue May 8, 2023 · 5 comments

Comments

@peter-ch
Copy link

peter-ch commented May 8, 2023

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.

@mirek190
Copy link

I noticed that yesterday .... is able to build almost all binaries except those :-/

@ukiyocode
Copy link

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) ){

@ukiyocode
Copy link

scratch that i'm not getting any output from it so that 724 line is probably wrong

@eublefar
Copy link

@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).

@ukiyocode
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants