build: set CFLAGS=-O3 specifically for cpu.go
This commit is contained in:
parent
548a9f56a6
commit
39fd89308c
12
.github/workflows/release.yaml
vendored
12
.github/workflows/release.yaml
vendored
@ -5,6 +5,10 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
CGO_CFLAGS: '-O3'
|
||||||
|
CGO_CXXFLAGS: '-O3'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup-environment:
|
setup-environment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -291,7 +295,7 @@ jobs:
|
|||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
- run: |
|
- run: |
|
||||||
apt-get update && apt-get install pigz
|
apt-get update && apt-get install pigz
|
||||||
for TARGET in ${{ matrix.targets }}; do docker buildx build --platform $PLATFORM --target $TARGET --build-arg GOFLAGS --output type=local,dest=dist/$PLATFORM .; done
|
for TARGET in ${{ matrix.targets }}; do docker buildx build --platform $PLATFORM --target $TARGET --build-arg GOFLAGS --build-arg CGO_CFLAGS --build-args CGO_CXXFLAGS --output type=local,dest=dist/$PLATFORM .; done
|
||||||
tar c -C dist/$PLATFORM . | pigz -9cv >dist/ollama-${PLATFORM//\//-}.tgz
|
tar c -C dist/$PLATFORM . | pigz -9cv >dist/ollama-${PLATFORM//\//-}.tgz
|
||||||
env:
|
env:
|
||||||
PLATFORM: ${{ matrix.os }}/${{ matrix.arch }}
|
PLATFORM: ${{ matrix.os }}/${{ matrix.arch }}
|
||||||
@ -308,12 +312,16 @@ jobs:
|
|||||||
- flavor: 'latest=false'
|
- flavor: 'latest=false'
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
build-args: |
|
build-args: |
|
||||||
|
CGO_CFLAGS=${{ env.CGO_CFLAGS }}
|
||||||
|
CGO_CXXFLAGS=${{ env.CGO_CXXFLAGS }}
|
||||||
GOFLAGS=${{ needs.setup-environment.outputs.GOFLAGS }}
|
GOFLAGS=${{ needs.setup-environment.outputs.GOFLAGS }}
|
||||||
- flavor: 'latest=false,suffix=rocm'
|
- flavor: 'latest=false,suffix=rocm'
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
build-args: |
|
build-args: |
|
||||||
GOFLAGS=${{ needs.setup-environment.outputs.GOFLAGS }}
|
CGO_CFLAGS=${{ env.CGO_CFLAGS }}
|
||||||
|
CGO_CXXFLAGS=${{ env.CGO_CXXFLAGS }}
|
||||||
FLAVOR=rocm
|
FLAVOR=rocm
|
||||||
|
GOFLAGS=${{ needs.setup-environment.outputs.GOFLAGS }}
|
||||||
runs-on: linux
|
runs-on: linux
|
||||||
environment: release
|
environment: release
|
||||||
needs: setup-environment
|
needs: setup-environment
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
// #cgo CFLAGS: -Wno-implicit-function-declaration
|
// #cgo CFLAGS: -O3 -Wno-implicit-function-declaration
|
||||||
// #cgo CXXFLAGS: -std=c++17
|
// #cgo CXXFLAGS: -std=c++17
|
||||||
// #cgo CPPFLAGS: -I${SRCDIR}/amx -I${SRCDIR}/llamafile -I${SRCDIR}/.. -I${SRCDIR}/../../include
|
// #cgo CPPFLAGS: -I${SRCDIR}/amx -I${SRCDIR}/llamafile -I${SRCDIR}/.. -I${SRCDIR}/../../include
|
||||||
// #cgo CPPFLAGS: -DGGML_USE_LLAMAFILE
|
// #cgo CPPFLAGS: -DGGML_USE_LLAMAFILE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user