Open PepperJo opened 6 years ago
Ok it looks like go thinks the package is non-local if it is in the proper go_path. Compiling stratux in a different location seems to work. I guess step 16 should be changed in the wiki or did I do something wrong?
I've been going through the same build for a pi zero W here and had some problems with the GO setup as well. At least with the current version of go, it is recommended to install in /usr/local/go rather than in /root/go as the web instructions currently suggest. I ran in to some difficulty with how to install and build versus which user to use (pi or root.) Some additions to those instructs would help, or maybe the go install guidelines have changed?
Pepper, when you say it works in a different location, where did you try and as what user?
I changed my setup to install go in /user/local/go, then used the pi user home for stratux (/user/pi/go/github ...) , however I have not had a successful build yet. I am seeing:
go build _/home/pi/go/src/github.com/cyoung/stratux/godump978: invalid flag in #cgo CFLAGS: -L/home/pi/go/src/github.com/cyoung/stratux Makefile:17: recipe for target 'xgen_gdl90' failed make[1]: *** [xgen_gdl90] Error 1
Will investigate further.
I compiled as root user and I put go in /root as descibed in the wiki. However what does not work is putting the stratux code in /root/go_path/src/github.com/cyoung since it then believes stratux is a non-local package i.e. does not allow non-local imports. To fix this clone stratux in /root I guess the wiki should be updated to reflect this. Also potentially use a different go setup and maybe not compile everything as root...
I was wondering about those paths as well. I suspect /root/go_path/... is not correct? But I'm new to go, maybe that worked in older versions. In 1.10 is seems to be an issue that throws errors.
You can set your go path to whatever you want. You just need to set the GOPATH environment variable to point to it.
I had the same problem. I don't want to to install go and compile stratux as root, so I installed go the recommended way, and cloned stratux to /home/pi/ instead of /root/.
After following the instructions int he wiki, make
gave me: invalid flag in #cgo CFLAGS: -L/home/pi/stratux
I fixed this, apparently by adding another export (like the final step of the dev-setup instructions): export CGO_CFLAGS=-L/home/pi/stratux
alongside the line the final step specifies: export CGO_CFLAGS_ALLOW=-L/home/pi/stratux
Now compiling works. Also, I've added these lines to my ~/.profile (or ~/.bashrc) instead of /root/.bashrc.
And then, running sudo make install will encounter a problem with GOROOT not being set, which is really quite silly since the Makefile should just run go env GOROOT
and use that.
Stratux version:
Stratux config:
SDR
GPS
AHRS
power source: USB charger 5V/2A
usb cable:
EFB app and version: (e.g., WingX Pro7 8.6.2) N/A
EFB platform: (e.g., iOS 9.2) N/A
EFB hardware: (e.g., iPad Mini 2) N/A
Description of your issue:
I tried to setup a working developer SDcard by following the instructions in the wiki: https://github.com/cyoung/stratux/wiki/Setting-up-a-working-developer-sdcard
Unfortunately, I was unable to compile stratux:
Go version is: 1.10.2 but I also tried with 1.9
If possible, enable "Replay Logs", reproduce the problem, and provide a copy of the logs in http://192.168.10.1/logs/stratux/ and http://192.168.10.1/logs/stratux.log.