Closed jonlawlor closed 9 years ago
Uhh...
brendan:~/Documents/mygo/src/github.com/gonum/blas/cblas$ echo $CGO_LDFLAGS -framework Accelerate brendan:~/Documents/mygo/src/github.com/gonum/blas/cblas$ go test PASS ok github.com/gonum/blas/cblas 0.052s
Operating system: OSX Yosemite 10.10.1
Also: brendan:~/Documents/mygo/src/github.com/gonum/blas/cblas$ CGO_LDFLAGS="-framework Accelerate" go test PASS ok github.com/gonum/blas/cblas 0.042s
I don't have another mac, but using a new GOPATH
brendan:~/Documents/thirdgo/src$ export CGO_LDFLAGS="-framework Accelerate" brendan:~/Documents/thirdgo/src$ go get -t github.com/gonum/blas/cblas brendan:~/Documents/thirdgo/src$ go test github.com/gonum/blas/cblas/ ok github.com/gonum/blas/cblas 0.036s
Arrrgh. It works fine with the flags exported. It doesn't work if you CGO_LDFLAGS="-framework Accelerate" go install
and then go test
. I might just be dense, but I'd like to add a little to the readme to explain that you're better off with the flag exported.
@jonlawlor, have a look at how go test
actually works, that will explain this behaviour. go test
does a complete build that is independent of the installed code, so you need to either prefix the env var declaration or export it.
Yes, I won't forget that now.
I tried running go test in the gonum/blas/cblas directory and it fails on OSX Yosemite (10.10.1) with
References to cblas in matrix still work. I tried installing from scratch on a different mac, where I've never fiddled with various blas libraries:
but it produced the same result.