f3b476c592
release / setup-environment (push) Has been cancelled
release / windows-depends (amd64, , https://sdk.lunarg.com/sdk/download/1.4.321.1/windows/vulkansdk-windows-X64-1.4.321.1.exe, windows, Vulkan, vulkan) (push) Has been cancelled
release / windows-depends (amd64, -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS="-parallel-jobs=4 -Wno-ignored-attributes -Wno-deprecated-pragma" -DCMAKE_CXX_FLAGS="-parallel-jobs=4 -Wno-ignored-attributes -Wno-deprecated-pragma", https:/… (push) Has been cancelled
release / windows-depends (amd64, ["cudart" "nvcc" "cublas" "cublas_dev" "crt" "nvvm" "nvptxcompiler"], 13.0, , https://developer.download.nvidia.com/compute/cuda/13.0.0/local_installers/cuda_13.0.0_windows.exe, windows, CUDA 13) (push) Has been cancelled
release / windows-depends (amd64, ["cudart" "nvcc" "cublas" "cublas_dev"], 12.8, , https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_571.96_windows.exe, windows, CUDA 12) (push) Has been cancelled
release / windows-depends (amd64, windows, CPU) (push) Has been cancelled
release / darwin-build (push) Has been cancelled
release / windows-build (amd64, x86_64, windows) (push) Has been cancelled
release / windows-build (arm64, aarch64, windows) (push) Has been cancelled
release / windows-app (push) Has been cancelled
release / linux-build (amd64, linux, archive) (push) Has been cancelled
release / linux-build (amd64, linux, rocm) (push) Has been cancelled
release / linux-build (arm64, linux, archive) (push) Has been cancelled
release / docker-build-push (amd64, CGO_CFLAGS
CGO_CXXFLAGS
GOFLAGS
, linux) (push) Has been cancelled
release / docker-build-push (amd64, CGO_CFLAGS
CGO_CXXFLAGS
GOFLAGS
FLAVOR=rocm
, linux, -rocm) (push) Has been cancelled
release / docker-build-push (arm64, CGO_CFLAGS
CGO_CXXFLAGS
GOFLAGS
, linux) (push) Has been cancelled
release / docker-merge-push () (push) Has been cancelled
release / docker-merge-push (-rocm) (push) Has been cancelled
release / release (push) Has been cancelled
CGO_CFLAGS and CGO_CXXFLAGS were being set without optimization flags, which overrides Go's default -O2 and results in unoptimized C++ code. This caused significant performance degradation in release builds compared to local `go build` which uses the default optimization. - build_darwin.sh: add -O3 to CGO_CFLAGS and CGO_CXXFLAGS exports - Dockerfile: preserve CGO_CFLAGS/CGO_CXXFLAGS from build args instead of overwriting them - app/README.md: update documentation to include -O3
98 lines
2.2 KiB
Markdown
98 lines
2.2 KiB
Markdown
# Ollama for macOS and Windows
|
|
|
|
## Download
|
|
|
|
- [macOS](https://github.com/ollama/app/releases/download/latest/Ollama.dmg)
|
|
- [Windows](https://github.com/ollama/app/releases/download/latest/OllamaSetup.exe)
|
|
|
|
## Development
|
|
|
|
### Desktop App
|
|
|
|
```bash
|
|
go generate ./... &&
|
|
go run ./cmd/app
|
|
```
|
|
|
|
### UI Development
|
|
|
|
#### Setup
|
|
|
|
Install required tools:
|
|
|
|
```bash
|
|
go install github.com/tkrajina/typescriptify-golang-structs/tscriptify@latest
|
|
```
|
|
|
|
#### Develop UI (Development Mode)
|
|
|
|
1. Start the React development server (with hot-reload):
|
|
|
|
```bash
|
|
cd ui/app
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
2. In a separate terminal, run the Ollama app with the `-dev` flag:
|
|
|
|
```bash
|
|
go generate ./... &&
|
|
OLLAMA_DEBUG=1 go run ./cmd/app -dev
|
|
```
|
|
|
|
The `-dev` flag enables:
|
|
|
|
- Loading the UI from the Vite dev server at http://localhost:5173
|
|
- Fixed UI server port at http://127.0.0.1:3001 for API requests
|
|
- CORS headers for cross-origin requests
|
|
- Hot-reload support for UI development
|
|
|
|
## Build
|
|
|
|
|
|
### Windows
|
|
|
|
- https://jrsoftware.org/isinfo.php
|
|
|
|
|
|
**Dependencies** - either build a local copy of ollama, or use a github release
|
|
```powershell
|
|
# Local dependencies
|
|
.\scripts\deps_local.ps1
|
|
|
|
# Release dependencies
|
|
.\scripts\deps_release.ps1 0.6.8
|
|
```
|
|
|
|
**Build**
|
|
```powershell
|
|
.\scripts\build_windows.ps1
|
|
```
|
|
|
|
### macOS
|
|
|
|
CI builds with Xcode 14.1 for OS compatibility prior to v13. If you want to manually build v11+ support, you can download the older Xcode [here](https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_14.1/Xcode_14.1.xip), extract, then `mv ./Xcode.app /Applications/Xcode_14.1.0.app` then activate with:
|
|
|
|
```
|
|
export CGO_CFLAGS="-O3 -mmacosx-version-min=12.0"
|
|
export CGO_CXXFLAGS="-O3 -mmacosx-version-min=12.0"
|
|
export CGO_LDFLAGS="-mmacosx-version-min=12.0"
|
|
export SDKROOT=/Applications/Xcode_14.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
|
|
export DEVELOPER_DIR=/Applications/Xcode_14.1.0.app/Contents/Developer
|
|
```
|
|
|
|
**Dependencies** - either build a local copy of Ollama, or use a GitHub release:
|
|
```sh
|
|
# Local dependencies
|
|
./scripts/deps_local.sh
|
|
|
|
# Release dependencies
|
|
./scripts/deps_release.sh 0.6.8
|
|
```
|
|
|
|
**Build**
|
|
```sh
|
|
./scripts/build_darwin.sh
|
|
```
|