[GH-ISSUE #2978] windows generate error #48342

Closed
opened 2026-04-28 07:50:28 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @SilentEchoe on GitHub (Mar 7, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2978

Originally assigned to: @dhiltgen on GitHub.

Hi:
I'm getting a build error when building with Windows
The error message is as follows:
Building LCD CPU
generating config with: cmake -S ../llama.cpp -B ../llama.cpp/build/windows/amd64/cpu -DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DBUILD_SHARED_LIBS=on -DLLAMA_NATIVE=off -A x64 -DLLAMA_SERVER_VERBOSE=off
cmake version 3.28.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
CMake Error at CMakeLists.txt:2 (project):
Generator

NMake Makefiles

does not support platform specification, but platform

x64

was specified.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
llm\generate\generate_windows.go:3: running "powershell": exit status 1

I'm sure I've installed the relevant dependencies:
gcc version 13.2.0 (x86_64-win32-seh-rev1, Built by MinGW-Builds project)
cmake version 3.28.3
Python 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)] on win32
go version go1.22.1 windows/amd64

How do I get it through the build?

Originally created by @SilentEchoe on GitHub (Mar 7, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2978 Originally assigned to: @dhiltgen on GitHub. Hi: I'm getting a build error when building with Windows The error message is as follows: Building LCD CPU generating config with: cmake -S ../llama.cpp -B ../llama.cpp/build/windows/amd64/cpu -DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DBUILD_SHARED_LIBS=on -DLLAMA_NATIVE=off -A x64 -DLLAMA_SERVER_VERBOSE=off cmake version 3.28.3 CMake suite maintained and supported by Kitware (kitware.com/cmake). CMake Error at CMakeLists.txt:2 (project): Generator NMake Makefiles does not support platform specification, but platform x64 was specified. CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! llm\generate\generate_windows.go:3: running "powershell": exit status 1 I'm sure I've installed the relevant dependencies: gcc version 13.2.0 (x86_64-win32-seh-rev1, Built by MinGW-Builds project) cmake version 3.28.3 Python 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)] on win32 go version go1.22.1 windows/amd64 How do I get it through the build?
Author
Owner

@dhiltgen commented on GitHub (Mar 7, 2024):

Can you share a little more information about your build environment? Which version of MSVC do you have installed? Did you install the C/C++ tools during the MSVC install? Are you using cmake from MSVC or did you install cmake from kitware?

Try the following to enable more verbose build output

$env:CGO_CFLAGS="-g"
go generate ./... 2>&1 | % ToString | Tee-Object generate.log
<!-- gh-comment-id:1984017722 --> @dhiltgen commented on GitHub (Mar 7, 2024): Can you share a little more information about your build environment? Which version of MSVC do you have installed? Did you install the C/C++ tools during the MSVC install? Are you using cmake from MSVC or did you install cmake from kitware? Try the following to enable more verbose build output ``` $env:CGO_CFLAGS="-g" go generate ./... 2>&1 | % ToString | Tee-Object generate.log ```
Author
Owner

@SilentEchoe commented on GitHub (Mar 8, 2024):

屏幕截图 2024-03-08 094332

Submodule path '../llama.cpp': checked out 'c29af7e2252d288f2ea58a7d437c1cb7c0abf160'
Updated 0 paths from the index
Updated 0 paths from the index
Updated 0 paths from the index
Updated 0 paths from the index
Building LCD CPU
generating config with: cmake -S ../llama.cpp -B ../llama.cpp/build/windows/amd64/cpu -DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DBUILD_SHARED_LIBS=on -DLLAMA_NATIVE=off -A x64 -DCMAKE_VERBOSE_MAKEFILE=on -DLLAMA_SERVER_VERBOSE=on
cmake version 3.28.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
CMake Error at CMakeLists.txt:2 (project):
Generator
System.Management.Automation.RemoteException
NMake Makefiles
System.Management.Automation.RemoteException
does not support platform specification, but platform
System.Management.Automation.RemoteException
x64
System.Management.Automation.RemoteException
was specified.
System.Management.Automation.RemoteException
System.Management.Automation.RemoteException
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
llm\generate\generate_windows.go:3: running "powershell": exit status 1

<!-- gh-comment-id:1984902160 --> @SilentEchoe commented on GitHub (Mar 8, 2024): ![屏幕截图 2024-03-08 094332](https://github.com/ollama/ollama/assets/33675262/8851683c-10a4-4e15-b0e8-3711500730f9) Submodule path '../llama.cpp': checked out 'c29af7e2252d288f2ea58a7d437c1cb7c0abf160' Updated 0 paths from the index Updated 0 paths from the index Updated 0 paths from the index Updated 0 paths from the index Building LCD CPU generating config with: cmake -S ../llama.cpp -B ../llama.cpp/build/windows/amd64/cpu -DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DBUILD_SHARED_LIBS=on -DLLAMA_NATIVE=off -A x64 -DCMAKE_VERBOSE_MAKEFILE=on -DLLAMA_SERVER_VERBOSE=on cmake version 3.28.3 CMake suite maintained and supported by Kitware (kitware.com/cmake). CMake Error at CMakeLists.txt:2 (project): Generator System.Management.Automation.RemoteException NMake Makefiles System.Management.Automation.RemoteException does not support platform specification, but platform System.Management.Automation.RemoteException x64 System.Management.Automation.RemoteException was specified. System.Management.Automation.RemoteException System.Management.Automation.RemoteException CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! llm\generate\generate_windows.go:3: running "powershell": exit status 1
Author
Owner

@SilentEchoe commented on GitHub (Mar 8, 2024):

Cmake is downloaded and installed through the official website,Visual Studio 2022 install C/C++
屏幕截图 2024-03-08 100311

<!-- gh-comment-id:1984919501 --> @SilentEchoe commented on GitHub (Mar 8, 2024): Cmake is downloaded and installed through the official website,Visual Studio 2022 install C/C++ ![屏幕截图 2024-03-08 100311](https://github.com/ollama/ollama/assets/33675262/82556243-ef3b-4a34-a4c5-f22b843c52a0)
Author
Owner

@SilentEchoe commented on GitHub (Mar 8, 2024):

Hello, thank you for your help, I have found the cause of the problem

<!-- gh-comment-id:1985228913 --> @SilentEchoe commented on GitHub (Mar 8, 2024): Hello, thank you for your help, I have found the cause of the problem
Author
Owner

@ysssssha commented on GitHub (Mar 15, 2024):

Hello, how did you solve the problem?

<!-- gh-comment-id:1998889461 --> @ysssssha commented on GitHub (Mar 15, 2024): Hello, how did you solve the problem?
Author
Owner

@SilentEchoe commented on GitHub (Mar 20, 2024):

I found that there is a problem with the C++ architecture version of my mingw installation. After I reinstalled it, it can compile normally. Pay attention to use the Visual Studio Shell to build. I hope this information helps you.

<!-- gh-comment-id:2008602740 --> @SilentEchoe commented on GitHub (Mar 20, 2024): I found that there is a problem with the C++ architecture version of my mingw installation. After I reinstalled it, it can compile normally. Pay attention to use the Visual Studio Shell to build. I hope this information helps you.
Author
Owner

@czfdlut commented on GitHub (May 11, 2024):

I meet the same problem,how to solve? thank you!

<!-- gh-comment-id:2105527370 --> @czfdlut commented on GitHub (May 11, 2024): I meet the same problem,how to solve? thank you!
Author
Owner

@ZivenLu commented on GitHub (May 22, 2024):

I also have the same problem with mysy2.how to solve? thank you!

<!-- gh-comment-id:2123699067 --> @ZivenLu commented on GitHub (May 22, 2024): I also have the same problem with mysy2.how to solve? thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#48342