These instructions can be used to setup environment quickly. However, as it is semi-automated with Anaconda, installed libraries are usually of the latest versions. To setup environment with specific versions of the required libraries please refer to the old instructions.
As for 13.02.2020 such a quick installation leads to the following setup:
- Ubuntu 18 64 Bit machine
- Python 3.8.1
- Java 8
- Assimulo 3.1
- PyFMI 2.5.7
- Sundials 5.1.0
- (optional) Ipopt 3.12.12
- (optional) Dymola 2017 - if one wants to to compile own FMU. If one wants to use an FMU exported from Dymola for simulation, licence file should be available.
- (optional) JModelica 2.4 - if one wants to compile own FMU.
To simplify installation process Anaconda is used. If you have one installed, skip this step.
First, install Miniconda for Python 3 following the instruction on the official site: Download corresponding installer and run it.
Add conda-forge as channel:
conda config --add channels conda-forge
Install PyFMI:
conda install pyfmi
First:
sudo apt-get install libav-tools
Install with pip:
pip install gym
Or you can build it from sources:
git clone /~https://github.com/openai/gym.git
cd gym
pip install -e .
Finally:
sudo pip3 install pyglet
sudo apt install openjdk-8-jdk
If you are using Oracle distribution of Java 8, this should be fine as well.
It is advised to install PyCharm for convenient work on a project and running examples.
Simply execute:
sudo apt install snapd snapd-xdg-open
sudo snap install pycharm-community --classic
Run PyCharm from the list of applications.
As it was mentioned, you need Dymola or JModelica, if you are going to recompile FMU's.
First, install all required packages:
sudo apt-get -y install g++
sudo apt-get -y install subversion
sudo apt-get -y install gfortran
sudo apt-get -y install ipython
sudo apt-get -y install cmake
sudo apt-get -y install swig
sudo apt-get -y install ant
sudo apt-get -y install openjdk-8-jdk
sudo apt-get -y install python-dev
sudo apt-get -y install python-numpy
sudo apt-get -y install python-scipy
sudo apt-get -y install python-matplotlib
sudo apt-get -y install cython
sudo apt-get -y install python-lxml
sudo apt-get -y install python-nose
sudo apt-get -y install python-jpype
sudo apt-get -y install zlib1g-dev
sudo apt-get -y install libboost-dev
Download Ipopt and run following commands:
tar xvf Ipopt-<version>.tgz
cd Ipopt-<version>/ThirdParty/Blas
./get.Blas
cd ../Lapack
./get.Lapack
cd ../Mumps
./get.Mumps
cd ../Metis
./get.Metis
cd ../../
mkdir build
cd build
../configure --prefix=/home/<user_name>/<ipopt_installation_location>
make install
First, checkout it using subversion:
svn co https://svn.jmodelica.org/trunk JModelica
Then run following commands:
cd JModelica
mkdir build
cd build
../configure --prefix=/home/<user_name>/<jmodelica_install_location> \
--with-ipopt=/home/<user_name>/<ipopt_install_location>
make install
Dymola for Linux is distributed as a tar file that contains rpm files. Replace the first line with the actual Dymola version and run the following commands:
# Change DYMVER to the version you are installing
DYMVER=dymola-2016-x86_64
# Unzip or untar the file, for example if there is a file ${DYMVER}-linux.tar.gz, type
tar xzf ${DYMVER}-linux.tar.gz
# Unpack the rpm files
cd ${DYMVER}-linux
for ff in `ls *.rpm`; do (sudo rpm2cpio $ff | cpio -i --make-directories); done
sudo chmod -R o-w opt/${DYMVER}
sudo mv opt/${DYMVER} /opt/${DYMVER}
# Dymola is now installed in /opt/$DYMVER
# We will now make it executable with a simple dymola command
sudo ln -s /opt/${DYMVER}/bin/dymola.sh /usr/local/bin/dymola
# Now move the man page to the right location (create the folder first if you get an error)
sudo mv usr/local/man/man1/dymola.1 /usr/local/share/man/man1/dymola.1
cd /opt
sudo unzip DYMOLA_2017_AllLinux.zip -d DYMOLA_2017
cd DYMOLA_2017/linux_x86_64/
sudo alien -i -k dymola-2017.1-1.x86_64.rpm
These instructions were taken from here.