Compile OpenModelica and JModelica on Fedora 20


Jan. 19, 2014


Theses compilation instructions were tested using a virtual machine running a basic Fedora 20 installation.

OpenModelica is more difficult to compile than JModelica due its larger code base and dependencies.

Common Part

First we must install a compilation environment and the scientific Python environment:

yum -y install gcc gcc-c++ gcc-gfortran
yum -y install java-1.7.0-openjdk ant
yum -y install autoconf automake libtool
yum -y install cmake
yum -y install patch
yum -y install subversion
yum -y install stow

yum -y install python python-devel
yum -y install python-virtualenv
yum -y install numpy scipy python-matplotlib python-ipython

We will create a stow directory in /usr/local so as to do not spoil our installation with our manually compiled software:

mkdir $STOW # as root
chmod 777 $STOW # could simplify the life

Stow is a software package installation manager that help to manage the /usr/local directory, see man stow for the documentation.

We will also create a virtual environment for Python in order to install the modules which are not provided by Fedora:

cd /usr/local/stow # for example
virtualenv --system-site-packages modelica
source modelica/bin/activate

OpenModelica Installation

OpenModelica requires to install first SML/NG, RML/MMC and OmniORB.


The installation instructions for SML/NJ are available here.

SML/NG is a 32-bit system thus we have to install some 32-bit packages:

yum -y install libgcc.i686 glibc-devel.i686

Define the installation directory:


Download and extract the archive:

mkdir ${SMLNJ_HOME}
gunzip <config.tgz | tar xf -

Run the install script:


The resulting installation is not clean but it works.

Set the PATH environment variable:

export PATH=${SMLNJ_HOME}/bin:$PATH



Don't install mlton Fedora package else mllex fails.

Complete the compilation environment:

yum -y install bison flex

Define the installation directory:


Checkout the source code from OpenModelica SVN:

svn co --username anonymous mmc

Compile and install:

cd mmc
./configure --prefix=${RML_HOME}
make ; make install

Set the PATH environment variable:

export PATH=${RML_HOME}/bin:$PATH



For some reason the OmniORB package of Fedora doesn't provide the Python module.

System Message: WARNING/2 (<string>, line 50); backlink

Duplicate explicit target name: "here".

Download the archives omniORB-4.1.7.tar.bz2 and omniORBpy-3.7.tar.bz2 here.

Extract the archives, compile and install:

tar xjf omniORB-4.1.7.tar.bz2
./configure --prefix=${STOW}/omniORB-4.1.7
make ; make install
tar xjf omniORBpy-3.7.tar.bz2
./configure --with-omniorb=${STOW}/omniORB-4.1.7 --prefix=${STOW}/omniORB-4.1.7
make ; make install

Set the PATH environment variable:

export PATH=${STOW}/omniORB-4.1.7/bin:$PATH


Now we can install the OpenModelica dependencies which are provided by Fedora:

yum -y install boost-devel
yum -y install dbus-devel
yum -y install expat-devel
yum -y install readline-devel
yum -y install sqlite-devel

yum -y install qt-devel qtwebkit-devel qwt-devel
yum -y install gtkglext-devel
yum -y install OpenSceneGraph-qt-devel

yum -y install blas-devel lapack-devel
yum -y install lpsolve-devel

yum -y install opencl-headers sundials-devel # not required

Checkout the source code from OpenModelica SVN:

svn co openmodelica

Compile and install:

cd openmodelica
./configure --enable-omshell-terminal --enable-python-interface --with-omniORB --with-qwt --without-paradiseo --prefix=${STOW}/OpenModelica-1.9
make ; make install

I could not achieve to compile Paradiseo up to now.

Set the Python Path:

export PYTHONPATH=${STOW}/omniORB-4.1.7/lib/python2.7/site-packages:${STOW}/omniORB-4.1.7/lib64/python2.7/site-packages:$PYTHONPATH
export PYTHONPATH=${STOW}/OpenModelica-1.9/lib/python/:${STOW}/OpenModelica-1.9/lib/python2.7/site-packages:$PYTHONPATH

JModelica Installation

System Message: WARNING/2 (<string>, line 212); backlink

Duplicate explicit target name: "here".

The installation instructions on Linux systems are available here.

Install some Python related packages:

yum -y install Cython
yum -y install python-lxml python-nose
yum -y install swig

Next we have two install two dependencies which are not available in Fedora: Ipopt and JPype.


IPopt requires wget to download some archives:

yum -y install wget

Download the archive and some dependencies:

curl -O
tar xzf Ipopt-3.11.7.tgz
cd Ipopt-3.11.7
cd ThirdParty
cd Blas ; ./get.Blas ; cd ..
cd ASL ; ./get.ASL  ; cd ..
cd Mumps ; ./get.Mumps  ; cd ..
cd Metis ; ./get.Metis ; cd ..
cd ..

Compile and install:

mkdir build
cd build
../configure --prefix=${STOW}/Ipopt-3.11.7
make ;  make install


System Message: WARNING/2 (<string>, line 212); backlink

Duplicate explicit target name: "here".

Download the JPype source code here and install the Python module:

cd JPype-
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk
python install


Checkout the source code from the JModelica SVN:

svn co

Compile and install:

export CFLAGS="-fPIC ${CFLAGS}"
export FFLAGS="-fPIC ${FFLAGS}"
mkdir build
../configure --prefix=${STOW}/jmodelica-1.9 --with-ipopt=${STOW}/Ipopt-3.11.7
# /!\ check Python path
make ; make install
make install_casadi