Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The document describes how to generate and run OpenMI Linux dlls and executables from the original Windows C# sources. This is done by using Mono, a .NET Open Source project on different platforms. Only few adjustments are necessary in order to port the complete OpenMI functionality:

  • the standard OpenMI.Standard
  • the source development kit Oatc.OpenMI.Sdk.*
  • the dlls and executables for running OpenMI in the ConfigurationEditor with GUIs or from command line.

...

Panel
bgColor#F7D6C1
borderStyledashed

gmcs -out:<target>.exe -r<linkedLib_1>.dll,<linkedLib_k>.dll -pkg:<package_1>.pc;...;,<package_m>.pc <source_1>.cs <source_n>.cs

...

The GUI sources use Windows.Forms, that works with resource files in order to design the graphical elements. The Windows resource files (*.resx) are generated automatically in the Microsoft Visual Studio IDE. Linux applications do not process them and create a "resource not found" exception during runtime. Thus, the resources have to be converted with the Mono tool resgen / resgen2. The following command generates a Linux readable resource <name>.resource:
resgen <name>.resx generates a Linux readable resource <name>.resource .
Visual Studio assigns a resource file to a C# file automatically. On a Linux machine naming conventions guarantee the correct assignment. On linux systems The C# source and its resource file must have the same prefix. This first part of the prefix must be the namespace.

...

The original Windows resources contained *.bmp graphics with a 24bit colour depth. Mono on Linux could not process them. The solution was to convert the BMPs externally to 8bit GIFs, before adding them to the resource in the Visual Studio IDE.

Mono can not process all type of GUIs. Mono 2.0 has nearly the full functionality of Windows.Forms. It does not support the WindowsPresentationFoundation WPF, shipped since .NET 3.0, which generates resources in XAML style or logical resources. Thus, it is highly recommended to that the developers of OpenMI GUIs use Forms elements in OpenMI GUIs instead of WPF elements.

3.3. Help for Developers

Mono Forums are very helpful: http://www.go-mono.com/forums/
A part of the error Error messages are partly the same as in Microsoft Windows .NET. You an look them up on the MSDN homepage.

...

4.2. Building

...

...

4.2.1. ... with shell scripts

  • Go to $OPENMI_DIR/Oatc/src/csharp/Linux/

...

  • Run build.Standard.sh
  • Run build.Sdk.sh and the Sdk including UnitTest will be built.
  • Run build.Gui.sh and the Gui including UnitTest will be built.
  • Run build.Examples.ModelComponents.SpatialModels.sh will generate test models.

All The dlls and exe files will be copied to $OPENMI_DIR/Oatc/src/csharp/bin/.

...

It is recommended to extend two environment variable with the bin directory:
variables:

Panel
bgColor#F7D6C1
borderStyledashed

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OPENMI_DIR/Oatc/src/csharp/bin/
export MONO_PATH=$MONO_PATH:$OPENMI_DIR/Oatc/src/csharp/bin/

4.4. Running the applications

...

  • ConfigurationEditor: Help page
  • ConfigurationEditor ConnectionProperties dialogue: Buttons "Use Element Type Filter" and "Use Dimension Filter" do not work -> there are no filters
  • ConfigurationEditor: RegisterFileExtensions can not work on Linux.
  • set of dlls exe files for download