# Build project failure

**URL:** <https://discuss.aerospike.com/t/build-project-failure/1745>\
**Category:** Go Client\
**Tags:** go\
**Created:** [September 3, 2015, 12:54pm UTC](https://discuss.aerospike.com/t/build-project-failure/1745 "2015-09-03T12:54:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton\_Ukolov](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Anton\_Ukolov](https://discuss.aerospike.com/u/Anton_Ukolov)\
**Post date:** [September 3, 2015, 12:54pm UTC](https://discuss.aerospike.com/t/build-project-failure/1745/1 "2015-09-03T12:54:42Z")

</div>

Hi All!

I’m trying to build project of our company on my laptop.

```
cd project_dir
go build

```

then i get this error:

```
# github.com/aerospike/aerospike-client-go/types/atomic
/home/sugar/go/src/github.com/aerospike/aerospike-client-go/types/atomic/int.go:72: undefined: atomic.SwapInt64

```

This the piece of code from /aerospike-client-go/types/atomic/int.go:

```
70 // GetAndSet atomically sets current value to the given value and returns the old value.
 71 func (ai *AtomicInt) GetAndSet(newValue int) int {
 72 return int(atomic.SwapInt64(&ai.val, int64(newValue)))
 73 }

go env
GOARCH="386"
GOBIN="/home/sugar/go/bin"
GOCHAR="8"
GOEXE=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/sugar/go:/usr/lib/go/contrib"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_386"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m32 -pthread"
CGO_ENABLED="1"

```

Any suggestions? I also tried to reinstall sync/atomic with command

```
go get -u sync/atomic

```

---

<div class="post-metadata">

**Author:** ![Khosrow\_Afroozeh](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@Khosrow\_Afroozeh](https://discuss.aerospike.com/u/Khosrow_Afroozeh)\
**Post date:** [September 3, 2015, 1:11pm UTC](https://discuss.aerospike.com/t/build-project-failure/1745/2 "2015-09-03T13:11:56Z")

</div>

Looks like you are trying to compile the Go client on a 32bit OS. Unfortunately, only 64bit machines are supported at the moment.

---

<div class="post-metadata">

**Author:** ![Anton\_Ukolov](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Anton\_Ukolov](https://discuss.aerospike.com/u/Anton_Ukolov)\
**Post date:** [September 3, 2015, 2:41pm UTC](https://discuss.aerospike.com/t/build-project-failure/1745/3 "2015-09-03T14:41:42Z")

</div>

Khosrow Afroozeh, thank you for reply!

I tried it also at my dev-server, virtual machine:

```
sugar@backend01:~$ go env
GOROOT="/usr/lib/go"
GOBIN=""
GOARCH="amd64"
GOCHAR="6"
GOOS="linux"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
CGO_ENABLED="1"

```

And i got exactly same result/

---

<div class="post-metadata">

**Author:** ![Khosrow\_Afroozeh](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@Khosrow\_Afroozeh](https://discuss.aerospike.com/u/Khosrow_Afroozeh)\
**Post date:** [September 3, 2015, 3:02pm UTC](https://discuss.aerospike.com/t/build-project-failure/1745/4 "2015-09-03T15:02:18Z")

</div>

Anton,

The atomic package is a part of Go std library. [atomic package - sync/atomic - Go Packages](https://golang.org/pkg/sync/atomic/#SwapInt64)

What is the go version you are using? Which linux distrib? How did you install Go? You may have an issue with your Go installation.

It is also always a good idea to do a `$ go get -u` for the client to make sure you are using the latest version.

---

<div class="post-metadata">

**Author:** ![Anton\_Ukolov](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Anton\_Ukolov](https://discuss.aerospike.com/u/Anton_Ukolov)\
**Post date:** [September 3, 2015, 3:40pm UTC](https://discuss.aerospike.com/t/build-project-failure/1745/5 "2015-09-03T15:40:20Z")

</div>

Khosrow\_Afroozeh,

`sugar@backend01:~$ go version

go version go1`

`sugar@backend01:~$ uname -a

Linux [backend01.setup-team.net](http://backend01.setup-team.net) 3.2.0-37-virtual #58-Ubuntu SMP Thu Jan 24 15:48:03 UTC 2013 x86\_64 x86\_64 x86\_64 GNU/Linux`

```
apt-get install golang

```

Yep, i think the same, some problems with my installation. Or bad proccessor emulation. But i have no time to expore, i got physical server with 64bit processor for my purposes, and there are all builds fine. I tried first “go get -u sync/atomic” and “go get -u all” before start this thread.

But anyway, Khosrow Afroozeh thank you very much for your help!

---

<div class="post-metadata">

**Author:** ![Khosrow\_Afroozeh](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@Khosrow\_Afroozeh](https://discuss.aerospike.com/u/Khosrow_Afroozeh)\
**Post date:** [September 3, 2015, 4:08pm UTC](https://discuss.aerospike.com/t/build-project-failure/1745/6 "2015-09-03T16:08:17Z")

</div>

You have installed a very old version of Go (version 1), which doesn’t have the atomic package.

Distributions are usually behind the curve when it comes to language versions, so if you want to install Go, it is better to install it via the instruction in their website: [Download and install - The Go Programming Language](https://golang.org/doc/install)

Don’t hesitate to reach out in case you encounter other issues.

Best, K.

---

<div class="post-metadata">

**Author:** ![Anton\_Ukolov](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Anton\_Ukolov](https://discuss.aerospike.com/u/Anton_Ukolov)\
**Post date:** [September 7, 2015, 5:43pm UTC](https://discuss.aerospike.com/t/build-project-failure/1745/7 "2015-09-07T17:43:03Z")

</div>

Khosrow\_Afroozeh,

I have installed latest Go on that VM, and now project builds fine.

Thank you for help!
