Making Mender client binary file

when i execute this command go get github.com/mendersoftware/mender am getting terminated pls help me pls find image

Please update the mender sources. This issue got fixed in the latest branch as mentioned here

Hi @gpram,

As you are installing from source, see requirements in README file: https://github.com/mendersoftware/mender#requirements

If you are using a Debian based distribution, you need to install liblzma-dev package. You can also opt-out the dependency as it is explained in the README to not depend on such package.

when am execute this command
go get github.com/mendersoftware/mender
still am getting error some differenet… pls check image attachement

Hello,

Please use text logs and avoid pictures when possible.

It seems like you are executing github.com/mendersoftware/mender, which should be a directory. I don’t know what is happening, I think there must be something strange in your golang setup.

Try with the following commands and post here the output.

go get -d github.com/mendersoftware/mender
cd ~/go/src/github.com/mendersoftware/mender/
make
./mender

Note: if you have a set GOPATH, then cd into $GOPATH/src/github.com/mendersoftware/mender/ instead.

Okay, I think I know your output! The “#” symbols there are from the go get output, not your prompt as I originally thought.

Anyway, please try with make and copy us the logs.

thank u but when execute make command am getting error see bellow

go build -ldflags "-X main.Version=1.7.1"  
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
# github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb
mdb.c: In function ‘mdb_cursor_put’:
mdb.c:6535:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
      if (SIZELEFT(fp) < offset) {
         ^
mdb.c:6540:5: note: here
     case MDB_CURRENT:
     ^~~~
# github.com/mendersoftware/mender
/usr/bin/ld: $WORK/b001/_pkg1_.a(_x011.o): undefined reference to symbol 'pthread_mutexattr_setrobust@@GLIBC_2.12'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:37: recipe for target 'build' failed
make: *** [build] Error 2

Edit: @mirzak: prettify code

The gccgoflags warning is very suspicious. Which version of GO are you using?

Post the output of go version and go env.

go version go1.10.3 gccgo (Ubuntu 8.3.0-6ubuntu1~18.04) 8.3.0 linux/amd64

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pram/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/pram/go"
GORACE=""
GOROOT="/usr"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/gcc/x86_64-linux-gnu/8"
GCCGO="/usr/bin/x86_64-linux-gnu-gccgo-8"
CC="x86_64-linux-gnu-gcc-8"
CXX="x86_64-linux-gnu-g++-8"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build832412992=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

Edit: @mirzak: prettify output

Hi,

Okey, I was finally able to reproduce your problem :slight_smile: So I don’t know exactly why the linker is failing, there must be something missing in the flags. But I can see that you are using gcc-go compiler instead of the most common gc. Any special reason for it?

If you don’t have a good reason, change to the standard compiler and your problem will be gone.

If using Ubuntu:

apt remove gccgo gccgo-go
apt autoremove
apt install golang

Lluís

thank you bro your rocking…thank u so much i removed gccgo and gccgo-go
then i installed golang …its working now tthank you

After compilation has finished, the Mender binary is located at where …
may i know where i have to find Mender binary file

If you used the first approach (go get…), the mender binary will be in ~/go/bin/

If you used the second approach (go get -d … + cd… + make), the binary will be in ~/go/src/github.com/mendersoftware/mender/

i found out mender file in /go/src/github.com/mendersoftware/mender

is it mender file is binary file ?

That is correct!

ok thank you for supporting me … keep in touch bro …