Commit 85d5ed0e authored by Jorn Baayen's avatar Jorn Baayen

Update installation instructions.

parent d66a8067
......@@ -4,89 +4,61 @@ Getting Started
Installation
============
For most users, especially on Windows, the easiest way to install RTC-Tools
and its dependencies is using the `Windows Installer`_. For users on Linux, it
is necessary to build it `from source`_ using git.
For most users, the easiest way to install RTC-Tools using the `pip <https://pip.pypa.io/>`_ package manager.
Windows Installer
-----------------
Using the Pip Package Manager
-----------------------------
A complete Windows installer is available from the `Deltares Download
Portal`_. This will install a self-containing RTC-Tools 2 configuration
including all prerequisites, and will not conflict with other Python or
JModelica installations on the system.
RTC-Tools, including its dependencies, can be installed using the `pip <https://pip.pypa.io/>`_ package manager::
1. Download the installer from the `Deltares Download Portal`_.
2. Start the installation by opening the downloaded executable.
3. Choose the desired location for RTC-Tools 2.
4. Run the Basic Example via the Start Menu.
If the installation was succesful, you should see that the solver succeeds:
.. image:: images/basic_example_console.png
# Install RTC-Tools using pip package manager
python3 -m pip install rtctools
From Source
-----------
Although not required, it is recommended to build and install RTC-Tools and
JModelica (see `dependencies`_) in a `virtual environment
Although not required, it is recommended to build and install RTC-Tools in a `virtual environment
<https://virtualenv.pypa.io/en/stable/>`_.
Dependencies
~~~~~~~~~~~~
RTC-Tools 2 has the following system dependencies:
RTC-Tools 2 requires `Python <https://www.python.org>`_ >= 3.6 (*not Python 2*) with the following packages:
* `Python <https://www.python.org>`_ >= 2.7 (*not Python 3*)
- `numpy <https://www.numpy.org/>`_ >= 1.11.10
* `JModelica <https://svn.jmodelica.org/branches/CasADiUpdate24/>`_ == 1.16
(CasADi 2.4) with:
- `numba <https://numba.pydata.org/>`_
- `CasADi <https://github.com/casadi/casadi/>`_ ~> 2.4.5
- `pymola <https://github.com/jbaayen/pymola/>`_
- `BONMIN <http://www.coin-or.org/download/source/Bonmin/>`_ >= 1.8.4
(required for mixed integer optimization)
- `CasADi <https://github.com/casadi/casadi/>`_ >= 3.2.0
- `IPOPT <http://www.coin-or.org/download/source/Ipopt/>`_ >= 3.12
The dependencies can be installed using the `pip <https://pip.pypa.io/>`_ package manager::
For most Linux distributions only Python is available from the standard
repositories. JModelica and its dependencies will need to be built and
installed from source. We refer to their respective installation instructions,
and list below the instructions pertaining to RTC-Tools itself.
# Install dependencies using pip
python3 -m pip install numpy numba pymola casadi
Acquiring the source
~~~~~~~~~~~~~~~~~~~~
The latest RTC-Tools source can be downloaded using git::
# get RTC-Tools source
# Get RTC-Tools source
git clone https://gitlab.com/deltares/rtc-tools.git
# Get RTC-Tools's Modelica library
git clone https://gitlab.com/deltares/rtc-tools-channel-flow.git
Ubuntu / Debian
~~~~~~~~~~~~~~~
Building RTC-Tools requires one additional Python package over JMmodelica::
# Change directory to where RTC-Tools was downloaded
cd rtc-tools
# Install additional dependencies of RTC-Tools
pip install mock
Linux/MacOS-X
~~~~~~~~~~~~~
Now all that remains is to actually build and install RTC-Tools::
To actually build and install RTC-Tools, run::
# Build and install RTC-Tools
python setup.py install
To check whether the installation was succesful, the basic example can be
used. It is importent first to set the correct environment variables for
JModelica and RTC-Tools. Luckily, JModelica comes with a convenient script
which does most of this for you. Only the environment variable pointing to the
used. Only the environment variable pointing to the
Deltares Modelica library remains for the user to set::
export DELTARES_LIBRARY_PATH=\`readlink -f ../rtc-tools-channel-flow\`
......@@ -94,31 +66,13 @@ Deltares Modelica library remains for the user to set::
cd examples/basic/src
# Set the correct environment variables, and run the example
/path/to/JModelica/bin/jm_python.sh example.py
python3 example.py
Windows
~~~~~~~
Building RTC-Tools on Windows is easiest by using the `JModelica SDK
<http://www.jmodelica.org/sdk>`_. Be sure to:
* Build using JModelica's CasADi 2.4 branch
* Update CasADi to the required version (see `dependencies`_)
A further dependency is on Cython. Instructions for building extensions on
Windows are available in the `Cython docs
<https://github.com/cython/cython/wiki/CythonExtensionsOnWindows>`_.
Using the Visual C++ 2008 32-bit Command Prompt, it is then possible to build
and install RTC-Tools by running::
python setup.py install
To check whether the installation was succesful, the basic example can be
used. It is importent first to set the correct environment variables for
JModelica and RTC-Tools. Luckily, JModelica comes with a convenient script
which does this for you. Only the environment variable pointing to the
used. Only the environment variable pointing to the
Deltares Modelica library remains for the user to set::
set DELTARES_LIBRARY_PATH=C:\path\to\rtc-tools-channel-flow
......@@ -126,9 +80,11 @@ Deltares Modelica library remains for the user to set::
cd /D C:\path\to\rtc-tools\basic\src
# Set the correct environment variables, and run the example
C:\path\to\JModelica\Python.bat example.py
python3 example.py
.. _Deltares Download Portal: https://download.deltares.nl/en/download/rtc-tools/
If the installation was succesful, you should see that the solver succeeds:
.. image:: images/basic_example_console.png
.. _getting-started-omedit:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment