[The expected tutorial: How to install WriteFreely on a Raspberry pi 3 in 10 steps](https://write.as/buttpicker/the-expected-tutorial-how-to-install-writefreely-on-a-raspberry-pi-3-in-10).
I did it! I finally got WriteFreely to run on my Arm server (check out [Scaleways baremetal cloud servers](https://www.scaleway.com/baremetal-cloud-servers/)).
It wasn't so easy because with 512MB of RAM I couldn't simply download and build the source on my webserver. Only solution: Cross compiling. Easy especially in Go, right?
If you read the article linked in the beginning you know how easy it could be. But as the article already mentions in an update, since Version 0.6 it is not working anymore because of the new SQLite dependency (newest version as of writing this article is 0.7).
With a bit of research I figured out what to do to make it work anyhow. There are two solutions. A quick (and slightly dirty) one for people who don't need SQLite support and a correct solution that needs a tad more effort.
## Quick solution: remove SQLite support
SQLite support makes problems with the cross compiling because it needs some C code to be compiled. Before figuring out how to make this working with the otherwise super easy Go cross compiling, removing the feature might be a viable quick fix. For this, simply change or remove all occurences of sqlite in the Makefile:
@hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
```
Now just go on as described in the original article and it should work:
```bash
env GOARCH=arm GOARM=7 go get github.com/writeas/writefreely/cmd/writefreely
```
## The correct solution
To get WriteFreely cross compiled with SQLite support, a C cross compiler is needed. Void Linux, the distribution of my choice, offers a bunch of packages for all kind of architectures. They are called for example `cross-armv7l-linux-gnueabihf` (ARMv7), `cross-arm-linux-gnueabihf` (ARMv6) or `cross-arm-linux-gnueabi` (ARMv5). I found similar packages in AUR (for Arch Linux).
As soon as the corresponding cross compiler is found, go can be told to use it:
```sh
env CGO_ENABLED=1 CC=armv7l-linux-gnueabihf-gcc GOOS=linux GOARCH=arm GOARM=7 make
```
The environment variables used are:
`CGO_ENABLED=1` should be obvious. It tells Go to enable the C compilation.
`CC=armv...` tells Go which C compiler to use. Usually this would be just `gcc`. In this case it is the name of the cross compiler. Please set it to the compiler for your target platform. I'm going to use ARMv7 examples here. It is the name of a directory found in `/usr/`, eg `/usr/armv7l-linux-gnueabihf`. Initially that failed for me though because it expected to find a file `./lib/libc.so` which ended up in another subfolder `/usr/`. So I cheated a bit and did: