Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
manual:chapter1:buildfromsource [2018/01/01 20:47] claudio |
manual:chapter1:buildfromsource [2019/11/20 14:31] jojo1973 |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Building newRPL from source code ====== | + | ===== Building newRPL from source code ===== |
- | + | ==== Preparing a system for compiling the simulator ==== | |
- | ===== Preparing a system for compiling the simulator | + | |
**Linux** | **Linux** | ||
- | The following instructions are for Ubuntu, package names might change slightly on other distros. | + | The following instructions are for //Ubuntu//, package names might change slightly on other distros. |
- | Packages to install (either use synaptic package manager, or apt): | + | Packages to install (either use //synaptic// package manager, or //apt//): |
- | git\\ | + | < |
- | libelf-dev\\ | + | git |
- | libudev-dev\\ | + | libelf-dev |
+ | libudev-dev | ||
+ | </ | ||
- | If using other distros, verify that these other packages are installed:\\ | + | If using other distros, verify that these other packages are installed: |
- | gcc\\ | + | < |
- | g++\\ | + | gcc |
- | libc6-dev\\ | + | g++ |
- | + | libc6-dev | |
- | and for Qt, some 3D related headers (even though not used by newRPL) are needed, therefore these packages need to be installed as well: | + | </ |
+ | and for //Qt//, some 3D related headers (even though not used by **newRPL**) are needed, therefore these packages need to be installed as well: | ||
+ | < | ||
libgl-dev | libgl-dev | ||
+ | </ | ||
+ | Time to install the //Qt// framework. | ||
- | Time to install the Qt framework, go to [[http:// | + | - Go to [[http:// |
- | When it's time to select components, it's very important to open the lists and select a library version and target. **The installer will not select a library version by default**, and failing to select one will leave you without a proper library and unable to build newRPL. Select the latest Qt version (5.10.0 at the time of this writing), the only component needed is the one labeled | + | - change the permissions to allow executing it as a program and run it to install |
+ | - when it's time to select components, it's very important to open the lists and select a library version and target. **The installer will not select a library version by default**, and failing to select one will leave you without a proper library and unable to build **newRPL**. Select the latest | ||
**freeBSD** | **freeBSD** | ||
- | In order to use Qt Creator, a graphical desktop needs to be installed (that' | + | In order to use //Qt Creator//, a graphical desktop needs to be installed (that' |
- | Packages to install (either using pkg or OctoPkg): | + | |
- | git\\ | + | Packages to install (either using //pkg// or // |
- | qt5\\ | + | |
- | qtcreator\\ | + | < |
+ | git | ||
+ | qt5 | ||
+ | qtcreator | ||
+ | </ | ||
And that's all that's required. | And that's all that's required. | ||
For developers wishing to cooperate with the project, another package is needed: | For developers wishing to cooperate with the project, another package is needed: | ||
+ | < | ||
gdb | gdb | ||
+ | </ | ||
- | Once the packages are installed, start Qt Creator, and navigate the menus and dialogs through Tools, Options... Build& | + | Once the packages are installed, |
+ | - start //Qt Creator//, and navigate the menus and dialogs through | ||
+ | - verify | ||
- | ===== Preparing a system for cross-compiling the firmware | + | ==== Preparing a system for cross-compiling the firmware ==== |
**Linux** | **Linux** | ||
- | The following instructions are for Ubuntu, package names might change slightly on other distros. | + | The following instructions are for //Ubuntu//, package names might change slightly on other distros. |
- | + | ||
- | Packages to install (either use synaptic package manager, or apt): | + | |
+ | Packages to install (either use // | ||
+ | < | ||
gcc-arm-none-eabi | gcc-arm-none-eabi | ||
+ | </ | ||
- | Other packages like binutils-arm-none-eabi will be installed automatically, | + | Other packages like |
+ | < | ||
+ | binutils-arm-none-eabi | ||
+ | </ | ||
+ | will be installed automatically, | ||
**freeBSD** | **freeBSD** | ||
- | Packages to install (either use pkg or OctoPkg): | + | Packages to install (either use //pkg// or //OctoPkg//): |
+ | < | ||
+ | arm-none-eabi-gcc | ||
+ | </ | ||
- | arm-none-eabi-gcc\\ | ||
- | + | ==== Getting the source code ==== | |
- | ===== Getting the source code ===== | + | |
**Linux** | **Linux** | ||
Line 70: | Line 88: | ||
While at your user's home, open a terminal and run: | While at your user's home, open a terminal and run: | ||
- | git clone https:// | + | '' |
- | + | ||
- | + | ||
- | + | ||
- | ===== Building the tools ===== | + | |
- | + | ||
- | ==== elf2rom ==== | + | |
- | + | ||
- | The first tool that needs building is elf2rom. | + | |
- | + | ||
- | Open Qt Creator, select Open Project, and go into newrpl-sources/ | + | |
- | + | ||
- | When prompted, just click on 'Configure project'. | + | |
- | At the bottom-left of the screen, there will be an icon that looks like a screen and shows ' | + | |
- | On the left toolbox, select the wrench ' | + | |
- | Make sure ' | + | |
- | Now from the top menu, ' | + | |
- | From the bottom of the screen, check the ' | + | |
- | + | ||
- | It's done, the elf2rom tool was built and installed in the appropriate location to be used by the other projects. Select 'Close all projects and editors' | + | |
- | + | ||
- | ==== newRPL standalone compiler ==== | + | |
- | + | ||
- | Open Qt Creator, select Open Project, and go into newrpl-sources, | + | |
- | When prompted, just click on ' | ||
- | At the bottom-left of the screen, there will be an icon that looks like a screen and shows ' | ||
- | On the left toolbox, select the wrench ' | ||
- | Make sure ' | ||
- | Now from the top menu, ' | ||
- | From the bottom of the screen, check the ' | ||
- | Finished, the newrpl-comp tool was built and installed in the appropriate location to be used by the other projects. | ||
- | ===== Building the Desktop simulator ===== | + | ==== Building the tools ==== |
- | Open Qt Creator, select Open Project, and go into newrpl-sources, | + | === elf2rom === |
- | When prompted, just click on ' | + | The first tool that needs building is '' |
- | At the bottom-left of the screen, there will be an icon that looks like a screen and shows ' | + | |
- | Now from the top menu, ' | + | |
- | From the bottom of the screen, check the 'Compile Output' | + | |
- | At the lower left area of the screen, | + | - Open //Qt Creator//, select '' |
+ | - select the '' | ||
+ | - when prompted, just click on '' | ||
+ | - at the bottom-left of the screen, | ||
+ | - on the left toolbox, select the wrench '' | ||
+ | - make sure '' | ||
+ | - now from the top menu, '' | ||
+ | - from the bottom of the screen, check the '' | ||
- | ===== Building | + | It's done: the '' |
- | Open Qt Creator, select Open Project, and go into newrpl-sources, | + | === Building |
- | When prompted, just click on ' | + | - Open //Qt Creator//, select '' |
+ | - select the '' | ||
+ | - when prompted, just click on '' | ||
+ | - at the bottom-left of the screen, there will be an icon that looks like a screen and shows '' | ||
+ | - on the left toolbox, select the wrench '' | ||
+ | - make sure '' | ||
+ | - now from the top menu, '' | ||
+ | - from the bottom of the screen, check the '' | ||
- | Open a Terminal window and type: | + | It's done: the '' |
- | '' | + | ==== Building the newRPL desktop simulator ==== |
- | It will print the full path to a file called libgcc.a. Remember | + | - Open //Qt Creator//, select '' |
+ | - select | ||
+ | - when prompted, just click on '' | ||
+ | - at the bottom-left of the screen, there will be an icon that looks like a screen and shows '' | ||
+ | - on the left toolbox, select the wrench '' | ||
+ | - make sure '' | ||
+ | - now from the top menu, '' | ||
+ | - from the bottom of the screen, check the '' | ||
- | '' | + | It's done: the '' |
- | Change that path to match exactly | + | At the lower left area of the screen, use the upper //Play// button (Run without debugging) to start the application. |
- | One last check, | + | ==== Building |
- | '' | + | - Open //Qt Creator//, select |
+ | - when prompted, just click on '' | ||
+ | - open a Terminal window and type< | ||
+ | arm-none-eabi-gcc -print-libgcc-file-name | ||
+ | </ | ||
+ | - back to //Qt Creator//, from the left pane open the file '' | ||
+ | GCC_LIBDIR = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</ | ||
+ | - one last check: locate the line that reads< | ||
+ | INCLUDEPATH += firmware/ | ||
+ | </ | ||
+ | - another possible alternative for 64-bit systems is to install the package< | ||
+ | libc6-dev-i386 | ||
+ | </ | ||
+ | INCLUDEPATH += firmware/ | ||
+ | - save and close the file; | ||
+ | - now from the top menu, '' | ||
+ | - from the bottom of the screen, check the '' | ||
+ | |||
+ | To verify that it completed the build, the last output line should read | ||
- | The xxxxxxxxxxxxxx should point to suitable headers. In particular on a 64-bit system the system headers might be incompatible and cause errors. The first attempt should be to keep the defaults, and if any errors appear, it needs to be changed to / | + | '' |
- | For Ubuntu it works with the defaults, | + | '' |
+ | '' | ||
- | '' | + | If you see that line, everything went well, and your build directory (usually named '' |
- | Save and close the file. | + | ==== Updating |
- | Now from the top menu, ' | + | |
- | From the bottom of the screen, check the ' | + | |
- | To verify that it completed the build, the last output line should read: | + | |
- | Binary image written | + | When updates are made to the source tree |
- | If you see that line, everything went well, and your build directory (usually | + | - open a terminal session |
+ | git pull | ||
+ | </ | ||
+ | - [[buildfromsource# | ||
+ | - check the compile output to make sure the new version was copied to '' | ||
+ | - with the updated compiler in place, close all projects and [[buildfromsource# | ||
+ | - finally, close all projects and [[buildfromsource# |