# Compiling filebeat for ppc64 h/w using go complier - issues

**URL:** <https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 17, 2020, 10:23pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682 "2020-02-17T22:23:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [February 17, 2020, 10:23pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/1 "2020-02-17T22:23:09Z")

</div>

Hi, I'm attempting to compile filebeat from source using go compiler v1.13.8 as per this document: [https://www.elastic.co/guide/en/beats/devguide/7.x/beats-contributing.html](https://www.elastic.co/guide/en/beats/devguide/7.x/beats-contributing.html)

However, when I run the make command - I see this error:

[xxxxxxxxxxxxxxxxxx]# make  
go build -i -ldflags "-X [github.com/elastic/beats/libbeat/version.buildTime=2020-02-17T22:17:09Z](http://github.com/elastic/beats/libbeat/version.buildTime=2020-02-17T22:17:09Z) -X [github.com/elastic/beats/libbeat/version.commit=6d0d0ae079e5cb1d4f224801ac6df926dfb1594c](http://github.com/elastic/beats/libbeat/version.commit=6d0d0ae079e5cb1d4f224801ac6df926dfb1594c)"  
build [github.com/elastic/beats/filebeat:](http://github.com/elastic/beats/filebeat:) cannot load [4d63.com/tz:](http://4d63.com/tz:) open /opt/apps/go/src/4d63.com/tz: no such file or directory  
make: \*\*\* [filebeat] Error 1

I understand the support on power h/w is very limited from elastic support, and so reaching out here for help.

Thanks!

---

<div class="post-metadata">

**Author:** ![Michael\_Madden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_madden/32/46640_2.png) [@Michael\_Madden](https://discuss.elastic.co/u/Michael_Madden)\
**Post date:** [February 18, 2020, 2:39am UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/2 "2020-02-18T02:39:23Z")

</div>

Hello, thanks for reaching out about building filebeat. Are you trying to build filebeat for a Linux distribution on ppc64? If so what Linux distribution are you using? It's possible that you'll be able to build filebeat on a ppc64 system running Linux. I've seen similar posts where folks built beats on a RHEL 7 ppc64 system.

The error you included is interesting. The _tz_ library is a dependency for beats. Do the following commands work on your ppc64 system?

`go get -u 4d63.com/tz`

`go get -u https://github.com/leighmcculloch/go-tz`

---

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [February 18, 2020, 3:05pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/3 "2020-02-18T15:05:33Z")

</div>

Thanks Michael, I tried to run the two commands (although second one didn't work as expected due to an error, and so had to git clone). But now, I see this error when ran the make command:

[xxxxxxxxxxxxxx filebeat]# make  
go build -i -ldflags "-X [github.com/elastic/beats/libbeat/version.buildTime=2020-02-18T15:03:30Z](http://github.com/elastic/beats/libbeat/version.buildTime=2020-02-18T15:03:30Z) -X [github.com/elastic/beats/libbeat/version.commit=6d0d0ae079e5cb1d4f224801ac6df926dfb1594c](http://github.com/elastic/beats/libbeat/version.commit=6d0d0ae079e5cb1d4f224801ac6df926dfb1594c)"  
go: inconsistent vendoring in /opt/apps/go/src:  
go.mod requires [4d63.com/embedfiles](http://4d63.com/embedfiles) v1.0.0 but vendor/modules.txt does not include it.  
run 'go mod tidy; go mod vendor' to sync  
make: \*\*\* [filebeat] Error 1

I tried to run the command: go mod tidy; go mod vendor' to sync', but still erroring with same reason after the fact.

---

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [February 18, 2020, 3:07pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/4 "2020-02-18T15:07:29Z")

</div>

Also, this is RHEL 7 on ppc64 system.

---

<div class="post-metadata">

**Author:** ![Michael\_Madden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_madden/32/46640_2.png) [@Michael\_Madden](https://discuss.elastic.co/u/Michael_Madden)\
**Post date:** [February 18, 2020, 4:12pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/5 "2020-02-18T16:12:32Z")

</div>

Good catch on the the second `go get` command. It should have been this:

`go get -u github.com/leighmcculloch/go-tz`

---

<div class="post-metadata">

**Author:** ![Michael\_Madden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_madden/32/46640_2.png) [@Michael\_Madden](https://discuss.elastic.co/u/Michael_Madden)\
**Post date:** [February 18, 2020, 4:24pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/6 "2020-02-18T16:24:40Z")

</div>

Do you also get a similar error when running this command?

`go get -u 4d63.com/tz`

Are you building filebeat from master? I wonder if you'd run in the same issue on a branch that's been released? Would you mind trying something like this?

```auto
git checkout 7.6
cd filebeat
make

```

---

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [February 18, 2020, 7:31pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/7 "2020-02-18T19:31:06Z")

</div>

I was able to run the command "go get -u [4d63.com/tz](http://4d63.com/tz)". However, I see the same error ever after checking out filebeat v7.6:

[root@xxxxxxxx src]# go get -u [4d63.com/tz](http://4d63.com/tz)  
[root@xxxxxxxxx filebeat]# git branch

- (detached from v7.6.0)  
master  
[root@xxxxxxxx filebeat]# pwd  
/opt/apps/go/src/github.com/elastic/beats/filebeat  
[root@xxxxxxxx filebeat]# make  
go build -ldflags "-X [github.com/elastic/beats/libbeat/version.buildTime=2020-02-18T19:27:54Z](http://github.com/elastic/beats/libbeat/version.buildTime=2020-02-18T19:27:54Z) -X [github.com/elastic/beats/libbeat/version.commit=783999a3fd20b8d8bdc78db3156fd385d8840ef3](http://github.com/elastic/beats/libbeat/version.commit=783999a3fd20b8d8bdc78db3156fd385d8840ef3)"  
go: inconsistent vendoring in /opt/apps/go/src:  
go.mod requires [4d63.com/embedfiles](http://4d63.com/embedfiles) v1.0.0 but vendor/modules.txt does not include it.  
run 'go mod tidy; go mod vendor' to sync  
make: \*\*\* [filebeat] Error 1  
[root@xxxxxxxxxx filebeat]#

---

<div class="post-metadata">

**Author:** ![Michael\_Madden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_madden/32/46640_2.png) [@Michael\_Madden](https://discuss.elastic.co/u/Michael_Madden)\
**Post date:** [February 18, 2020, 8:00pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/8 "2020-02-18T20:00:50Z")

</div>

Hello,

Thanks for trying to build filebeat in the `7.6` branch. I'm wondering if the `GOPATH` and other variables are getting set correctly? Could you please try the following?

```auto
go env

```

I've ran into issues with other make targets like `make update` and `make docs` if I did not have `GOPATH` set correctly.

---

<div class="post-metadata">

**Author:** ![vee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vee/32/55759_2.png) [@vee](https://discuss.elastic.co/u/vee)\
**Post date:** [February 18, 2020, 8:09pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/9 "2020-02-18T20:09:57Z")

</div>

[root@xxxxxxxxxx filebeat-7.5.1-linux-ppc64le]# cd -  
/tmp  
[root@dc2-svzdev06 tmp]# go env  
GO111MODULE=""  
GOARCH="ppc64le"  
GOBIN=""  
GOCACHE="/root/.cache/go-build"  
GOENV="/root/.config/go/env"  
GOEXE=""  
GOFLAGS=""  
GOHOSTARCH="ppc64le"  
GOHOSTOS="linux"  
GONOPROXY=""  
GONOSUMDB=""  
GOOS="linux"  
GOPATH="/opt/apps/go"  
GOPRIVATE=""  
GOPROXY="[https://proxy.golang.org](https://proxy.golang.org),direct"  
GOROOT="/opt/apps/go"  
GOSUMDB="[sum.golang.org](http://sum.golang.org)"  
GOTMPDIR=""  
GOTOOLDIR="/opt/apps/go/pkg/tool/linux\_ppc64le"  
GCCGO="gccgo"  
GOPPC64="power8"  
AR="ar"  
CC="gcc"  
CXX="g++"  
CGO\_ENABLED="1"  
GOMOD=""  
CGO\_CFLAGS="-g -O2"  
CGO\_CPPFLAGS=""  
CGO\_CXXFLAGS="-g -O2"  
CGO\_FFLAGS="-g -O2"  
CGO\_LDFLAGS="-g -O2"  
PKG\_CONFIG="pkg-config"  
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build197465576=/tmp/go-build -gno-record-gcc-switches"

This is gopath that I used in the past, and it worked without errors for older version of filebeat/metricbeat (eg: v6.8 with older v of go). But once I upgraded go and working against latest beats - that is when I am noticing these errors.

---

<div class="post-metadata">

**Author:** ![Michael\_Madden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_madden/32/46640_2.png) [@Michael\_Madden](https://discuss.elastic.co/u/Michael_Madden)\
**Post date:** [February 18, 2020, 8:28pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/10 "2020-02-18T20:28:05Z")

</div>

Hello, thanks for the quick reply. That setting for `GOPATH` looks fine. I'll continue to brainstorm this issue.

Thanks.

---

<div class="post-metadata">

**Author:** ![Michael\_Madden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_madden/32/46640_2.png) [@Michael\_Madden](https://discuss.elastic.co/u/Michael_Madden)\
**Post date:** [February 25, 2020, 8:16pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/12 "2020-02-25T20:16:42Z")

</div>

I think the easiest approach would be to use the `elastic/golang-crossbuild` project to cross compile and package the binaries for ppc64le. Please let me know if you'd like me to post the details here.

> **[elastic/golang-crossbuild](https://github.com/elastic/golang-crossbuild)**
>
> Contribute to elastic/golang-crossbuild development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 24, 2020, 8:16pm UTC](https://discuss.elastic.co/t/compiling-filebeat-for-ppc64-h-w-using-go-complier-issues/219682/13 "2020-03-24T20:16:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
