Skip to content

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

Closed
@stduhpf

Description

@stduhpf

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 <[email protected]>
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 <[email protected]>

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions