Skip to content

Broken build on MSYS2 #871

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

Closed
1OOyan opened this issue Apr 10, 2023 · 1 comment · Fixed by #890
Closed

Broken build on MSYS2 #871

1OOyan opened this issue Apr 10, 2023 · 1 comment · Fixed by #890

Comments

@1OOyan
Copy link

1OOyan commented Apr 10, 2023

Commit: f963b63 Breaks the MSYS2 build with the following messages:

llama_util.h: In constructor 'llama_mmap::llama_mmap(llama_file*)': llama_util.h:213:9: error: 'WIN32_MEMORY_RANGE_ENTRY' was not declared in this scope 213 | WIN32_MEMORY_RANGE_ENTRY range; | ^~~~~~~~~~~~~~~~~~~~~~~~ llama_util.h:214:9: error: 'range' was not declared in this scope 214 | range.VirtualAddress = addr; | ^~~~~ llama_util.h:216:14: error: 'PrefetchVirtualMemory' was not declared in this scope 216 | if (!PrefetchVirtualMemory(GetCurrentProcess(), 1, &range, 0)) { | ^~~~~~~~~~~~~~~~~~~~~

comex added a commit to comex/llama.cpp that referenced this issue Apr 11, 2023
Mostly for msys2 and mingw64 builds, which are different from each other
and different from standard Visual Studio builds.  Isn't Windows fun?

- Define _GNU_SOURCE in more files (it's already used in ggml.c for
  Linux's sake).

- Don't use PrefetchVirtualMemory if not building for Windows 8 or later
  (mingw64 doesn't by default).  But warn the user about this situation
  since it's probably not intended.

- Check for NOMINMAX already being defined, which it is on mingw64.

- Actually use the `increment` variable (bug in my `pizza` PR).

- Suppress unused variable warnings in the fake pthread_create and
  pthread_join implementations for Windows.

- (not Windows-related) Remove mention of `asprintf` from comment;
  `asprintf` is no longer used.

Fixes ggml-org#871.
@comex comex mentioned this issue Apr 11, 2023
prusnak pushed a commit that referenced this issue Apr 11, 2023
Mostly for msys2 and mingw64 builds, which are different from each other
and different from standard Visual Studio builds.  Isn't Windows fun?

- Define _GNU_SOURCE in more files (it's already used in ggml.c for
  Linux's sake).

- Don't use PrefetchVirtualMemory if not building for Windows 8 or later
  (mingw64 doesn't by default).  But warn the user about this situation
  since it's probably not intended.

- Check for NOMINMAX already being defined, which it is on mingw64.

- Actually use the `increment` variable (bug in my `pizza` PR).

- Suppress unused variable warnings in the fake pthread_create and
  pthread_join implementations for Windows.

- (not Windows-related) Remove mention of `asprintf` from comment;
  `asprintf` is no longer used.

Fixes #871.
@1OOyan
Copy link
Author

1OOyan commented Apr 11, 2023 via email

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

Successfully merging a pull request may close this issue.

1 participant