Versions Compared

Key

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

How to port the OpenMI environment from Windows to Linux

Table of contents

Table of Contents

...

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 Oatc.OpenMI.Gui.* for running OpenMI in the configuration editor ConfigurationEditor with GUIs or from command line.

2. Technical prerequisites

...

  • workstation with an Intel Xeon processor
  • 64bit openSUSE 11.0

2.2. Mono

  • Mono v. 1.9.1. for openSUSE 11.0 in 64 bit mode. V. 1.9.1. is also referred to as Mono 2.0.
  • The standard and the sdk sources should be compilable with previous versions. But the GUIs require Windows.Forms, which has been shipped with v. 1.9.1. in Oct. 2009.

...


Fig. 1: Directory structure

After this the first step you should have a copy of the OpenMI sources on your machine with the directory structure displayed in Fig. 1. OpenMI-Version-1-Trunk is in this examples the name for the starting directory $OPENMI_DIR. There are two new subdirectories:

...

  • Go to $OPENMI_DIR/Oatc/src/csharp/Linux/
  • Edit the package files *.pc:
  • drawing.pc: replace the path for System.Drawing.dll
  • nunit-framework.pc: replace the path for nunit.framework.dll
  • windows-forms.pc: replace the path for System.Windows.Forms.dll
  • 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 dlls and exe files will be copied to $OPENMI_DIR/Oatc/src/csharp/bin/.

4.2.2. ... with MonoDevelop

...

Mono applications do not run directly on the Linux system, they are interpreted in a runtime engine, comparable to the virtual machine in java. Thus, the command in the terminal window command line has to start with mono:

  • mono Oatc.OpenMI.Gui.ConfigurationEditor.exe
  • mono Oatc.OpenMI.Gui.

...

  • CommandLine.exe

4.5. UnitTests

  • Go to $OPENMI_DIR/Oatc/src/csharp/Linux/
  • runNunit.Sdk.sh for all Sdk dlls
  • runNunit.Gui.sh for Oatc.OpenMI.Gui.Core.dll
  • runNunit.Examples.ModelComponents.SpatialModels.sh e.g. for a RiverModel and a GroundWaterModel

You have done it.(smile)

5. Miscellaneous

5.1. Running on non-SUSE Linux?

The generated applications will probably run on further platforms, especially non-SUSE Linux derivates, without re-compilation. But it has not been proved yet. Interested persons are invited to try. A short notice to the community, e.g. to the OpenMI Forum on SourceForge, would be great.

5.2. Can I use the same sources for Linux and Windows?

...