Skip to content

Commit 0750cbd

Browse files
committed
ROUTING-1182: adding cross-compilation instructions where missing for Infrastructure Services
1 parent fbd3233 commit 0750cbd

File tree

11 files changed

+268
-1
lines changed

11 files changed

+268
-1
lines changed

examples/cloud_discovery_service/library_api/c++11/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,30 @@ you want to link against. For example:
112112
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
113113
```
114114

115+
### Cross-compilation
116+
117+
When you need to cross-compile the example, the above
118+
command will not work, the assigned compiler won't be the cross-compiler and
119+
errors may happen when linking against the cross-compiled Connext binaries.
120+
To fix this, you have to create a file with the architecture name and call
121+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
122+
An example of the file to create with the toolchain settings (e.g. for an
123+
ARM architectures):
124+
125+
```cmake
126+
set(CMAKE_SYSTEM_NAME Linux)
127+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
128+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
129+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
130+
```
131+
132+
Then you can call CMake like this:
133+
134+
```bash
135+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
136+
-DCONNEXTDDS_ARCH=<connext architecture> ..
137+
```
138+
115139
### CMake Build Infrastructure
116140

117141
The `CMakeListst.txt` script that builds this example uses a generic CMake

examples/cloud_discovery_service/library_api/c/README.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,33 @@ you want to link against. For example:
112112
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
113113
```
114114

115+
### Cross-compilation
116+
117+
When you need to cross-compile the example, the above
118+
command will not work, the assigned compiler won't be the cross-compiler and
119+
errors may happen when linking against the cross-compiled Connext binaries.
120+
To fix this, you have to create a file with the architecture name and call
121+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
122+
An example of the file to create with the toolchain settings (e.g. for an
123+
ARM architectures):
124+
125+
```cmake
126+
set(CMAKE_SYSTEM_NAME Linux)
127+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
128+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
129+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
130+
```
131+
132+
Then you can call CMake like this:
133+
134+
```bash
135+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
136+
-DCONNEXTDDS_ARCH=<connext architecture> ..
137+
```
138+
115139
### CMake Build Infrastructure
116140

117-
The `CMakeListst.txt` script that builds this example uses a generic CMake
141+
The `CMakeLists.txt` script that builds this example uses a generic CMake
118142
function called `connextdds_add_example` that defines all the necessary constructs
119143
to:
120144

examples/persistence_service/library_api/c/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,30 @@ you want to link against. For example:
117117
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
118118
```
119119

120+
### Cross-compilation
121+
122+
When you need to cross-compile the example, the above
123+
command will not work, the assigned compiler won't be the cross-compiler and
124+
errors may happen when linking against the cross-compiled Connext binaries.
125+
To fix this, you have to create a file with the architecture name and call
126+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
127+
An example of the file to create with the toolchain settings (e.g. for an
128+
ARM architectures):
129+
130+
```cmake
131+
set(CMAKE_SYSTEM_NAME Linux)
132+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
133+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
134+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
135+
```
136+
137+
Then you can call CMake like this:
138+
139+
```bash
140+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
141+
-DCONNEXTDDS_ARCH=<connext architecture> ..
142+
```
143+
120144
### CMake Build Infrastructure
121145
122146
The `CMakeListst.txt` script that builds this example uses a generic CMake

examples/persistence_service/persistent_storage/c++11/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,30 @@ you want to link against. For example:
226226
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
227227
```
228228

229+
### Cross-compilation
230+
231+
When you need to cross-compile the example, the above
232+
command will not work, the assigned compiler won't be the cross-compiler and
233+
errors may happen when linking against the cross-compiled Connext binaries.
234+
To fix this, you have to create a file with the architecture name and call
235+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
236+
An example of the file to create with the toolchain settings (e.g. for an
237+
ARM architectures):
238+
239+
```cmake
240+
set(CMAKE_SYSTEM_NAME Linux)
241+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
242+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
243+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
244+
```
245+
246+
Then you can call CMake like this:
247+
248+
```bash
249+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
250+
-DCONNEXTDDS_ARCH=<connext architecture> ..
251+
```
252+
229253
### CMake Build Infrastructure
230254
231255
The `CMakeListst.txt` script that builds this example uses a generic CMake

examples/routing_service/file_adapter/c++11/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,30 @@ supports static linking of adapters. To use this functionality you would need to
6666
create an application that uses Routing Service as a library component and
6767
statically links to this `FileAdapter` library.
6868

69+
### Cross-compilation
70+
71+
When you need to cross-compile the example, the above
72+
command will not work, the assigned compiler won't be the cross-compiler and
73+
errors may happen when linking against the cross-compiled Connext binaries.
74+
To fix this, you have to create a file with the architecture name and call
75+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
76+
An example of the file to create with the toolchain settings (e.g. for an
77+
ARM architectures):
78+
79+
```cmake
80+
set(CMAKE_SYSTEM_NAME Linux)
81+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
82+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
83+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
84+
```
85+
86+
Then you can call CMake like this:
87+
88+
```bash
89+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
90+
-DCONNEXTDDS_ARCH=<connext architecture> ..
91+
```
92+
6993
## Running C++ example
7094

7195
To run the example, you just need to run the following command from the `build`

examples/routing_service/file_adapter/c/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,30 @@ supports static linking of adapters. To use this functionality you would need to
4343
create an application that uses Routing Service as a library component and
4444
statically links to this `FileAdapter` library.
4545

46+
### Cross-compilation
47+
48+
When you need to cross-compile the example, the above
49+
command will not work, the assigned compiler won't be the cross-compiler and
50+
errors may happen when linking against the cross-compiled Connext binaries.
51+
To fix this, you have to create a file with the architecture name and call
52+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
53+
An example of the file to create with the toolchain settings (e.g. for an
54+
ARM architectures):
55+
56+
```cmake
57+
set(CMAKE_SYSTEM_NAME Linux)
58+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
59+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
60+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
61+
```
62+
63+
Then you can call CMake like this:
64+
65+
```bash
66+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
67+
-DCONNEXTDDS_ARCH=<connext architecture> ..
68+
```
69+
4670
## Running C Example
4771

