From abb05c38d14178636f0e37c7ca7ba8fe69770cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Thu, 5 Oct 2023 11:50:53 +0200 Subject: [PATCH 1/3] Update doc for C --- docs/tutorials/c/integration_co_sim_io.md | 30 +++++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/tutorials/c/integration_co_sim_io.md b/docs/tutorials/c/integration_co_sim_io.md index 020e977a..62006d74 100644 --- a/docs/tutorials/c/integration_co_sim_io.md +++ b/docs/tutorials/c/integration_co_sim_io.md @@ -39,11 +39,18 @@ Several options for using/integrating the _CoSimIO_ exist: Here the _CoSimIO_ is directly integrated into the host code and added with `add_subdirectory(CoSimIO)`. CMake then takes care of compiling and installing the _CoSimIO_. Kratos uses this way to integrate the CoSimIO, check the [`CMakeLists.txt` of the CoSimulationApplication for details](https://github.com/KratosMultiphysics/Kratos/blob/master/applications/CoSimulationApplication/CMakeLists.txt) - Compiling _CoSimIO_ outside the host project: - One can use [build_c.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_c.sh) for compiling it. + One can use [build_c.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_c.sh) or [build_c.bat](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_c.bat) for compiling it. - ```bash - $ bash scripts/build_c.sh - ``` + - For *GNU/Linux* or *MacOS*: + ```bash + $ bash scripts/build_c.sh + ``` + + - For Windows OS: + + ```cmd + $ scripts/build_c.bat + ``` After compiling, the headers need to be included (e.g. with `include_directories`) and the `co_sim_io_c` shared library needs to be linked (e.g with `target_link_libraries`). ``` @@ -52,11 +59,18 @@ Several options for using/integrating the _CoSimIO_ exist: ``` - Compiling _CoSimIO_ outside the host and manually integrating it: - One can use [build_c.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_c.sh) for compiling it. + One can use [build_c.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_c.sh) or [build_c.bat](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_c.bat) for compiling it. - ```bash - $ bash scripts/build_c.sh - ``` + - For *GNU/Linux* or *MacOS*: + ```bash + $ bash scripts/build_c.sh + ``` + + - For Windows OS: + + ```cmd + $ scripts/build_c.bat + ``` Is important that the compiler can find the header files of the _CoSimIO_. For this, one can add the folder `co_sim_io` to the include path. Example: From 292398eca06a740a6a9def9732702e7fa7a5fb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Thu, 5 Oct 2023 11:51:02 +0200 Subject: [PATCH 2/3] Update doc for C++ --- docs/tutorials/cpp/integration_co_sim_io.md | 30 +++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/tutorials/cpp/integration_co_sim_io.md b/docs/tutorials/cpp/integration_co_sim_io.md index 54919b33..4e341113 100644 --- a/docs/tutorials/cpp/integration_co_sim_io.md +++ b/docs/tutorials/cpp/integration_co_sim_io.md @@ -39,11 +39,18 @@ Several options for using/integrating the _CoSimIO_ exist: Here the _CoSimIO_ is directly integrated into the host code and added with `add_subdirectory(CoSimIO)`. CMake then takes care of compiling and installing the _CoSimIO_. Kratos uses this way to integrate the CoSimIO, check the [`CMakeLists.txt` of the CoSimulationApplication for details](https://github.com/KratosMultiphysics/Kratos/blob/master/applications/CoSimulationApplication/CMakeLists.txt) - Compiling _CoSimIO_ outside the host project: - One can use [build_cpp.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_cpp.sh) for compiling it. + One can use [build_cpp.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_cpp.sh) or [build_cpp.bat](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_cpp.bat) for compiling it. - ```bash - $ bash scripts/build_cpp.sh - ``` + - For *GNU/Linux* or *MacOS*: + ```bash + $ bash scripts/build_cpp.sh + ``` + + - For Windows OS: + + ```cmd + $ scripts/build_cpp.bat + ``` After compiling, the headers need to be included (e.g. with `include_directories`) and the `co_sim_io` shared library needs to be linked (e.g with `target_link_libraries`). ``` @@ -52,11 +59,18 @@ Several options for using/integrating the _CoSimIO_ exist: ``` - Compiling _CoSimIO_ outside the host and manually integrating it: - One can use [build_cpp.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_cpp.sh) for compiling it. + One can use [build_cpp.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_cpp.sh) or [build_cpp.bat](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_cpp.bat) for compiling it. - ```bash - $ bash scripts/build_cpp.sh - ``` + - For *GNU/Linux* or *MacOS*: + ```bash + $ bash scripts/build_cpp.sh + ``` + + - For Windows OS: + + ```cmd + $ scripts/build_cpp.bat + ``` Is important that the compiler can find the header files of the _CoSimIO_. For this, one can add the folder `co_sim_io` to the include path. Example: From d238388ac860c252f73c9f4243a3a8cb9fa85989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Thu, 5 Oct 2023 11:51:15 +0200 Subject: [PATCH 3/3] Update doc for python --- .../tutorials/python/integration_co_sim_io.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/tutorials/python/integration_co_sim_io.md b/docs/tutorials/python/integration_co_sim_io.md index 6e117bc6..6be5efb0 100644 --- a/docs/tutorials/python/integration_co_sim_io.md +++ b/docs/tutorials/python/integration_co_sim_io.md @@ -36,12 +36,19 @@ This tutorial helps you to integrate the _CoSimIO_ into a solver/software-tool u ## Building the CoSimIO The Python interface is located in [co_sim_io/python](https://github.com/KratosMultiphysics/CoSimIO/tree/master/co_sim_io/python) folder of the repository. It uses the [pybind11 library](https://github.com/pybind/pybind11) for exposing the C++ code to Python. It is provided in the [expternal_libraries/pybind11](https://github.com/KratosMultiphysics/CoSimIO/tree/master/external_libraries/pybind11) folder of this repo. -One may use the [build_python.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_python.sh) script from the CoSimIO root folder to create a library of the python interface: +One may use the [build_python.sh](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_python.sh) or [build_python.bat](https://github.com/KratosMultiphysics/CoSimIO/blob/master/scripts/build_python.bat) script from the _CoSimIO_ root folder to create a library of the python interface: -``` -sh scripts/build_python.sh -``` -This will compile the binaries and install them into the `bin/` subfolder of _CoSimIO_, together with the CoSimIO Python module. Check [here](../../build_options.md) for the available build options. +- For *GNU/Linux* or *MacOS*: + ```bash + $ bash scripts/build_python.sh + ``` + +- For Windows OS: + + ```cmd + $ scripts/build_python.bat + ``` +This will compile the binaries and install them into the `bin/` subfolder of _CoSimIO_, together with the _CoSimIO_ Python module. Check [here](../../build_options.md) for the available build options. The created folder structure should look like this: ``` @@ -56,7 +63,7 @@ Remember to add the `/bin` folder to your `PYTHONPATH`. For Linux this should lo export PYTHONPATH=$PYTHONPATH:/path/to/CoSimIO/bin ``` -Usually pybind automatically detects the Python installation. Sometimes it can however be necessary to explicitly specify the target Python version. This can be achieved through CMake by setting PYBIND11_PYTHON_VERSION or an exact Python installation can be specified with PYTHON_EXECUTABLE. For example: +Usually pybind automatically detects the Python installation. Sometimes it can however be necessary to explicitly specify the target Python version. This can be achieved through CMake by setting `PYBIND11_PYTHON_VERSION` or an exact Python installation can be specified with `PYTHON_EXECUTABLE`. For example: ```cmake -DPYBIND11_PYTHON_VERSION=3.6 # or