tree: 0f724c732edd2c461ec6903208f54dbe9a6f80e8 [path history] [tgz]
  1. blas32/
  2. blas64/
  3. cblas128/
  4. cblas64/
  5. gonum/
  6. testblas/
  7. blas.go

Gonum BLAS GoDoc

A collection of packages to provide BLAS functionality for the Go programming language


  go get

BLAS C-bindings

If you want to use OpenBLAS, install it in any directory:

  git clone
  cd OpenBLAS

The blas/cgo package provides bindings to C-backed BLAS packages. blas/cgo needs the CGO_LDFLAGS environment variable to point to the blas installation. More information can be found in the cgo command documentation.

Then install the blas/cgo package:

  CGO_LDFLAGS="-L/path/to/OpenBLAS -lopenblas" go install

For Windows you can download binary packages for OpenBLAS at SourceForge.

If you want to use a different BLAS package such as the Intel MKL you can adjust the CGO_LDFLAGS variable:

  CGO_LDFLAGS="-lmkl_rt" go install

On OS X the easiest solution is to use the libraries provided by the system:

  CGO_LDFLAGS="-framework Accelerate" go install



Defines BLAS API split in several interfaces.


Go implementation of the BLAS API (incomplete, implements the float32 and float64 API).

blas/blas64 and blas/blas32

Wrappers for an implementation of the double (i.e., float64) and single (float32) precision real parts of the BLAS API.

package main

import (


func main() {
	v := blas64.Vector{Inc: 1, Data: []float64{1, 1, 1}}
	fmt.Println("v has length:", blas64.Nrm2(len(v.Data), v))

blas/cblas128 and blas/cblas64

Wrappers for an implementation of the double (i.e., complex128) and single (complex64) precision complex parts of the blas API.

Currently blas/cblas64 and blas/cblas128 require