NModel with Mono

Jun 9, 2009 at 9:54 AM


I have heard it is possible to compile NModel with Mono. Are there any instructions out there for this?


Paulo Matos

Oct 7, 2009 at 1:20 PM
Edited Oct 7, 2009 at 1:24 PM



Hi Paulo, 

     I just got nmodel  compiled and run with Mono. Here are the steps:


1. once you have mono installed, download the latest source code from nmodel(under the tab "SourceCode", and click on latest submission)

2. it is a zip file, i.e., nmodel-23445.zip. Unzip it to a tmp directory e.g, /var/tmp

3. go to /var/tmp/nmodel/src, type the following


xbuild NModel.sln

4. it will build nmodel, you probably see something like this:


Build succeeded.
	 10 Warning(s)
	 70 Error(s)

Time Elapsed 00:00:03.0929630

5. the exe will be at /var/tmp/nmodel/bin

6. copy all those to a directory, e.g., /usr/local/bin/NModel/

7. You cannot invoke the exe directly, you need to append with mono in front of it. e.g., mono /usr/local/bin/NModel/mc.exe

8. I just stick all these as aliases in my /etc/bashrc as follow:


# for all the Nmodel exe
alias ct='mono /usr/local/bin/nmodel/ct.exe'
alias fsm2dot='mono /usr/local/bin/nmodel/fsm2dot.exe'
alias mc='mono /usr/local/bin/nmodel/mc.exe'
alias mp2dot='mono /usr/local/bin/nmodel/mp2dot.exe'
alias otg='mono /usr/local/bin/nmodel/otg.exe'

Running the sample:

1. you need to compile the sample, in this case I will just use "Bag" example in the source code

2. go to samples/Bag directory, xbuild Bag.sln

3. once it is done, you need to modify the content for the sample files like ct_args1.txt, ct_args2.txt:

from :


# Referenced assemblies




# Referenced assemblies

This will change the windows path to unix path.

4. once you have done that you can run the command:

ct @ct_args1.txtct @ct_args1.txt


ct @ct_args1.txt