This project has moved and is read-only. For the latest updates, please go here.

MC 0.9 Command line application in Linux

Jul 20, 2011 at 1:10 AM

In an effort to support cross-platform development, we started looking into what it would take to get the MC 0.9 command line application working on Linux. 

These are the steps we followed:

For Ubuntu 11.04:

    1. To install mono-2.10 and monodevelop-2.6 beta3:

  •     Follow instructions on (http://www.integratedwebsystems.com/2011/05/install-mono-2-10-2-and-monodevelop-2-6-beta-3-on-ubuntu-or-fedora-with-a-bash-script/)
  •     Use launcher script to run monodevelop.

    2. To install tortoisehg (taken from http://blog/ragingfx.com/mercurial-with-tortoisehg-installation-ubuntu):

        $ sudo add-apt-repository ppa:mercurial-ppa/releases
        $ sudo add-apt-repository ppa:tortoisehg-ppa/releases
        $ sudo apt-get update
        $ sudo apt-get install tortoisehg tortoisehg-nautilus

     3. Status:

  •     With these instructions can build Vts.Desktop, Vts.MonteCarlo.CommandLineApplication and Vts.Desktop.Test!
  •     When I run Vts.Desktop.Test, 39/242 tests fail (mostly with System.ArgumentException).
  •     When I run Vts.MC.CommandLineApplication, the MC runs to 100% complete, then I get a System.Runtime.Serialization.SerializationException.
Jul 20, 2011 at 1:17 AM

We had a problem with the DataContractSerializer in mono recognizing our KnownTypes.  We created a workaround that creates an array of KnownTypes for use during serialization.  Now MC 0.9 command line application runs successfully to completion.  I still need to verify the results output.  We have updated the code on codeplex. 

 

Jul 20, 2011 at 5:22 PM

I updated but get this build error

: error CS2001: Source file `../Vts/Common/Helpers/Range/UIntRange.cs' could not be found

Looks like the case of the file name is off (small i vs cap I). Per

# ls ../Vts/Common/Helpers/Range/UintRange.cs 
../Vts/Common/Helpers/Range/UintRange.cs

-Martin

Jul 20, 2011 at 5:30 PM
That's a fun one...I'll take a look. Thanks Martin! -D

On Wed, Jul 20, 2011 at 9:22 AM, MartinAmbrose <notifications@codeplex.com> wrote:

From: MartinAmbrose

I updated but get this build error

: error CS2001: Source file `../Vts/Common/Helpers/Range/UIntRange.cs' could not be found

Looks like the case of the file name is off (small i vs cap I). Per

# ls ../Vts/Common/Helpers/Range/UintRange.cs
../Vts/Common/Helpers/Range/UintRange.cs

-Martin

Read the full discussion online.

To add a post to this discussion, reply to this email (virtualphotonics@discussions.codeplex.com)

To start a new discussion for this project, email virtualphotonics@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com







Jul 20, 2011 at 5:39 PM

Just pushed changes in changeset 601 - Lisa, can you sync?

Jul 20, 2011 at 8:18 PM

I've pushed the changeset (e8de116dc1e2) to CodePlex. Unfortunately, I don't have Mono up and running on my Ubuntu VM - can someone verify this is fixed?

Jul 21, 2011 at 1:52 AM
I updated and I can build Vts.Desktop and run the command line application.
>
Jul 21, 2011 at 2:15 AM
Marvelous. :)

On Wed, Jul 20, 2011 at 5:52 PM, lmalenfant <notifications@codeplex.com> wrote:

From: lmalenfant

I updated and I can build Vts.Desktop and run the command line application.
>

Read the full discussion online.

To add a post to this discussion, reply to this email (virtualphotonics@discussions.codeplex.com)

To start a new discussion for this project, email virtualphotonics@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com



Jul 21, 2011 at 3:29 AM
Edited Jul 21, 2011 at 3:34 AM

Thanks that fixed that build error.
However, at least for the desktop and CUI builds, the csproj has a post build event step
which doesn't work under Linux. This results in an error like so

/opt/mono-2.10/lib/mono/4.0/Microsoft.Common.targets: error : Command 'IF NOT EXIST "../build/core/Desktop/Debug" mkdir "../build/core/Desktop/Debug"
copy "/merc/vp/src/Vts.Desktop/bin/Debug//*.*" "../build/core/Desktop/Debug" /y' exited with code: 127.

"copy /y" is the culprit I think.

This results in no mc.exe generated even though this is a _post_ build step.
If I remove this from both the deskop (since it is included by the cui project) and cui project then it builds and runs w/o errors.

-Martin

P.S.

I don't see this when using mono-develop for some reason.
Rather, I only see this when building from the command line via xbuild. 

Jul 21, 2011 at 3:34 AM
This is not a critical feature - just an attempt (on Windows, at least) to locate the core binaries in a high-level folder, as opposed to buried in "src/[project]/bin/[config]".

Can you think of a platform-agnostic way to achieve the same thing? Maybe have a compiler switch that conditionally performs that copy if Windows, else relies on a linux make file with similar logic?

David

On Wed, Jul 20, 2011 at 7:29 PM, MartinAmbrose <notifications@codeplex.com> wrote:

From: MartinAmbrose

Thanks that fixed that build error.
However, at least for the desktop and CUI builds, the csproj has a post build event step
which doesn't work under Linux. This results in an error like so

/opt/mono-2.10/lib/mono/4.0/Microsoft.Common.targets: error : Command 'IF NOT EXIST "../build/core/Desktop/Debug" mkdir "../build/core/Desktop/Debug"
copy "/merc/vp/src/Vts.Desktop/bin/Debug//*.*" "../build/core/Desktop/Debug" /y' exited with code: 127.

"copy /y" is the culprit I think.

This results in no mc.exe generated even though this is a _post_ build step.
If I remove this from both the deskop (since it is included by the cui project) and cui project then it builds and runs w/o errors.

-Martin

Read the full discussion online.

To add a post to this discussion, reply to this email (virtualphotonics@discussions.codeplex.com)

To start a new discussion for this project, email virtualphotonics@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




Jul 21, 2011 at 1:02 PM

It looks to be possible to edit the .cpsroj by hand with OS conditionals.
This specific case "copy vs. cp" is discussed here
http://www.claassen.net/geek/blog/2011/02/platform-specific-prepostbuildevent-in-csproj-files.html

-Martin 

Jul 23, 2011 at 5:28 PM
Edited Jul 23, 2011 at 5:55 PM

Moved discussion to comment section of issue tracker.
http://virtualphotonics.codeplex.com/workitem/25

Aug 28, 2011 at 10:11 PM

I wanted to try ubuntu 11.10 because it has mono-2.10.4 built in and monodevelop-2.6 can be easily installed. I did the following:

  1. Updated to 11.10 from 11.04 by using "update-manager -d" and following prompts. This is an alpha release so a bit shaky at first.  I found on the web that some errors are typical and that the system should run fine with them.  For example, you might get error after install "gnome-setting-daemon closed unexpectantly".  To fix this edit /etc/default/apport and change enabled from 1 to 0 and the error goes away.  The funny thing is that I looked up apport and supposedly it intercepts crashes right when they happen the first time and gathers potentially useful information about the crash and the OS environment.
  1. Install other software
  • sudo apt-get install mercurial
  • sudo apt-get install tortoisehg, tortoisehg-nautilus
  • sudo apt-get install monodevelop

When I tried "thg" which should bring up tortoisehg, got error "GTK_IS_WIDGET failed".  Found on web to install qtconfig:

  • sudo apt-get install qt4-qtconfig

 then bring up qtconfig and change gui styles to "motif".  I was able to bring up "thg" and then use file->clone repository to get software from bitbucket ("thg userconfig" allows you to set user settings like rebase after pull, etc.).  I am able to bring up monodevelop, build Vts.Desktop and Vts.MonteCarlo.CommandLineApplication and in a terminal window execute "mono mc.exe infile=XXX" successfully.  I just found out from ubuntuupdates.org that moonlight-web-devel was deleted from 11.10 so may have come to a stop point.