Skip to content

Commit

Permalink
Describe installation under Linux and Windows (#518)
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Rosin <[email protected]>
  • Loading branch information
max-rosin committed May 10, 2021
1 parent b078a30 commit d4b2ac9
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 21 deletions.
11 changes: 0 additions & 11 deletions doc/setup/installing_linux.adoc

This file was deleted.

61 changes: 61 additions & 0 deletions doc/setup/installing_linux_cpp.adoc
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
----
43 changes: 43 additions & 0 deletions doc/setup/installing_linux_python.adoc
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 .`
10 changes: 0 additions & 10 deletions doc/setup/installing_windows.adoc

This file was deleted.

54 changes: 54 additions & 0 deletions doc/setup/installing_windows_cpp.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
= Installing OSI 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
----
30 changes: 30 additions & 0 deletions doc/setup/installing_windows_python.adoc
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
----

0 comments on commit d4b2ac9

Please sign in to comment.