Installing Dymola on Ubuntu for Linux novices

This post looks at installing Dymola on Ubuntu for users that are not experienced with Linux. The installation process is described in the documentation however this can be daunting for Linux novices so a step by step process is provided.

Requirements

There are some things that this post assumes the user has:

  • The Ubuntu operating system installed on a machine or Virtual machine
  • The Dymola Linux installation files, these can be obtained from your Dymola distributor

Note that the Dymola License Server will not run on a Virtual machine, a node locked license will be required.

Installing Dymola

This post looks at installing Dymola 2021x, so commands will be tailored for this. If installing a different Dymola version change the commands appropriately.

Expanding the installation file

So after downloading the installation file you should have a file similar to the file in Figure 1 in the Downloads directory.

Dymola_2021x_HF1.AM_CAT_Dymola.Linux64.1-1.zip
Figure 1. Installation file

Right click on this and select Extract Here. The installation instructions can be found at: ~/Downloads/Dymola_2021x_HF1.AM_CAT_Dymola.Linux64.1-1/AM_CAT_Dymola.Linux64/1/Installation.pdf

This can be used for further installation details.

Installing RPM packages in Ubuntu

The installation files are RPM packages; however, Ubuntu cannot install RPM packages so these packages have to be converted to deb files. To do this conversion, the alien command is used. The article how-to-install-rpm-packages-on-ubuntu describes this situation well; use these instructions to install the alien package (i.e. until Step 3. in the article).

The RPM packages to be installed are in ~/Downloads/Dymola_2021x_HF1.AM_CAT_Dymola.Linux64.1-1/AM_CAT_Dymola.Linux64/1/linux_x86_64.

  1. Open a Terminal by pressing Ctrl+Alt+T.
  2. Change directory to ~/Downloads/Dymola_2021x_HF1.AM_CAT_Dymola.Linux64.1-1/AM_CAT_Dymola.Linux64/1/linux_x86_64
  3. Run the alien command to convert the RPM packages to deb packages.

Below are the instructions used to convert the base Dymola package to a deb package.

$ cd ~/Downloads/Dymola_2021x_HF1.AM_CAT_Dymola.Linux64.1-1/AM_CAT_Dymola.Linux64/1/linux_x86_64
$ sudo alie n –scripts -k dymola-2021.2-1.x86_64.rpm

The alien command call should be repeated for every Dymola library that you want installed from the …/linux_x86_64 directory. This process to convert a file from RPM to deb can take a long time.

To install the deb package use the dpkg command as below.

$ sudo dpkg -i dymola_2021.2-1_amd64.deb

Getting Dymola to run

Dymola is installed in /opt/dymola-2021x-x86_64.

To run Dymola the batch file /usr/local/bin/dymola-2021x-x86_64 must be run.

This batch script sets environmental variables so that the files in the lib64 and lib directories can be located by the Dymola executable.

When things don’t work

Typically when things don’t work it is because Dymola is trying to use a file that is not being found.

“libevent no such file” error

A common error to be returned when the dymola-2021x-x86_64 script is run is that the libevent file is not found as in Figure 2.

Figure 2. libevent file not found
Figure 2. libevent file not found

Dymola uses libevent-2.0.so.5 and it is not installed. The developers have created a fixpack to get around this issue, Dymola2020xFixPack200108. Request this fixpack from your Dymola distributors. Download the fixpack into the Downloads directory, expand it out and copy the files to the lib64 director as below.

$ sudo cp -r ~/Downloads/Dymola2020xFixPack200108/bin/lib64 /opt/dymola-2021x-x86_64/bin/

Run the Dymola starting script to check that the libevent error has been resolved.

Other “no such file found” errors

It is possible that other files that are required by Dymola are not found. In most cases the solution is to search google for install <file> and a description the package needs to be installed is returned. I have an example where this error was generated:
error while loading shared libraries: libsnappy.so.1: cannot open shared object file: No such file or directory

After googling install libsnappy.so.1 and searching around I found that libsnappy-dev contained these files so these were installed with:

$ sudo apt-get install libsnappy-dev

“no Qt platform plugin could be initialized” error

Another error that can occur when starting Dymola is in Figure 3.

Figure 3. Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Figure 3. no QT platform plugin could be initialised

The issue is related to the graphical interface, to debug this check the dependencies of libqxcb.so. This can be done by modifying the Dymola script. To do this open /usr/local/bin/dymola-2021x-x86_64 modify the last line to be:
exec ldd /opt/dymola-2021x-x86_64/bin64/platforms/libqxcb.so > dependencies.txt
and save it to ~/Documents as libqxcbDependencies.

The new script should look like Figure 4.

Figure 4. exec ldd /opt/dymola-2021x-x86_64/bin64/platforms/libqxcb.so > dependencies.txt
Figure 4. Script to determine dependencies of libqxcb[1]

Run this script by using the bash command from Terminal, that is:

$ bash ~/Documents/libqxcbDependencies

This will create dependencies.txt which can be viewed using the Text Editor. Search for “not found” as in Figure 5.

Figure 5. not found example
Figure 5. Not found dependencies of libqxcb.so

All the dependencies that are not found in Figure 5 should be installed.

To get around this, typically one can just google for the packages not being found and install these. Files that are often not found are:

libxcb-xinput.so.0 – run: sudo apt-get install libxcb-xinput.so.0
libxcb-xinerama0 – run: sudo apt-get install libxcb-xinerama0

Create an application file

Unfortunately when Dymola is installed, Dymola is not present in Show Applications, so the entry to Show Applications can be manually added.

Open Files and navigate to /usr/share/applications and open any .desktop file with the Text Editor. Modify the code to be:

[Desktop Entry]
Name=Dymola
Comment=Dymola, Modeling and Simulation environment
Exec=dymola-2021x-x86_64
Type=Application
StartupNotify=false
Terminal=false
Categories=Software

Use Save As to save the file as dymola.desktop to ~/Documents. Copy the file using:

$ sudo cp ~/Documents/dymola.desktop /usr/share/applications/dymola.desktop

Now Dymola should be present when Show applications is opened and Dymola can be started from here. To pin Dymola to the toolbar, open Dymola and right click on the icon in the toolbar and select “Add to Favourites”.

Conclusion

This post will assist with installing Dymola on Ubuntu, especially for Linux novices. If other errors occur during installation please contact your Dymola distributor.

Text of Figure 4

export PATH
export DYMOLA=/opt/dymola-2021-x86_64
export LD_LIBRARY_PATH=$DYMOLA/bin/lib64:$DYMOLA/bin/lib:$LD_LIBRARY_PATH
exec ldd /opt/dymola-2021x-x86_64/bin64/platforms/libqxcb.so > dependencies.txt

Written by: Garron Fish – Chief Engineer

Please get in touch if you have any questions or have got a topic in mind that you would like us to write about. You can submit your questions / topics via: Tech Blog Questions / Topic Suggestion


CONTACT US

Got a question? Just fill in this form and send it to us and we'll get back to you shortly.

Sending

© Copyright 2010-2021 Claytex Services Ltd All Rights Reserved

Log in with your credentials

Forgot your details?