Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
manual:chapter1:buildfromsource [2018/01/03 12:24] claudio [Building the Desktop simulator] |
manual:chapter1:buildfromsource [2019/11/20 14:45] (current) 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): | + | |
- | git\\ | + | Packages to install (either use // |
- | libelf-dev\\ | + | |
- | libudev-dev\\ | + | |
- | If using other distros, verify that these other packages are installed: | + | < |
- | gcc\\ | + | git |
- | g++\\ | + | libelf-dev |
- | libc6-dev\\ | + | libudev-dev |
+ | </ | ||
- | and for Qt, some 3D related headers (even though not used by newRPL) are needed, therefore | + | If using other distros, verify that these other packages |
+ | < | ||
+ | gcc | ||
+ | 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: | ||
+ | < | ||
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** and **freeBSD** |
- | + | ||
- | **Linux** | + | |
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 ==== | ||
- | ===== Building the tools ===== | + | === elf2rom |
- | ==== elf2rom | + | The first tool that needs building is '' |
- | The first tool that needs building | + | - 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 Qt Creator, select Open Project, and go into newrpl-sources/ | + | It's done: the '' |
- | When prompted, just click on ' | + | === bmp2font === |
- | 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 | + | - 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 | ||
+ | - on the left toolbox, select the wrench '' | ||
+ | - make sure '' | ||
+ | - now from the top menu, '' | ||
+ | - from the bottom of the screen, check the '' | ||
- | ==== newRPL standalone compiler ==== | + | It's done: the '' |
- | Open Qt Creator, select Open Project, and go into newrpl-sources, | + | === newRPL standalone compiler === |
- | When prompted, just click on ' | + | - Open //Qt Creator//, select '' |
- | At the bottom-left of the screen, there will be an icon that looks like a screen and shows ' | + | - select the '' |
- | On the left toolbox, select the wrench ' | + | - when prompted, just click on '' |
- | Make sure ' | + | - at the bottom-left of the screen, there will be an icon that looks like a screen and shows '' |
- | Now from the top menu, ' | + | - on the left toolbox, select the wrench |
- | From the bottom of the screen, check the ' | + | - make sure '' |
+ | - now from the top menu, ''Build'', | ||
+ | - from the bottom of the screen, check the '' | ||
- | Finished, | + | It's done: the '' |
- | ===== Building the Desktop simulator ===== | + | ---- |
- | Open Qt Creator, select Open Project, and go into newrpl-sources, | + | ==== Building |
- | When prompted, just click on ' | + | - Open //Qt Creator//, select '' |
- | At the bottom-left of the screen, there will be an icon that looks like a screen and shows ' | + | - select the '' |
- | Now from the top menu, ' | + | - when prompted, just click on '' |
- | From the bottom of the screen, check the ' | + | - 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, ''Build'', | ||
+ | - from the bottom of the screen, check the '' | ||
- | At the lower left area of the screen, use the upper 'Play' | + | It's done: the '' |
- | ===== Building | + | At the lower left area of the screen, use the upper //Play// button (Run without debugging) to start the application. |
- | Open Qt Creator, select Open Project, and go into newrpl-sources, | + | ==== Building |
- | When prompted, just click on ' | + | - 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 | ||
- | Open a Terminal window and type: | + | '' |
+ | '' | ||
+ | '' | ||
- | '' | + | If you see that line, everything went well, and your build directory (usually named '' |
- | It will print the full path to a file called libgcc.a. Remember that path (without the file /libgcc.a). Back to Qt Creator, from the left pane open the file newrpl-fw.pro, and scroll down to a line that reads: | + | ---- |
- | '' | + | ==== Updating the source tree to a new version ==== |
- | Change that path to match exactly the path we got from the previous step. | + | When updates are made to the source tree |
- | + | ||
- | One last check, the line that reads: | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | 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, for other systems change that to / | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | 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: | + | |
- | + | ||
- | Binary image written to " | + | |
- | + | ||
- | If you see that line, everything went well, and your build directory (usually named build-newrpl-fw-Desktop....) will contain the newrplfw.bin file, which is the ROM that needs to be flashed on the calculator. | + | |
- | + | ||
- | ===== Updating the source tree to a new version ===== | + | |
- | + | ||
- | When updates are made to the source tree, open a terminal session and go inside the main source directory (usually newrpl-sources), | + | |
+ | - open a terminal session and go inside the main source directory (usually '' | ||
git pull | git pull | ||
- | + | </ | |
- | This will update the source code to the lastest version. Open QtCreator and open the newrpl-comp.pro project. On the Build menu, "Run QMake" then " | + | - [[buildfromsource# |
- | + | - with the updated compiler in place, close all projects | |
- | With the updated compiler in place, close all projects, open newrpl-ui.pro and do "Run QMake" then " | + | - finally, close all projects and [[buildfromsource# |
- | + | ||
- | Finally, close all projects and open newrpl-fw.pro (or the equivalent for other hardware targets), and also "Run QMake" and " | + |