Skip to content

Commit 34821c0

Browse files
philipwindeckerpmai
authored andcommitted
Converted section title to separate page
for setting up osi Signed-off-by: Philip Windecker <philip.windecker@avenyr.de>
1 parent ec5227d commit 34821c0

8 files changed

+37
-28
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ For usage examples, please refer to the official documentation:
2222
## Installation
2323

2424
For detailed installation instructions, please refer to the official documentation:
25-
- [Setting up OSI](https://opensimulationinterface.github.io/osi-documentation/#_setting_up_osi)
26-
- [Installing _protobuf_ for static / dynamic linking](https://opensimulationinterface.github.io/osi-documentation/#_installing_prerequisites)
27-
- [Installing OSI for C++ on Linux](https://opensimulationinterface.github.io/osi-documentation/#_installing_osi_for_c_on_linux)
28-
- [Installing OSI for Python on Linux](https://opensimulationinterface.github.io/osi-documentation/#_installing_osi_for_python_on_linux)
29-
- [Installing OSI for C++ on Windows](https://opensimulationinterface.github.io/osi-documentation/#_installing_osi_for_c_on_windows)
30-
- [Installing OSI for Python on Windows](https://opensimulationinterface.github.io/osi-documentation/#_installing_osi_for_python_on_windows)
25+
- [Setting up OSI](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/setting_up_osi.html)
26+
- [Installing _protobuf_ for static / dynamic linking](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/installing_prerequisites.html)
27+
- [Installing OSI for C++ on Linux](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/installing_linux_cpp.html)
28+
- [Installing OSI for Python on Linux](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/installing_linux_python.html)
29+
- [Installing OSI for C++ on Windows](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/installing_windows_cpp.html)
30+
- [Installing OSI for Python on Windows](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/installing_windows_python.html)

doc/open-simulation-interface_user_guide.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ include::./architecture/trace_file_example.adoc[leveloffset=+3]
7171

7272
include::./architecture/formatting_scripts.adoc[leveloffset=+3]
7373

74-
== Setting up OSI
74+
75+
// Setting up OSI
76+
include::./setup/setting_up_osi.adoc[leveloffset=+1]
7577

7678
include::./setup/installing_prerequisites.adoc[leveloffset=+2]
7779

doc/setup/installing_linux_cpp.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif::[]
66

77
**Prerequisites**
88

9-
* You have installed everything described in <<Installing _protobuf_ for static / dynamic linking depending on the use case>>.
9+
* You have installed everything described in <<top-installing-osi-prerequisits>>.
1010
1111
**Steps**
1212

doc/setup/installing_linux_python.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif::[]
66

77
**Prerequisites**
88

9-
* You have installed everything described in <<Installing _protobuf_ for static / dynamic linking depending on the use case>>.
9+
* You have installed everything described in <<top-installing-osi-prerequisits>>.
1010
* You have installed _pip3_.
1111
* You have installed _python-setuptools_.
1212
* For a local installation, you have installed _virtualenv_.

doc/setup/installing_prerequisites.adoc

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@ ifndef::include-only-once[]
22
:root-path: ../
33
include::{root-path}_config.adoc[]
44
endif::[]
5-
6-
= Installing _protobuf_ for static / dynamic linking
5+
[#top-installing-osi-prerequisits]
6+
= Installing protobuf for static / dynamic linking
77

88
== Prerequisites
99

10-
* You have installed _cmake_ (version 3.10.2 or higher).
11-
* You must have super user privileges.
10+
* You have installed _cmake_ (version 3.10.2 or higher)
11+
* You must have superuser privileges
1212

13-
Static linking is the recommended way to package OSI FMUs for sharing with others to be integrated in a co-simulation: They should have minimal external dependencies, in order to ensure maximum portability.
14-
Fo other use cases like first trials to get started with OSI, dynamic linking could be an option, as well.
13+
Static linking is the recommended way to package OSI FMUs for sharing with others to be integrated in a co-simulation: They should have minimal external dependencies in order to ensure maximum portability.
14+
For other use cases like first trials to get started with OSI, dynamic linking could be an option as well.
1515

1616
== Windows
1717

1818
**Dynamic Linking (NOT RECOMMENDED)**
1919

20-
Since on windows symbols are not exported per default it can be kind of annoying to deal with this during _protobuf_ header generation (see for example https://groups.google.com/g/protobuf/c/PDR1bqRazts).
21-
So basically thats one more reason to use static linking.
20+
Since on Windows symbols are not exported per default, it can be kind of annoying to deal with this during _protobuf_ header generation (see for example https://groups.google.com/g/protobuf/c/PDR1bqRazts).
21+
That is an important reason to use static linking.
2222

2323
**Static Linking**
2424

2525
Static linking might require to manually build _protobuf_.
26-
Its important to notice that on windows you can also specify how to link against the C runtime.
27-
Basically this can be set in CMake e.g. https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html
26+
It is important to notice that on Windows you can also specify how to link against the C runtime.
27+
Basically, this can be set in CMake, e.g. https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html
2828

29-
Therefore, it could make sense to still dynamically link against the C Runtime when statically linking _protobuf_ / OSI.
30-
(This is important e.g. when building shared libraries, since a static C runtime will create an isolated heap for your dll, which can lead to segfaults depending on what you expose on your public interfaces.)
29+
Therefore, it could make sense to still dynamically link against the C Runtime when statically linking _protobuf_ / OSI.
30+
(This is important e.g. when building shared libraries, since a static C runtime will create an isolated heap for your dll, which can lead to segfaults depending on what you expose on your public interfaces.)
3131

3232
The easiest way to achieve static linking on Windows without setting all the stuff manually in Cmake and building _protobuf_ is to actually use vcpkg:
3333

@@ -39,7 +39,7 @@ vcpkg install --triplet=x64-windows-static-md protobuf
3939

4040
**Build:**
4141

42-
For the cmake configuration we can directly specify our vcpkg installation:
42+
For the cmake configuration, we can directly specify our vcpkg installation:
4343
----
4444
cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DCMAKE_TOOLCHAIN_FILE=C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64
4545
cmake --build . --config Release
@@ -49,18 +49,19 @@ cmake --build . --config Release
4949

5050
**Dynamic linking (NOT RECOMMENDED)**
5151

52-
As already mentioned, shared linking is possible on linux, but NOT RECOMMENDED.
53-
However, for dynamic linking, install _protobuf_ (version 3.0.0 or higher) with apt:
52+
As already mentioned, shared linking is possible on Linux, but NOT RECOMMENDED.
53+
However, for dynamic linking install _protobuf_ (version 3.0.0 or higher) with apt:
5454
----
5555
sudo apt-get install libprotobuf-dev protobuf-compiler
5656
----
57-
and in the CMakeLists of the OSI project, `LINK_WITH_SHARED_OSI` has to be enabled.
57+
In the CMakeLists of the OSI project, `LINK_WITH_SHARED_OSI` has to be enabled.
5858

5959
**Static linking**
6060

6161
A common error here is to just install _protobuf_ with apt and link against it.
6262
This means that your OSI is build statically but still linking dynamically against _protobuf_.
63-
Here, again either _protobuf_ has to build statically from source or some solution e.g. vcpkg needs to be utilized. We recommend the following (as in the README of the OSI project):
63+
Here, again either _protobuf_ has to build statically from source or some solution e.g. vcpkg needs to be utilized.
64+
We recommend the following (as in the README of the OSI project):
6465

6566
Install _protobuf_ (version 3.0.0 or higher) from source with `CXXFLAGS="-fPIC"` to allow static linking of your OSI FMUs (replace <version> with preferred release):
6667
----

doc/setup/installing_windows_cpp.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif::[]
66

77
**Prerequisites**
88

9-
* You have installed everything described in <<Installing _protobuf_ for static / dynamic linking depending on the use case>>.
9+
* You have installed everything described in <<top-installing-osi-prerequisits>>.
1010
1111
**Steps**
1212

doc/setup/installing_windows_python.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif::[]
66

77
**Prerequisites**
88

9-
* You have installed everything described in <<Installing _protobuf_ for static / dynamic linking depending on the use case>>.
9+
* You have installed everything described in <<top-installing-osi-prerequisits>>.
1010
* You have installed _Python_ with administrator rights.
1111
* Make sure _Python_ is added to `PATH`.
1212

doc/setup/setting_up_osi.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ifndef::include-only-once[]
2+
:root-path: ../
3+
include::{root-path}_config.adoc[]
4+
endif::[]
5+
[#top-setting-up-osi]
6+
= Setting up OSI

0 commit comments

Comments
 (0)