orbit icon indicating copy to clipboard operation
orbit copied to clipboard

Cross compile with linaro

Open tjohnsonhvac opened this issue 4 years ago • 3 comments

Hello, I have an embedded linux device that is too small to have a compiler installed so we cross compile everything in windows using linaro compiler.

system: Linux buildroot 4.9.28-pic6-geed43d1050 #12 PREEMPT Tue Sep 11 14:17:49 EDT 2018 armv7l GNU/Linux compiler: https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/arm-linux-gnueabihf/ (gcc-linaro-6.2.1-2016.11-i686-mingw32_arm-linux-gnueabihf)

Do you have any instructions or recommendations for cross compiling orbit?

tjohnsonhvac avatar Oct 28 '21 10:10 tjohnsonhvac

We unfortunately don't have any specific instructions. But I can quickly outline how it should work:

  1. The build workflow is based on the Conan package manager which supports cross compilation. Details are here: https://docs.conan.io/en/latest/systems_cross_building/cross_building.html#using-a-profile
  2. The linked section describes how to create a conan profile for cross compilation. You have to put this profile into your ~/.conan/profiles directory.
  3. I assume you only want to cross-compile the service. So you have to add the following to your profile:
[options]
OrbitProfiler:with_gui=False
  1. Then you can call ./build.sh <your_profile_name> from the Orbit repo root. This will create a build directory named build_<your_profile_name> and start the build. You should be able to find the compiled binary in build_<your_profile_name>/bin/OrbitService.

Cheers,
Henning

beckerhe avatar Oct 28 '21 11:10 beckerhe

I do have conan already set up to cross compile conan packages with the compiler (not the easiest to set up... lol), Ill give it a go.

when running as a service on linux, is there a way to connect a gui from windows so that we can use that super nice interface you guys have?

tjohnsonhvac avatar Oct 28 '21 11:10 tjohnsonhvac

Yes, but it's not super straight forward. You need an SSH tunnel to your embedded device that is forwarding port 44765. On the command line it's something like this: ssh -L 44765:localhost:44765 <hostname>.

Then you can start the UI with the option --local. In Windows .\Orbit.exe --local which makes it try to connect to localhost:44765.

If SSH is not an option you could also change the source code such that the --local option connects directly to an arbitrary hostname and such that the service listens on all interfaces. Currently both is hardcoded to localhost. If that's interesting to you I can look up the correct places in code.

beckerhe avatar Oct 28 '21 13:10 beckerhe