Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe installation under Linux and Windows #519

Merged
merged 3 commits into from
Jun 22, 2021

Conversation

max-rosin
Copy link
Contributor

This PR resolves #518 .

  • My suggestion follows the style and contributors guidelines.
  • I have taken care about the documentation.
  • I have done the DCO signoff.
  • My changes generate no errors when passing CI tests.
  • I have successfully implemented and tested my fix/feature locally.
  • Appropriate reviewer(s) are assigned.

@max-rosin
Copy link
Contributor Author

There are a couple of open questions:

  • Are the any version requirements for prerequisite software like cmake?
  • The original description of the installation of C++ for Windows seemed strongly geared towards VisualStudio. I tried to generalize that. Does it work like I described it?

@max-rosin max-rosin added the Documentation Everything which impacts the quality of the documentation and guidelines. label Jun 8, 2021
Signed-off-by: Maximilian Rosin <[email protected]>
@max-rosin max-rosin added the ReadyForCCBReview Indicates that this MR is ready for a final review and merge by the CCB. label Jun 8, 2021
@kmeids
Copy link

kmeids commented Jun 9, 2021

@pmai do you see any update or changes that need to be done?

Copy link
Contributor

@PhRosenberger PhRosenberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Should we mention that protobuf and osi versions must fit to the ones chosen within the tools?
  • What about static vs. dynamic protobuf in Windows?
  • Do we require specific minimum versions of cmake / protobuf?

@@ -0,0 +1,54 @@
= Installing OSI for C++ on Windows

**Prerequisites**
Copy link

@kmeids kmeids Jun 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output CCB 09.06.2021:

  1. @pmai will provide a readme to enrich this section, for an easier windows installation process.
  2. This would not hold the merge process and can be adapted afterwards

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using vcpkg to properly build the required configurations of protobuf on Visual Studio (here VS 2017):

  • Install vcpkg as per the documentation, e.g. clone via git the bootstrap as needed

  • English Language pack needs to be installed for VS 2017 for vcpkg to work

  • Create a new triplet file for the required combination of static library linking with dynamic runtime (usually needed for dynamic linking to still work):
    I had to create a file named x64-windows-static-md-v141.cmake in the triplets directory with the following content:

    set(VCPKG_TARGET_ARCHITECTURE x64)
    set(VCPKG_CRT_LINKAGE dynamic)
    set(VCPKG_LIBRARY_LINKAGE static)
    set(VCPKG_PLATFORM_TOOLSET "v141")
    

    Note: only need the v141 suffix and setting of VCPKG_PLATFORM_TOOLSET to ensure VS 2017 is selected if you have newer VS installed (like I had).

  • Now the protobuf libraries can be built automatically using:

    vcpkg.exe install protobuf:x64-windows-static-md-v141
    
  • Once built, they can be automatically used in building the examples by specifying the triplet and toolchain file from VCPKG on the cmake configuration command-line:

    cd examples
    mkdir wbuild
    cd wbuild
    cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows-static-md-v141 -DCMAKE_TOOLCHAIN_FILE=../../../vcpkg/scripts/buildsystems/vcpkg.cmake -G 'Visual Studio 15 2017 Win64'
    cmake –build .
    

The CMAKE_TOOLCHAIN_FILE must point to your vcpkg directory, which in my example was parallel to the osi-sensor-model-packaging directory…

This might complain somewhat depending on cmake and compiler settings, but builds without problems (and should support release and debug builds out of the box).

@kmeids kmeids added ReadyToMerge This PR has been approved to merge and will be merged by a member of the CCB. and removed ReadyForCCBReview Indicates that this MR is ready for a final review and merge by the CCB. labels Jun 9, 2021
@kmeids
Copy link

kmeids commented Jun 9, 2021

Output CCB 09.06.2021:
@pmai will merge this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Everything which impacts the quality of the documentation and guidelines. ReadyToMerge This PR has been approved to merge and will be merged by a member of the CCB.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants