Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dymola install instructions WSL 2 Ubuntu 20.04 #7

Merged
merged 3 commits into from
Mar 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 143 additions & 52 deletions Installation/Dymola/2021x.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,143 @@
## Installation

### Ubuntu 20.04

- Go to home directory
```
`cd $HOME`
```

- Install additional libraries
```
sudo apt update
sudo apt-get install unzip rpm2cpio
```

- Unzip Dymola installation file
```
unzip Dymola_2021x.AM_CAT_Dymola.Linux64.1-1.zip
```

- Set Dymola version
```
DYMVER=dymola-2021x-x86_64
```

- Change directory to unzipped file and convert rpm files
```
cd AM_CAT_Dymola.Linux64/1/linux_x86_64/
for ff in `ls *.rpm`; do (sudo rpm2cpio $ff | cpio -i --make-directories); done
```

- Update the directory priviledge
```
sudo chmod -R o-w opt/${DYMVER}
```

- Move files to `opt` directory
```
sudo mv opt/${DYMVER} /opt/${DYMVER}
```
- Make the file executable
```
sudo ln -s /opt/${DYMVER}/bin64/dymola.sh /usr/local/bin/dymola
```


ADdditoi
```
unzip 2021x_bin.zip
mv 2021x_bin/bin/lib/* /opt/$DYMVER/bin/lib/
mv 2021x_bin/bin/lib64/* /opt/$DYMVER/bin/lib64/
```

# Installation Instructions for Dymola 2021x

## Contents
- [Installation Instructions for Dymola 2021x](#installation-instructions-for-dymola-2021x)
- [Contents](#contents)
- [Operating System](#operating-system)
- [WSL 2 - Ubuntu 20.04](#wsl-2---ubuntu-2004)
- [Enable X Server for WSL Dymola GUI](#enable-x-server-for-wsl-dymola-gui)
- [WSL 2 X Server](#wsl-2-x-server)
- [Related Resources](#related-resources)
- [License Setup](#license-setup)
- [Known Issues](#known-issues)
- [WSL 2 Issues](#wsl-2-issues)

# Operating System

## WSL 2 - Ubuntu 20.04

1. Go to home directory
```
cd $HOME
```

1. Install additional libraries
```
sudo apt update
sudo apt-get install unzip rpm2cpio libglu1-mesa


sudo apt-get install qt5-default
sudo apt-get install build-essential libgl1-mesa-dev
```

1. Unzip Dymola installation file
```
unzip Dymola_2021x.AM_CAT_Dymola.Linux64.1-1.zip
```

1. Set Dymola version
```
DYMVER=dymola-2021x-x86_64
```

1. Change directory to unzipped file and convert rpm files
```
cd AM_CAT_Dymola.Linux64/1/linux_x86_64/
for ff in `ls *.rpm`; do (sudo rpm2cpio $ff | cpio -i --make-directories); done
```

1. Update the directory priviledge
```
sudo chmod -R o-w opt/${DYMVER}
```

1. Move files to `opt` directory
```
sudo mv opt/${DYMVER} /opt/${DYMVER}
```

1. Make the file executable
```
sudo ln -s /opt/${DYMVER}/bin64/dymola.sh /usr/local/bin/dymola
```

1. Add additional libraries needed to fix the Ubuntu 20.04 Dymola installation
- Download [2021x_bin_ubuntu_20_04.zip](https://github.com/ORNL-Modelica/awesome-modelica/blob/main/Installation/Dymola/2021x_bin_ubuntu_20_04.zip)
- Move the file to your Ubuntu home directory
```
cd $HOME
mv /mnt/c/Users/USERNAME/Downloads/2021x_bin_ubuntu_20_04.zip .
unzip 2021x_bin_ubuntu_20_04.zip
```
- Move the unzipped files to the dymola installation directory
- If you have closed the terminal you may have to redefine `DYMVER` (see above)
```
mv 2021x_bin_ubuntu_20_04/bin/lib/* /opt/$DYMVER/bin/lib/
mv 2021x_bin_ubuntu_20_04/bin/lib64/* /opt/$DYMVER/bin/lib64/
```
1. Follow instructions for [X Server installation](#wsl-2-x-server)
1. Launch dymola by typing `dymola` or for dark mode `dymola /dark` into the terminal.

# Enable X Server for WSL Dymola GUI

## WSL 2 X Server

- Last checked: March 4, 2020
- Windows 1909
- Ubuntu 20.04

>Recommend [VcXsrv](https://sourceforge.net/projects/vcxsrv).

Installation options to enable are for VcXsrv are:
1. `Display settings`:
- Multiple Windows
- Display number = -1

1. `Client startup`:
- Start no client

1. `Extra settings`:
- Clipboard
- Primary Selection
- Native opengl

1. Save configuration to desired location.
- This creates a shortcut. **Use this to launch the server in the future.**
- If you need to reset your configuration, launch XLaunch which can be found in in start menu under the VcXsrv folder or at the VcXsrv installation location
- e.g., `C:\Program Files\VcXsrv\xlaunch.exe`

1. Go to your home directory and modify your `.bashrc` file
- `cd $HOME`
- `vim .bashrc`
- Scroll to the bottom, press `i` and enter the following at the bottom.

````
export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0
export LIBGL_ALWAYS_INDIRECT=1
````
- Then save and quit by pushing `esc` and then type `:wq`
- To get the changes either restart your terminal or type `source .bashrc` into the terminal.

1. To test that it is working, install a `xeyes` (a simple GUI) application and run it!
- Install xeyes: `sudo apt install x11-apps`
- Run xeyes: `xeyes`

### Related Resources
- https://stackoverflow.com/a/63092879/5639728

# License Setup

1. Open Dymola
1. Go to `Tools` tab
1. Select `License Setup`
1. Go to the `Setup` tab
- If on a license server, enter `Server name` and `Port`.
- If on a node locked license, browse to your `dymola.lic` file.

# Known Issues
> If you've got a fix, please help! If you've got an issue, add it below.

## WSL 2 Issues
- Using VcXsrv, the Dymola window can't move or resize. This same behavior is also seen on other applications as well (e.g., xeyes).