@@ -95,15 +95,13 @@ Finally, install EMB² with *administrator privileges*:
...
@@ -95,15 +95,13 @@ Finally, install EMB² with *administrator privileges*:
EMB² provides several options which allow you to configure it to your needs. This section explains these options and describes the build process in more detail.
EMB² provides several options which allow you to configure it to your needs. This section explains these options and describes the build process in more detail.
#### Generation of Native Build Files
#### 1. Generation of Native Build Files
As mentioned above, it is recommended to build EMB² in a subdirectory, e.g., "build". The actual build files are generated by the following command (a list of available generators can be displayed by typing `cmake --help`):
As mentioned above, it is recommended to build EMB² in a subdirectory, e.g., "build". The actual build files are generated by the following command (a list of available generators can be displayed by typing `cmake --help`):
cmake -G <generator> .. [OPTIONS]
cmake -G <generator> .. [OPTIONS]
Note that on Linux, the architecture (32/64 bit) cannot be selected by the generator. The default is "Unix Makefiles" for which reason option `-G <generator>` can be omitted.
Note that on Linux, the architecture (32/64 bit) cannot be selected by the generator. The default is "Unix Makefiles" for which reason `-G <generator>` may be omitted.
#### Options
EMB² can be built in Release or Debug mode. The latter contains additional checks during runtime and is only recommended for development purposes. On Linux, the build mode can be specified using the option `-DCMAKE_BUILD_TYPE=[Release|Debug]`, for example:
EMB² can be built in Release or Debug mode. The latter contains additional checks during runtime and is only recommended for development purposes. On Linux, the build mode can be specified using the option `-DCMAKE_BUILD_TYPE=[Release|Debug]`, for example:
...
@@ -122,19 +120,17 @@ In the same way, you may cross compile to another platform. For example, to cros
...
@@ -122,19 +120,17 @@ In the same way, you may cross compile to another platform. For example, to cros
-DCMAKE_C_COMPILER=arm-linux-gnueabi-gcc \
-DCMAKE_C_COMPILER=arm-linux-gnueabi-gcc \
-DCMAKE_C_FLAGS=-march=armv7-a
-DCMAKE_C_FLAGS=-march=armv7-a
EMB² can be built with (default) and without C++ exception handling. When exceptions are turned off, a message is emitted in case of an error and the program aborts. To disable exceptions, add the option `-DUSE_EXCEPTIONS=OFF`.
EMB² can be built with C++ exception handling (default) or without exceptions. When exceptions are turned off, a message is emitted in case of an error and the program aborts. To disable exceptions, add the option `-DUSE_EXCEPTIONS=OFF`.
Similarly, automatic initialization of the task scheduler by the MTAPI C++ interface can be disabled with `-DUSE_AUTOMATIC_INITIALIZATION=OFF`. This way, unexpected delays after startup can be avoided, e.g. for timing measurements.
Similarly, automatic initialization of the task scheduler by the MTAPI C++ interface can be disabled with `-DUSE_AUTOMATIC_INITIALIZATION=OFF`. This way, unexpected delays after startup can be avoided, e.g. for timing measurements.
The tutorial of EMB² comes with a number of examples in `doc/examples/`. These can be built with the other source files using the option `-DBUILD_EXAMPLES=ON`. Note, however, that the examples use C++11 features and require a corresponding compiler.
The tutorial of EMB² comes with a number of examples in `doc/examples/`. These can be built with the other source files using the option `-DBUILD_EXAMPLES=ON`. Note, however, that the examples use C++11 features and require a recent compiler.
By default, the included unit tests are built as part of the installation process. To override the default behavior, add the option `-DBUILD_TESTS=OFF`.
By default, the included unit tests are built as part of the installation process. To override the default behavior, add the option `-DBUILD_TESTS=OFF`.
### 2. Compiling and linking
#### 2. Compiling and Linking
As the next step, you can compile the library using the generated build files.
As the next step, you can compile the library using the generated build files. On Linux, the build mode (Release|Debug) is already given in the build files, whereas on Windows, it has to be specified now.
On Linux, the build mode (Release|Debug) is already given in the build files,
whereas on Windows, it has to be specified now.
For a Linux build, type
For a Linux build, type
...
@@ -144,10 +140,9 @@ For a Windows Release build, type
...
@@ -144,10 +140,9 @@ For a Windows Release build, type
cmake --build . --config Release
cmake --build . --config Release
### 3. Running the tests
#### 3. Running the Tests
To check whether EMB² was compiled correctly, run the tests. The test
To check whether EMB² was compiled correctly, run the tests. The test executables are contained in the subfolder "binaries".
executables are contained in the subfolder "binaries".
On Linux, type
On Linux, type
...
@@ -157,9 +152,9 @@ On Windows, type
...
@@ -157,9 +152,9 @@ On Windows, type
binaries\run_tests.bat
binaries\run_tests.bat
If no error message occurs, EMB² is working fine.
If no error message occurs, EMB² works fine.
### 4. Installation
#### 4. Installation
The default installation path on Linux is
The default installation path on Linux is
...
@@ -167,7 +162,11 @@ The default installation path on Linux is
...
@@ -167,7 +162,11 @@ The default installation path on Linux is
and on Windows
and on Windows
C:\Program Files\embb-X.Y.Z\ or C:\Program Files (x86)\embb-X.Y.Z
C:\Program Files\embb-X.Y.Z\
or
C:\Program Files (x86)\embb-X.Y.Z
depending on the target architecture.
depending on the target architecture.
...
@@ -175,8 +174,6 @@ If you want a different installation path, you can change it now by typing
...
@@ -175,8 +174,6 @@ If you want a different installation path, you can change it now by typing
cmake -DINSTALL_PREFIX=YourCustomPath ..
cmake -DINSTALL_PREFIX=YourCustomPath ..
The option "-DINSTALL_PREFIX=YourCustomPath" can also be given in Step 1.