-
Notifications
You must be signed in to change notification settings - Fork 131
Describe installation under Linux and Windows #519
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
= Installing OSI for C++ on Linux | ||
|
||
**Prerequisites** | ||
|
||
* You have _cmake_ installed. | ||
* You have installed _protobuf_. | ||
* You must have super user privileges. | ||
|
||
**Steps** | ||
|
||
. Open a terminal. | ||
. Clone the Open Simulation repository. | ||
+ | ||
[source] | ||
---- | ||
git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git | ||
---- | ||
+ | ||
. Change into the repository directory. | ||
+ | ||
[source] | ||
---- | ||
cd open-simulation-interface | ||
---- | ||
+ | ||
. Create a new directory for the build. | ||
+ | ||
[source] | ||
---- | ||
mkdir build | ||
---- | ||
+ | ||
. Change into the new directory. | ||
+ | ||
[source] | ||
---- | ||
cd build | ||
---- | ||
+ | ||
. Run cmake. | ||
To build a 32-bit target under 64-bit linux, add `-DCMAKE_CXX_FLAGS="-m32"` to the cmake command. | ||
In this case, protobuf must be in 32-bit mode too. | ||
+ | ||
[source] | ||
---- | ||
cmake .. | ||
---- | ||
+ | ||
. Run make. | ||
+ | ||
[source] | ||
---- | ||
make | ||
---- | ||
+ | ||
. Install Open Simulation Interface. | ||
+ | ||
[source] | ||
---- | ||
sudo make install | ||
---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
= Installing OSI for Python on Linux | ||
|
||
**Prerequisites** | ||
|
||
* You have installed _pip3_. | ||
* You have installed _python-setuptools_. | ||
* You have installed _protobuf_. | ||
* For local installation, you have installed _virtualenv_. | ||
|
||
**Steps** | ||
|
||
. Open a terminal. | ||
. Clone the Open Simulation repository. | ||
+ | ||
[source] | ||
---- | ||
git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git | ||
---- | ||
+ | ||
. Change into the repository directory. | ||
+ | ||
[source] | ||
---- | ||
cd open-simulation-interface | ||
---- | ||
+ | ||
. Create a new virtual environment. | ||
+ | ||
[source] | ||
---- | ||
virtualenv -p python3 venv | ||
---- | ||
+ | ||
. Activate the virtual environment. | ||
+ | ||
[source] | ||
---- | ||
source venv/bin/activate | ||
---- | ||
+ | ||
. Install Open Simulation Interface. | ||
Local installation:: `pip3 install .` | ||
Global installation:: `sudo pip3 install .` |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
= Installing OSI for C++ on Windows | ||
|
||
**Prerequisites** | ||
|
||
* You have installed _cmake_ as administrator. | ||
* You have installed _protobuf_ as administrator. | ||
|
||
**Steps** | ||
|
||
. Open a terminal as administrator. | ||
. Clone the Open Simulation repository. | ||
+ | ||
[source] | ||
---- | ||
git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git | ||
---- | ||
+ | ||
. Change into the repository directory. | ||
+ | ||
[source] | ||
---- | ||
cd open-simulation-interface | ||
---- | ||
+ | ||
. Create a new directory for the build. | ||
+ | ||
[source] | ||
---- | ||
mkdir build | ||
---- | ||
+ | ||
. Change into the new directory. | ||
+ | ||
[source] | ||
---- | ||
cd build | ||
---- | ||
+ | ||
. Run cmake. | ||
To build a 64-bit target, add `Win64` to the generator name. | ||
In this case, protobuf and protoc.exe must be in 64-bit mode too. | ||
+ | ||
[source] | ||
---- | ||
cmake .. [-G <generator>] [-DCMAKE_INSTALL_PREFIX=<osi-install-directory>] | ||
---- | ||
+ | ||
. Build and install OSI. | ||
+ | ||
[source] | ||
---- | ||
cmake --build . [--config Release] | ||
cmake --build . --target install | ||
---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
= Installing OSI for Python on Windows | ||
|
||
**Prerequisites** | ||
|
||
* You have installed _Python_ with administrator rights. | ||
* Make sure _Python_ is added to `PATH`. | ||
|
||
**Steps** | ||
|
||
. Open a terminal. | ||
. Clone the Open Simulation repository. | ||
+ | ||
[source] | ||
---- | ||
git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git | ||
---- | ||
+ | ||
. Change into the repository directory. | ||
+ | ||
[source] | ||
---- | ||
cd open-simulation-interface | ||
---- | ||
+ | ||
. Run the setup script. | ||
+ | ||
[source] | ||
---- | ||
python setup.py install | ||
---- |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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:
There was a problem hiding this comment.
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:
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:
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:
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).