1 of 1 people found this helpful
The C++ sketch code you enter into the IDE is saved to a temp area on your computer, combined with the source code that forms the Arduino library, which supplies the main() function and all of the abstractions of the hardware. The combined source is then compiled by a gcc cross-compiler installed on your host computer with the IDE. The binary code is stripped of unused calls to save space, linked with the libraries and prepared as an ELF binary to run as a linux user-space application once transferred to the Galileo board. The lsz tool sends the binary compiled application to the board and a sketch-runner script manages loading and running it.
You can bring up a linux command prompt on the board by connecting a serial terminal to the UART jack on the board. It is also possible to connect by ethernet as well.
Thanks for your response.
It was almost what I want to know. I now understand more about the intermediate stages. Unfortunately, I think you misunderstood my question about the terminal. I certainly know how to use the galileo terminal; my question was whether I can compile the code from a terminal without using the IDE. The simplest way is if the IDE exposes the commands it runs to compile and link. If it uses gcc, then it's accessible, the question remains if I can find the commands the IDE calls.
There is no compiler in the Linux system on the board.
However, the cross-compilers that the IDE uses are installed on your host computer. You can find them and call them directly from a terminal. They wind up in different places on Linux, Mac OSX and Windows, but you can get to them.