|
RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
|
You can obtain the latest RcdMathLib code from our GitLab repository either by downloading the Eclipse project for resource-limited devices zip file, the Eclipse project for full-fledged devices zip file, or by cloning the git repository.
In order to clone the RcdMathLib repository, you need the Git revision control system and run the following command:
RcdMathLib can be run on full-fledged devices such as a Personal Computer (PC) or a server. It can also be executed on the embedded system Raspberry Pi running an Operating System (OS) such as the Raspbian or the Ubuntu Core. We recommend the GNU Compiler Collection (GCC) to compile the RcdMathLib on operating systems like the Linux or Windows. We also recommend the use of the Eclipse (IDE).
The PATH environment variable should be set with bin-directory of the GCC compiler. On a typical shell like bash or zsh this can be done using export, e.g.
export PATH=${PATH}:/path/to/gcc/bin
For windows, add the bin-directory to your PATH under System Properties->Advanced-> Environment Variables, e.g.
"C:\gcc\bin"
Depending on the hardware you want to use, you need to first install a corresponding toolchain. We recommend the use of the RIOT-OS, since it supports 8-bit platforms (e.g. Arduino Mega 2560), 16-bit platforms (e.g. MSP430), and 32-bit platforms (e.g. ARM). The RIOT-OS is an open source IoT operating system developed at the ''Freie Universität Berlin''. In general, an OS allows the management and sharing of resources as well as the development of multi-tasking applications in a computer system. The Wiki on RIOT's Github page contains a lot of information that can help you with your platform:
RcdMathLib can be built using the Eclipse IDE for C/C++ Developers. The simplest way to compile and link an application with the RcdMathLib is: Firstly, download the RcdMathLib_full_fledged_devices.zip file or clone it as follows:
After cloning or downloading the RcdMathLib, the Eclipse version of the RcdMathLib can be used as follows:
Another method to use the RcdMathLib in the Eclipse IDE is:
Hello World ANSI C Project, as well as the Cross GCC Tool-chains.Hello World ANSI C Project.Import the 'eclipse_path_includes_settings.xml' file as follows:
- Open File -> Import -> C/C++ and Select ''C/C++ Project Settings'' from the Selection Wizard.
- Click Next->''Select Settings file''-->Browse.
- After Browsing to the xml-configuration file, click on Finish.
RcdMathLib and RIOT use GNU make as build system. The simplest way to compile and link an application with RcdMathLib, is to use the Eclipse project for resource-limited devices and set up a Makefile providing at least the following variables:
APPLICATION: should contain the (unique) name of your applicationBOARD: specifies the platform the application should be build for by defaultRIOTBASE: specifies the path to the copy of the RIOT repository (note, the macro can be used to give a relative path)RCDMATHLIB: specifies the path to the copy of the RcdMathLib repository (note, the macro can be used to give a relative path)USEMODULE: specifies the module of the RcdMathLib that you may want to useAdditionally it has to include the Makefile.include, located in RcdMathLib's as well as RIOT's root directories. A minimal application Makefile looks like this:
The ?= operator can be used in order to allow overwriting variables from the command line. For example, the target platform can be specified from the command line as follows:
In this case the STM32F4 discovery board is specified. Furthermore, the basic operations sub-module is selected by the USEMODULE macro.
Other sub-modules such as the matrix decompositions or utilities modules can be selected, e.g.:
The dependency of the RcdMathLib modules and sub-modules to each other is automatically calculated by special Makefiles located in the module directories.
Besides typical targets like clean, all, or doc, RIOT provides the special targets flash and term to invoke the configured flashing and terminal tools for the specified platform. These targets use the variable PORT for the serial communication to the device. Neither this variable nor the targets flash and term are mandatory for the native port.
Unless specified otherwise, make will create an elf-file as well as an Intel hex file in the bin folder of your application directory.
Please visit the Wiki to learn more about the build system of the RIOT.
RcdMathLib provides a number of examples in the examples-directory. Every example has a README that documents its usage and its purpose. Furthermore the examples are described in the doc-directory. You can build your own application or the examples by typing:
or
into your shell.
To flash the application to a board just type
You can then access the board via the serial interface:
If you are using multiple boards you can use the PORT macro to specify the serial interface:
We use pyterm as the default terminal application. It is shipped with RIOT in the dist/tools/pyterm/ directory. If you choose to use another terminal program you can set TERMPROG (and if need be the TERMFLAGS) macros:
Please visit the Wiki to learn more about flashing devices.