Installing PyFMI 1.5 on Ubuntu 14.04

In this guide we are going to install the following:

And it’s dependencies:

Note: This guide assumes that you have a clean Ubuntu installation.

First we need to install some general dependencies:

sudo apt-get install python-dev python-setuptools python-pip build-essential f2c fort77 gfortran cmake libblas-dev libatlas-dev liblapack-dev unzip libxml2-dev libxslt1-dev lib32z1-dev

The previous step should have installed pip for you, so getting Cython is as easy as:

sudo pip install cython

Also, install lxml:

sudo pip install lxml

To install the SciPy pack, do:

sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

Lets create a working directory for the next steps. From your home directory do:

mkdir pyfmi; cd pyfmi

Your pyfmi folder should be located at /home/yourusername/pyfmi

Download FMILibrary-2.0b3-src.zip manually from here or use wget:

wget http://www.jmodelica.org/downloads/FMIL/FMILibrary-2.0b3-src.zip
unzip FMILibrary-2.0b3-src.zip; cd FMILibrary-2.0b3
mkdir build-fmil; cd build-fmil
cmake -DFMILIB_INSTALL_PREFIX=../install ../
sudo make install test

Now cd back to the pyfmi directory.

Download sundials-2.4.0.tar.gz (2.5.0 should work as well) from here and untar it:

tar xzf sundials-2.4.0.tar.gz
cd sundials-2.4.0
./configure CFLAGS="-fPIC"
make
sudo make install

Now cd back to the pyfmi directory again.

Download Assimulo-2.6.zip manually from here or use wget:

wget https://pypi.python.org/packages/source/A/Assimulo/Assimulo-2.6.zip#md5=6ba042d0d3f611e46247693fab8c67ca
unzip Assimulo-2.6.zip; cd Assimulo-2.6
sudo python setup.py install --sundials-home=/home/yourusername/pyfmi/sundials-2.4.0/ --blas-home=/usr/lib/libblas --lapack-home=/usr/lib/libblas

Now cd back to the pyfmi folder. If everything worked out well, you should be ready to finally install the PyFMI module.

Download PyFMI-1.5.zip from here or use wget:

wget https://pypi.python.org/packages/source/P/PyFMI/PyFMI-1.5.zip#md5=4201d917c5feb0c6380b6e97445ec138
unzip PyFMI-1.5.zip; cd PyFMI-1.5
sudo python setup.py install --fmil-home=/home/yourusername/pyfmi/FMILibrary-2.0b3/install/

And that should do it!

2 thoughts on “Installing PyFMI 1.5 on Ubuntu 14.04”

Leave a Reply

Your email address will not be published. Required fields are marked *