Compiling Bela projects on the board » History » Version 9
Version 8 (Andrew McPherson, 2015-07-19 05:51 PM) → Version 9/11 (Andrew McPherson, 2015-07-19 05:51 PM)
h1. Compiling BeagleRT projects on the board
A number of shell scripts are available in the scripts/ folder that allow you to edit your C++ files on the host machine, copy them over to the BBB and have your project built on the BBB without the need to install any tools on your host. The files need to be runing from
h2. @setup_board.sh@
This script copies the core BeagleRT files to the BeagleBone, REMOVING any previous files found at that location. This should be done before running any of the other build scripts in this directory.
h3. Arguments:
* *-b path* : changes the default path, which is otherwise ~/BeagleRT
h3. Usage:
<pre>
setup_board.sh [-b path]
</pre>
Run it with
<pre>
$ ./setup_board.sh
</pre>
You will be prompted with
<pre>
Warning: this script will DELETE any existing BeagleRT files from your BeagleBone! Continue?
</pre>
Press *y* to accept.
h2. @build_project.sh@
This script copies a directory of source files to the BeagleBone, compiles and runs it. The BeagleRT core files should have first been copied over using the @setup_board.sh@ script supplied with BeagleRT.
The source directory should contain at least one .c, .cpp or .S file.
h3. Arguments:
* *-n* : the executable will not be run after compiling.
* *-b path* : will change the local path on the BeagleBone where the BeagleRT files are found (must match the one used for @setup_board.ssh@.
* *-c* : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes.
* *-f* : runs the project in the foreground of the current terminal, within a screen session that can be detached later (ctrl-a ctrl-d to detach from the screen session).
* *-F*: runs the project in the foreground of the current terminal, without using screen
h3. Usage:
<pre>
build_project.sh [-ncfF][-b [-nc][-b path/to/BeagleRT/on/BBB] path/to/project/files
</pre>
<pre>
$ ./build_project.sh projects/your_project_folder
</pre>
you can list a mix of files and folders. These will be all copied to the ~/BeagleRT/source folder before compiling the project, e.g.:
<pre>
$ build_project.sh projects/your_project_folder/render.cpp projects/your_project_folder/extras/
# will include the render.cpp file and all the files and folders in extras/
</pre>
h2. @run_project.sh@
This script runs the most recently compiled BeagleRT project on the BBB at the given path.
h3. Arguments:
* *-b path* : changes the default path, which is otherwise ~/BeagleRT.
* *-c commands* : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes.
* *-f* : runs the project in the foreground of the current terminal, within a screen session that can be detached later (ctrl-a ctrl-d to detach from the screen session).
* *-F*: runs the project in the foreground of the current terminal, without using screen
h3. Usage:
<pre>
run_project.sh [-b path] [-c "commands"] [-fF] [-f]
</pre>
h2. @connect_to_project.sh@
This script brings an already running BeagleRT program to the foreground in the terminal, so it can be run interactively (e.g.: you can display the standard output).
h2. @set_startup.sh@
This script enables or disables running BeagleRT when the board starts up. Run it to make your script start automatically every time you power up the board. If the *-n* argument is passed, auto-running at startup is disabled. Otherwise, it is enabled. Like @run_project.sh@, the *-c* argument allows command line arguments to be passed to the program. The *-l* argument will run the BeagleRT program in a loop, automatically restarting it if it quits or crashes.
h2. @stop_running.sh@
This script stops the BeagleRT program running on the BeagleBone.
h2. @halt_board.sh@
This script halts the BeagleBone Black. Run it and wait for the on-board LEDs to stop blinking before disconnecting the board.
A number of shell scripts are available in the scripts/ folder that allow you to edit your C++ files on the host machine, copy them over to the BBB and have your project built on the BBB without the need to install any tools on your host. The files need to be runing from
h2. @setup_board.sh@
This script copies the core BeagleRT files to the BeagleBone, REMOVING any previous files found at that location. This should be done before running any of the other build scripts in this directory.
h3. Arguments:
* *-b path* : changes the default path, which is otherwise ~/BeagleRT
h3. Usage:
<pre>
setup_board.sh [-b path]
</pre>
Run it with
<pre>
$ ./setup_board.sh
</pre>
You will be prompted with
<pre>
Warning: this script will DELETE any existing BeagleRT files from your BeagleBone! Continue?
</pre>
Press *y* to accept.
h2. @build_project.sh@
This script copies a directory of source files to the BeagleBone, compiles and runs it. The BeagleRT core files should have first been copied over using the @setup_board.sh@ script supplied with BeagleRT.
The source directory should contain at least one .c, .cpp or .S file.
h3. Arguments:
* *-n* : the executable will not be run after compiling.
* *-b path* : will change the local path on the BeagleBone where the BeagleRT files are found (must match the one used for @setup_board.ssh@.
* *-c* : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes.
* *-f* : runs the project in the foreground of the current terminal, within a screen session that can be detached later (ctrl-a ctrl-d to detach from the screen session).
* *-F*: runs the project in the foreground of the current terminal, without using screen
h3. Usage:
<pre>
build_project.sh [-ncfF][-b [-nc][-b path/to/BeagleRT/on/BBB] path/to/project/files
</pre>
<pre>
$ ./build_project.sh projects/your_project_folder
</pre>
you can list a mix of files and folders. These will be all copied to the ~/BeagleRT/source folder before compiling the project, e.g.:
<pre>
$ build_project.sh projects/your_project_folder/render.cpp projects/your_project_folder/extras/
# will include the render.cpp file and all the files and folders in extras/
</pre>
h2. @run_project.sh@
This script runs the most recently compiled BeagleRT project on the BBB at the given path.
h3. Arguments:
* *-b path* : changes the default path, which is otherwise ~/BeagleRT.
* *-c commands* : passes command-line arguments to the BeagleRT program; enclose the argument string in quotes.
* *-f* : runs the project in the foreground of the current terminal, within a screen session that can be detached later (ctrl-a ctrl-d to detach from the screen session).
* *-F*: runs the project in the foreground of the current terminal, without using screen
h3. Usage:
<pre>
run_project.sh [-b path] [-c "commands"] [-fF] [-f]
</pre>
h2. @connect_to_project.sh@
This script brings an already running BeagleRT program to the foreground in the terminal, so it can be run interactively (e.g.: you can display the standard output).
h2. @set_startup.sh@
This script enables or disables running BeagleRT when the board starts up. Run it to make your script start automatically every time you power up the board. If the *-n* argument is passed, auto-running at startup is disabled. Otherwise, it is enabled. Like @run_project.sh@, the *-c* argument allows command line arguments to be passed to the program. The *-l* argument will run the BeagleRT program in a loop, automatically restarting it if it quits or crashes.
h2. @stop_running.sh@
This script stops the BeagleRT program running on the BeagleBone.
h2. @halt_board.sh@
This script halts the BeagleBone Black. Run it and wait for the on-board LEDs to stop blinking before disconnecting the board.