From a2dbe401bae567ddc1ecda869de711971a66c08b Mon Sep 17 00:00:00 2001 From: jdsika Date: Wed, 11 Dec 2024 10:45:32 +0100 Subject: [PATCH 1/4] feat: Add instructions for build on Windows Signed-off-by: jdsika --- CMakeLists.txt | 2 ++ README.md | 43 +++++++++++++++++++----- include/osi-utilities/tracefile/Writer.h | 2 +- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6296300..1509a26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Generate compile_commands.json for clang based tools set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_POLICY_DEFAULT_CMP0135 NEW) + # Add the include folder for public headers include_directories(${PROJECT_SOURCE_DIR}/include) diff --git a/README.md b/README.md index 7003559..395018a 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,16 @@ A utility library that provides essential tools, helper functions, and implement - Cross-platform C++ library and Python APIs - > **_NOTE:_** Python API is planned but not yet implemented. - - > **_NOTE:_** Windows should be supported but not yet tested, contributions welcome! - Easily integrate dealing with OSI data and trace files into your own projects - More OSI utility features planned, feature requests and pull requests welcome! ## Build Instructions -### Install required dependencies +### Install required dependencies on Linux - Compiler (e.g. GCC, Clang, MSVC) - [CMake](https://cmake.org/download/) +- [Doxygen](https://www.doxygen.nl/download.html) - [zstd](https://github.com/facebook/zstd) - [lz4](https://github.com/lz4/lz4) - [Protobuf](https://github.com/protocolbuffers/protobuf) @@ -30,6 +30,38 @@ A utility library that provides essential tools, helper functions, and implement sudo apt install build-essential cmake libzstd-dev liblz4-dev protobuf-compiler doxygen ``` +### Install required dependencies on Windows + +- Compiler (e.g. MSVC) +- [CMake](https://cmake.org/download/) +- [Doxygen](https://www.doxygen.nl/download.html) +- [zstd](https://github.com/facebook/zstd) +- [lz4](https://github.com/lz4/lz4) +- [Protobuf](https://github.com/protocolbuffers/protobuf) +- [pkg-config](https://stackoverflow.com/a/25605631/2883130) +- [gtest](https://google.github.io/googletest/) + +> **_NOTE:_** You can use [vcpkg](https://github.com/microsoft/vcpkg) and [chocolatey](https://chocolatey.org/) to install the following dependencies: + + ```bash + > choco install git + > choco install cmake + > choco install pkgconfiglite + > + > vcpkg install protobuf[zlib] protobuf[zlib]:x64-windows + > vcpkg install lz4 + > vcpkg install zstd + > vcpkg install gtest + ``` + +### Environment variables + +Make sure that the `/bin` folders of the depedencies are added to your `$PATH`. In addition set the following variables: + +```bash +CMAKE_PREFIX_PATH=C:/path/to/vcpkg/installed/x64-windows +``` + ### Build Clone the repository incl. submodules @@ -38,16 +70,11 @@ Clone the repository incl. submodules git clone --recurse-submodules https://github.com/Lichtblick-Suite/asam-osi-utilities.git ``` -Create build directory and configure using CMake +Create build directory and configure using CMake and build afterwards: ```bash mkdir build && cd build cmake .. -``` - -Build using CMake - -```bash cmake --build . -j4 ``` diff --git a/include/osi-utilities/tracefile/Writer.h b/include/osi-utilities/tracefile/Writer.h index 2d53146..e9453f2 100644 --- a/include/osi-utilities/tracefile/Writer.h +++ b/include/osi-utilities/tracefile/Writer.h @@ -17,7 +17,7 @@ namespace osi3 { * This class provides an interface for writing protobuf messages to trace files. * Different implementations can support various file formats like .osi, .mcap or .txth. * - * @Note The WriteMessage() function is intentionally omitted from this base class since it is format-specific. + * @note The WriteMessage() function is intentionally omitted from this base class since it is format-specific. * Users should dynamically cast to the concrete implementation class to access the appropriate WriteMessage() function. */ class TraceFileWriter { From d69b523394a539f54a6bd1caea5a7325953ad64c Mon Sep 17 00:00:00 2001 From: jdsika Date: Wed, 11 Dec 2024 11:16:33 +0100 Subject: [PATCH 2/4] doc: Add pthreads as dependency Signed-off-by: jdsika --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 395018a..bf8d6e9 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ sudo apt install build-essential cmake libzstd-dev liblz4-dev protobuf-compiler > vcpkg install lz4 > vcpkg install zstd > vcpkg install gtest + > vcpkg install pthreads ``` ### Environment variables From 975b98b21f4709ae63b4929d95fbebefc900b685 Mon Sep 17 00:00:00 2001 From: jdsika Date: Wed, 11 Dec 2024 14:15:37 +0100 Subject: [PATCH 3/4] add link to ms build tools Signed-off-by: jdsika --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf8d6e9..79e3fc8 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ sudo apt install build-essential cmake libzstd-dev liblz4-dev protobuf-compiler ### Install required dependencies on Windows -- Compiler (e.g. MSVC) +- Compiler (e.g. [MS Build Tools for Visual Studio 2022](https://visualstudio.microsoft.com/de/downloads/#build-tools-for-visual-studio-2022)) - [CMake](https://cmake.org/download/) - [Doxygen](https://www.doxygen.nl/download.html) - [zstd](https://github.com/facebook/zstd) From 676e85181a746e3558c16258a3baeaacf7a295ed Mon Sep 17 00:00:00 2001 From: jdsika Date: Thu, 12 Dec 2024 13:09:03 +0100 Subject: [PATCH 4/4] Recommend proto installation instructions from OSI Documentation Signed-off-by: jdsika --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79e3fc8..920c1e9 100644 --- a/README.md +++ b/README.md @@ -41,14 +41,14 @@ sudo apt install build-essential cmake libzstd-dev liblz4-dev protobuf-compiler - [pkg-config](https://stackoverflow.com/a/25605631/2883130) - [gtest](https://google.github.io/googletest/) -> **_NOTE:_** You can use [vcpkg](https://github.com/microsoft/vcpkg) and [chocolatey](https://chocolatey.org/) to install the following dependencies: +> **_NOTE:_** Use the protobuf installation instructions for Windows from [OSI](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/installing_prerequisites.html#_windows) to create the triplets file. You can use [vcpkg](https://github.com/microsoft/vcpkg) and [chocolatey](https://chocolatey.org/) to install the following dependencies: ```bash > choco install git > choco install cmake > choco install pkgconfiglite > - > vcpkg install protobuf[zlib] protobuf[zlib]:x64-windows + > vcpkg install --triplet=x64-windows-static-md protobuf > vcpkg install lz4 > vcpkg install zstd > vcpkg install gtest