[ Beneath the Waves ]

TMSB on Unix-like Operating Systems

article by Ben Lincoln

 

There are two main categories of setup work needed to run The Mirror's Surface Breaks on a Unix-like operating system: getting a current version of Mono installed, and building the DaVinci's Shadow script processor.

Mono

Mono is the open-source implementation of Microsoft's .NET framework. The Mirror's Surface Breaks is a .NET (2.0) application, so you will definitely need Mono to run it anywhere else. You will specifically need at least version 2.10.2 of Mono, and it is very important that you realize that the "10" in "2.10.2" is greater than the "6" in "2.6.x". Software version numbers are not decimal numbers![1]

The difficulty of achieving this depends on the operating system in question. If the packaging system for yours makes a reasonably current version of Mono available, just go ahead and install it that way. For example, OpenSUSE users can just install mono-core, mono-data, mono-winforms, and so on and be ready to go. If your operating system does not have a precompiled version available, or (like Kubuntu/Ubuntu) only has an embarassingly-outdated version in its repository, you will need to download and compile Mono yourself. This can be a daunting process.

I was able to update Mono to a non-paleolithic version on a Kubuntu 10.10 VM by following these steps, which are based on Nathan Bridgewater's instructions:

  1. Remove the fossilized remains of the "current" version of Mono for Ubuntu by running sudo apt-get remove mono-runtime
  2. Hopefully improve the rendering of fonts by running sudo apt-get install msttcorefonts
  3. Execute the following commands:
    mkdir mono210
    cd mono210
    sudo apt-get install wget
    wget --no-check-certificate https://github.com/nathanb/iws-snippets/raw/master/mono-install-scripts/ubuntu/install_mono-2.10.sh
  4. Edit the install_mono-2.10.sh to remove the unnecessary apache2 and apache2-threaded-dev from the apt-get call (I don't want a webserver component installed!)
  5. Make the more complicated change to the script noted below.
  6. Execute the following command:
    ./install_mono-2.10.sh
  7. Edit ~/.bashrc file to add the following lines: export PATH="$PATH:/opt/mono-2.10/bin"
    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/mono-2.10/lib"

I used a similar process (also based on the same original instructions) to get it installed on Fedora 16:

  1. Execute the following commands:
    mkdir mono210
    cd mono210
    sudo apt-get install wget
    wget --no-check-certificate https://github.com/nathanb/iws-snippets/raw/master/mono-install-scripts/ubuntu/install_mono-2.10.sh
  2. Edit the install_mono-2.10.sh to remove the unnecessary httpd and httpd-devel from the yum call (I still don't want a webserver component installed!)
  3. Make the more complicated change to the script noted below.
  4. Execute the following command:
    ./install_mono-2.10.sh
    [ note: this will probably take a very long time. ]
  5. Edit ~/.bashrc to add the following lines: export PATH="$PATH:/opt/mono-2.10/bin"
    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/mono-2.10/lib"

"The more complicated change to the script" is that you should find this block:

PACKAGES=("mono-2.10.8"
"libgdiplus-2.10"
"gtk-sharp-2.12.11"
"xsp-2.10.2"
"mod_mono-2.10")

URLS=("http://download.mono-project.com/sources/mono/mono-2.10.8.tar.gz"
"http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2"
"http://download.mono-project.com/sources/gtk-sharp212/gtk-sharp-2.12.11.tar.bz2"
"http://download.mono-project.com/sources/xsp/xsp-2.10.2.tar.bz2"
"http://download.mono-project.com/sources/mod_mono/mod_mono-2.10.tar.bz2")

...and change it so it reads:

PACKAGES=("mono-2.10.8"
"libgdiplus-2.10"
"gtk-sharp-2.12.11")

URLS=("http://download.mono-project.com/sources/mono/mono-2.10.8.tar.gz"
"http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.tar.bz2"
"http://download.mono-project.com/sources/gtk-sharp212/gtk-sharp-2.12.11.tar.bz2"
)

That is, you want to get rid of the parts that install xsp and mod_mono, because those are only useful if you're running a webserver.

I was able to update Mono to 2.10.6 on a PC-BSD 8.2 VM by running these commands, although this is not guarantee they will work for you:

su

cd /usr/ports/lang/mono/

make install clean

cd /usr/ports/x11-toolkits/libgdiplus

make install clean

exit

The second package is necessary because for whatever reason, the main Mono package for BSD doesn't include libgdiplus, which is very much required for The Mirror's Surface Breaks.

Compiling DaVinci's Shadow

See the DaVinci's Shadow Build Process - Linux article for a detailed discussion of the actual build process on Linux, or DaVinci's Shadow Build Process - BSD for the process I used on BSD.

Once DaVinci's Shadow has been compiled, you can point TMSB to the location of the compiled executable in the Execution tab, as discussed in TMSB Tutorial 1: Basic Use. For example, on my systems, I usually end up with that path being /home/blincoln/dshadow-2.9.2/dshadow, or wherever the current version is if it's no longer 2.9.2.

IMPORTANT: if your compiled libraries, headers, and so forth are placed in a location other than /usr (for example /usr/local), you will need to update the library_linux.dvrc file in the shared location (for example, /usr/local/share/dshadow/library/) and also the build directory (for example ~/dshadow-2.9.2/library/), or TMSB will fail to process any images.

Limitations and Other Issues

I am currently aware of the following issues when running TMSB on non-Windows systems:

  1. If the output image format does not include any 8-bit images, then the thumbnails will not display correctly in the TMSB processing status window. This is due to a limitation of Mono. As long as you select an output configuration like 16-Bit-Per-Channel TIFF and 8-Bit-Per-Channel JPEG Output that also includes an 8-bit format, this should not be a problem.
  2. The Collect and Display Performance Data option seems to display memory use correctly, but not CPU use. I'm not sure if this is an issue with my code, or with the way Mono represents this data. CPU use is exaggerated compared to the values that show in e.g. the KDE System Monitor, but not by a constant multiplier. It does go up when CPU use is high, and go down when it's low, though :\.
  3. It is very likely that unexpected results will occur when run on a big-endian system, such as one based on an IBM Power processor. I do not have such a system to test this theory on.
 
Footnotes
1. ...except when they are, because some developers also don't follow the standard practice.
 
[ Page Icon ]