Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions doc/open-simulation-interface_user_guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,10 @@ include::./architecture/formatting_script.adoc[leveloffset=+3]
// Setting up OSI
include::./setup/setting_up_osi.adoc[leveloffset=+1]

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

include::./setup/installing_linux_cpp.adoc[leveloffset=+2]
include::./setup/setting_up_osi_python.adoc[leveloffset=+2]

include::./setup/installing_linux_python.adoc[leveloffset=+2]

include::./setup/installing_windows_cpp.adoc[leveloffset=+2]

include::./setup/installing_windows_python.adoc[leveloffset=+2]

//include::./setup/installing_macos.adoc[leveloffset=+2]

//include::./setup/using_osi_support_tools.adoc[leveloffset=+2]

//include::./setup/including_osi_dev_projects.adoc[leveloffset=+2]

//== Example use cases for OSI

Expand Down
21 changes: 0 additions & 21 deletions doc/setup/including_osi_dev_projects.adoc

This file was deleted.

56 changes: 0 additions & 56 deletions doc/setup/installing_linux_cpp.adoc

This file was deleted.

66 changes: 0 additions & 66 deletions doc/setup/installing_linux_python.adoc

This file was deleted.

21 changes: 0 additions & 21 deletions doc/setup/installing_macos.adoc

This file was deleted.

57 changes: 0 additions & 57 deletions doc/setup/installing_windows_cpp.adoc

This file was deleted.

60 changes: 0 additions & 60 deletions doc/setup/installing_windows_python.adoc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,64 @@ ifndef::include-only-once[]
:root-path: ../
include::{root-path}_config.adoc[]
endif::[]
[#top-installing-osi-prerequisits]
= Installing protobuf for static / dynamic linking
= Open Simulation Interface (OSI) C++ Bindings

This section explains how to integrate OSI into your own C++ project.
The C++ bindings are available in the separate https://github.com/OpenSimulationInterface/osi-cpp.git[osi-cpp] repository.

You can refer to an example application in the examples of the
https://github.com/OpenSimulationInterface/osi-sensor-model-packaging/tree/master/examples[OSI Sensor Model Packaging] repository.

== Prerequisites
- cmake (version 3.10.2 or higher)
- git

== Checkout the repository with submodules

. Open a terminal in your project.
. Clone the osi-cpp repository, including sub-modules:
+
----
git clone --recurse-submodules https://github.com/OpenSimulationInterface/osi-cpp.git
----


== Using vcpkg for dependencies (Recommended)

Especially for building on Windows, the use of **vcpkg** to handle dependencies is recommended.

Prerequisites::
* The environment variable `VCPKG_ROOT` must be set to the root of your vcpkg installation.
* For Windows static linking, the static-md triplet is recommended (see also <<static_dynamic_linking, Static/Dynamic Linking>> explained below)

Steps::
. Configure the build using the vcpkg preset:
+
----
cmake --preset default
----
. Perform the build:
+
----
cmake --build build
----


== Building without vcpkg

To build without vcpkg, you must ensure necessary prerequisites are installed and detectable by CMake. It is then usually enough to include the `osi-cpp` repository in your main `CMakeLists.txt`:
----
set(LINK_WITH_SHARED_OSI OFF) # Check linking explaination below
add_subdirectory(lib/osi-cpp)
target_link_libraries(YourTarget open_simulation_interface_pic)

----

* You have installed _cmake_ (version 3.10.2 or higher)
* You must have superuser privileges
== Static/Dynamic Linking [[static_dynamic_linking]]

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.
For other use cases like first trials to get started with OSI, dynamic linking could be an option as well.
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. For other use cases dynamic linking could be an option and is thus explained below.

== Windows
=== Windows

Dynamic Linking (NOT RECOMMENDED)::

Expand Down Expand Up @@ -46,7 +92,7 @@ Now the protobuf libraries can be built automatically using:
vcpkg install --triplet=x64-windows-static-md protobuf
----

== Linux
=== Linux

Dynamic linking (NOT RECOMMENDED)::

Expand Down
Loading