4872
Before running the example, take a look at file_bridge.xml. It defines the

examples/routing_service/mongo_db/c++11/README.rst

+27
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,33 @@ Here is more information about generating
5050
create an application that uses Routing Service as a library component and
5151
statically link to this adapter.
5252

53+
Cross-compilation
54+
-----------------
55+
56+
When you need to cross-compile the example, the above
57+
command will not work, the assigned compiler won't be the cross-compiler and
58+
errors may happen when linking against the cross-compiled Connext binaries.
59+
To fix this, you have to create a file with the architecture name and call
60+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
61+
An example of the file to create with the toolchain settings (e.g. for an
62+
ARM architectures):
63+
64+
.. code::
65+
66+
set(CMAKE_SYSTEM_NAME Linux)
67+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
68+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
69+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
70+
71+
72+
Then you can call CMake like this:
73+
74+
.. code::
75+
76+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
77+
-DCONNEXTDDS_ARCH=<connext architecture> ..
78+
79+
5380
Running
5481
-------
5582

examples/routing_service/monitoring/c++11/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ If you generated Makefiles in the configuration process, run make to build the
2626
example. Likewise, if you generated a Visual Studio solution, open the solution
2727
and follow the regular build process.
2828

29+
### Cross-compilation
30+
31+
When you need to cross-compile the example, the above
32+
command will not work, the assigned compiler won't be the cross-compiler and
33+
errors may happen when linking against the cross-compiled Connext binaries.
34+
To fix this, you have to create a file with the architecture name and call
35+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
36+
An example of the file to create with the toolchain settings (e.g. for an
37+
ARM architectures):
38+
39+
```cmake
40+
set(CMAKE_SYSTEM_NAME Linux)
41+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
42+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
43+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
44+
```
45+
46+
Then you can call CMake like this:
47+
48+
```bash
49+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
50+
-DCONNEXTDDS_ARCH=<connext architecture> ..
51+
```
52+
2953
## Running the Example
3054

3155
In two separate command prompt windows for the publisher and subscriber. Run the

examples/routing_service/shapes_processor/c++11/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,30 @@ regular build process.
4545

4646
Upon success it will create a shared library file in the build directory.
4747

48+
### Cross-compilation
49+
50+
When you need to cross-compile the example, the above
51+
command will not work, the assigned compiler won't be the cross-compiler and
52+
errors may happen when linking against the cross-compiled Connext binaries.
53+
To fix this, you have to create a file with the architecture name and call
54+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
55+
An example of the file to create with the toolchain settings (e.g. for an
56+
ARM architectures):
57+
58+
```cmake
59+
set(CMAKE_SYSTEM_NAME Linux)
60+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
61+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
62+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
63+
```
64+
65+
Then you can call CMake like this:
66+
67+
```bash
68+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
69+
-DCONNEXTDDS_ARCH=<connext architecture> ..
70+
```
71+
4872
## Running the Example
4973

5074
To run this example you will need two instances of *RTI Shapes Demo* and a

examples/routing_service/struct_array_transf/c++11/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,30 @@ Upon success it will create in the build directory:
5656

5757
- A subscriber application executable with name `SensorDataSubscriber`.
5858

59+
### Cross-compilation
60+
61+
When you need to cross-compile the example, the above
62+
command will not work, the assigned compiler won't be the cross-compiler and
63+
errors may happen when linking against the cross-compiled Connext binaries.
64+
To fix this, you have to create a file with the architecture name and call
65+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
66+
An example of the file to create with the toolchain settings (e.g. for an
67+
ARM architectures):
68+
69+
```cmake
70+
set(CMAKE_SYSTEM_NAME Linux)
71+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
72+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
73+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
74+
```
75+
76+
Then you can call CMake like this:
77+
78+
```bash
79+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
80+
-DCONNEXTDDS_ARCH=<connext architecture> ..
81+
```
82+
5983
## Running the Example
6084

6185
To run this example you will need an instance of the publisher application, and

examples/web_integration_service/library_api/c++11/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,30 @@ you want to link against. For example:
109109
cmake -DCONNEXTDDS_ARCH=x64Linux3gcc5.4.0 ..
110110
```
111111

112+
### Cross-compilation
113+
114+
When you need to cross-compile the example, the above
115+
command will not work, the assigned compiler won't be the cross-compiler and
116+
errors may happen when linking against the cross-compiled Connext binaries.
117+
To fix this, you have to create a file with the architecture name and call
118+
CMake with a specific flag called ``-DCMAKE_TOOLCHAIN_FILE``.
119+
An example of the file to create with the toolchain settings (e.g. for an
120+
ARM architectures):
121+
122+
```cmake
123+
set(CMAKE_SYSTEM_NAME Linux)
124+
set(toolchain_path "<path to>/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian")
125+
set(CMAKE_C_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-gcc")
126+
set(CMAKE_CXX_COMPILER "${toolchain_path}/bin/arm-linux-gnueabihf-g++")
127+
```
128+
129+
Then you can call CMake like this:
130+
131+
```bash
132+
cmake -DCONNEXTDDS_DIR=<connext dir> -DCMAKE_TOOLCHAIN_FILE=<toolchain file created above>
133+
-DCONNEXTDDS_ARCH=<connext architecture> ..
134+
```
135+
112136
### CMake Build Infrastructure
113137

114138
The CMakeListst.txt script that builds this example uses a generic CMake

0 commit comments

Comments
 (0)