mathgl icon indicating copy to clipboard operation
mathgl copied to clipboard

Error while trying to get library: undefined: sync.Pool

Open ghost opened this issue 9 years ago • 5 comments

I'm trying to get github.com/go-gl/mathgl/mgl32 and getting the following error:

$ go get github.com/go-gl/mathgl/mgl32
# github.com/go-gl/mathgl/mgl32
src/github.com/go-gl/mathgl/mgl32/mempool.go:12: undefined: sync.Pool
src/github.com/go-gl/mathgl/mgl32/mempool.go:29: undefined: sync.Pool
src/github.com/go-gl/mathgl/mgl32/mempool.go:41: undefined: sync.Pool

Here is my version of go:

$ go version
go version go1.2.1 linux/amd64

ghost avatar Mar 31 '15 09:03 ghost

sync.Pool was added in go 1.3.

pwaller avatar Mar 31 '15 11:03 pwaller

@pwaller Yeah, I know. But github.com/go-gl/mathgl/mgl32 works in go 1.2.2 as well, because of tag in git repository. Could you add such tag for go 1.2.1?

ghost avatar Apr 01 '15 07:04 ghost

Do you have some hard constraint keeping you on Go 1.2.1? If not, I highly recommend updating to the latest 1.4.2. It will perform better and you will run into fewer bugs (a lot of issues have been fixed/improved since 1.2.1). Updating is easy and compatible with existing code.

dmitshur avatar Apr 01 '15 15:04 dmitshur

Ugh, I didn't know that I have to tag each minor version individually. Still, you're missing a ton of package development if you stick with 1.2.1, including bug fixes that will be undocumented to you. (I think we may have fixed a bug in the rotation matrices or something since then). Unfortunately, we just don't have the time/manpower to curate bugfixes for old Go versions.

If you can, I'd really recommend at least upgrading to 1.2.2. If it's impossible, I'll try and add the 1.2.1 tag to the commit with the 1.2.2 tag, with the caveat that I really don't recommend using it.

UserAB1236872 avatar Apr 13 '15 22:04 UserAB1236872

On review, perhaps we could refactor Mat/VecMN out of the core packages.

If we switch to RMO in order to comply with the Go f32 package, we should probably get rid of them anyway, and encourage people to use github.com/gonum/matrix for MN functionality.

UserAB1236872 avatar Apr 13 '15 22:04 UserAB1236872