Skip to content

Compilation fails with Cmake on Windows (since #5970): error C1061 #6093

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
stduhpf opened this issue Mar 15, 2024 · 1 comment · Fixed by #6101
Closed

Compilation fails with Cmake on Windows (since #5970): error C1061 #6093

stduhpf opened this issue Mar 15, 2024 · 1 comment · Fixed by #6101

Comments

@stduhpf
Copy link
Contributor

stduhpf commented Mar 15, 2024

After today's changes, I can no longer build the project with Visual Studio's Cmake. Build fails with compiler error C1061.
It seems like there is too many nested block scopes for MSVC to handle in common.cpp.

$ cmake --build . --config Release -- "-m:24"
Version MSBuild 17.7.2+d6990bcfa pour .NET Framework

  build_info.vcxproj -> C:\llm\llama.cpp\build\common\build_info.dir\Release\build_info.lib
  ggml.vcxproj -> C:\llm\llama.cpp\build\ggml.dir\Release\ggml.lib
  llama.vcxproj -> C:\llm\llama.cpp\build\Release\llama.lib
  llava.vcxproj -> C:\llm\llama.cpp\build\examples\llava\llava.dir\Release\llava.lib
  gguf.vcxproj -> C:\llm\llama.cpp\build\bin\Release\gguf.exe
  quantize.vcxproj -> C:\llm\llama.cpp\build\bin\Release\quantize.exe
  ggml_static.vcxproj -> C:\llm\llama.cpp\build\Release\ggml_static.lib
  quantize-stats.vcxproj -> C:\llm\llama.cpp\build\bin\Release\quantize-stats.exe
  benchmark.vcxproj -> C:\llm\llama.cpp\build\bin\Release\benchmark.exe
  test-c.vcxproj -> C:\llm\llama.cpp\build\bin\Release\test-c.exe
  llava_static.vcxproj -> C:\llm\llama.cpp\build\examples\llava\Release\llava_static.lib
  common.cpp
C:\llm\llama.cpp\common\common.cpp(899,60): fatal  error C1061: limite du compilateur : blocs imbriqués trop profondément [C:\llm\llama.cpp\build\common\common.vcxproj]

using git bisect :

877b4d0c628cc70dddb5df72ed8fc14d126ca7e8 is the first bad commit
commit 877b4d0c628cc70dddb5df72ed8fc14d126ca7e8
Author: Theia Vogel <theia@vgel.me>
Date:   Fri Mar 15 13:43:02 2024 -0700

    llama : add support for control vectors (#5970)

    * control vector api and implementation

    * control-vectors : minor code style updates

    * disable control vector when data == nullptr

    use -1 for disabled range (also on init) in case we ever support controlling layer 0 (embeddings)

    ---------

    Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

 common/common.cpp | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 common/common.h   |  31 +++++++-
 llama.cpp         | 128 ++++++++++++++++++++++++++++++++
 llama.h           |  23 +++++-
 4 files changed, 392 insertions(+), 5 deletions(-)
@dranger003
Copy link
Contributor

I can confirm this as well, looks like there may be a need to refactor gpt_params_parse_ex?

C:\llama.cpp\common\common.cpp(899,60): error C1061: compiler limit: blocks nested too deeply [C:\llama.cpp\build\common\common.vcxproj]

https://github.com/ggerganov/llama.cpp/blob/d84c48505f60bcd358b82a751d40418c4d235643/common/common.cpp#L899

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