[GH-ISSUE #5592] Ollama installation from source code #3494

Closed
opened 2026-04-12 14:11:20 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @dikshax86 on GitHub (Jul 10, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5592

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

So I was required to install Ollama setup exe from the source code in windows
so I found the steps as
Note: The Windows build for Ollama is still under development.

First, install required tools:

MSVC toolchain - C/C++ and cmake as minimal requirements

Go version 1.22 or higher

MinGW (pick one variant) with GCC.
MinGW-w64
MSYS2

The ThreadJob Powershell module: Install-Module -Name ThreadJob -Scope CurrentUser
Then, build the ollama binary:

$env:CGO_ENABLED="1"
go generate ./...
go build .

I completed above steps but getting error in CMake
details of software in my system
go version
MinGw software version 13.2.0
cmake version 3.29.0-rc2
visual studio 2022
system is 64bit

error is

cmake version 3.29.0-rc2

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

OS

Windows

GPU

Other

CPU

Intel

Ollama version

0.1.48

Originally created by @dikshax86 on GitHub (Jul 10, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5592 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? So I was required to install Ollama setup exe from the source code in windows so I found the steps as Note: The Windows build for Ollama is still under development. First, install required tools: MSVC toolchain - C/C++ and cmake as minimal requirements Go version 1.22 or higher MinGW (pick one variant) with GCC. MinGW-w64 MSYS2 The ThreadJob Powershell module: Install-Module -Name ThreadJob -Scope CurrentUser Then, build the ollama binary: $env:CGO_ENABLED="1" go generate ./... go build . I completed above steps but getting error in CMake details of software in my system go version MinGw software version 13.2.0 cmake version 3.29.0-rc2 visual studio 2022 system is 64bit error is cmake version 3.29.0-rc2 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 ### OS Windows ### GPU Other ### CPU Intel ### Ollama version 0.1.48
GiteaMirror added the documentationwindows labels 2026-04-12 14:11:20 -05:00
Author
Owner

@dhiltgen commented on GitHub (Jul 23, 2024):

Our windows developer docs could use a bit of improvement.

Try building from a Visual Studio Developer Shell. That should have all the right variables set up to get the build working.

<!-- gh-comment-id:2246447155 --> @dhiltgen commented on GitHub (Jul 23, 2024): Our windows developer docs could use a bit of improvement. Try building from a Visual Studio Developer Shell. That should have all the right variables set up to get the build working.
Author
Owner

@dikshax86 commented on GitHub (Jul 25, 2024):

@dhiltgen can you please elaborate more, because of my Company software some files in MSYS2 are not able to download and give an SSL certificate error

<!-- gh-comment-id:2250025972 --> @dikshax86 commented on GitHub (Jul 25, 2024): @dhiltgen can you please elaborate more, because of my Company software some files in MSYS2 are not able to download and give an SSL certificate error
Author
Owner

@dhiltgen commented on GitHub (Jul 26, 2024):

To build ollama we need cgo support, which requires gcc in your PATH. If MSYS2 isn't an option, you'll need to use one of the other port toolkits that can deliver gcc. (e.g., MinGW, Cygwin, etc.)

<!-- gh-comment-id:2253261485 --> @dhiltgen commented on GitHub (Jul 26, 2024): To build ollama we need cgo support, which requires gcc in your PATH. If MSYS2 isn't an option, you'll need to use one of the other port toolkits that can deliver gcc. (e.g., MinGW, Cygwin, etc.)
Author
Owner

@dhiltgen commented on GitHub (Oct 15, 2024):

Windows developer docs are much improved for the new Go server. https://github.com/ollama/ollama/blob/main/docs/development.md#windows-1

We still recommend MSYS2 to install make/gcc, as we have found that's the most reliable path. There are other ways to get gcc and make which you can explore at https://www.mingw-w64.org/

<!-- gh-comment-id:2415351837 --> @dhiltgen commented on GitHub (Oct 15, 2024): Windows developer docs are much improved for the new Go server. https://github.com/ollama/ollama/blob/main/docs/development.md#windows-1 We still recommend MSYS2 to install make/gcc, as we have found that's the most reliable path. There are other ways to get gcc and make which you can explore at https://www.mingw-w64.org/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3494