Building Mono 2.4 from source on Ubuntu 8.10

Sad to say that the latest versions of Ubuntu and Debian do not provide the latest packages of Mono preferring stability over bleeding edge. Also, according to the packagers’  mailing list it is not an easy task to provide packages for mono and all the software that binds to it.

I am a sucker for bleeding edge, especially when it comes to thinks like Mono. The latest stable release of Mono, version 2.4 has a lot of new features like the C# interactive repl shell, SIMD extensions and better support for C# 3/.NET 3.5 features, like extension methods and LINQ. See the release notes here. I was disappointed when the most recent version of mono debian packages I could find were for the 2.0.1 version on third-party repositories.

What to do then? Download the source, configure and build to run in parallel to the version of mono installed in my Ubuntu desktop (the mono run-time is always installed on Ubuntu by default, even the live CD runs it, since it is needed to run .NET applications, like F-Spot, that have become a standard in the GNOME desktop). It turns out that it’s not that difficult as it sounds.

Step 1: Install prerequisites for compilation.

First of all, you will need to setup the appropriate tools for configuring and compiling source code. You can install these through the Synaptic package manager but for the sake of speed let’s use some command line magik Wink

Open a console and type in the following to install the gcc compiler, and development header files needed to compile the mono compilers, tools and library stack.

user@system$> sudo apt-get update
user@system$> sudo apt-get install build-essential autoconf automake \
bison flex gtk-sharp2-gapi boo gdb valac libfontconfig1-dev \
libcairo2-dev libpango1.0-dev libfreetype6-dev libexif-dev \
libjpeg62-dev libtiff4-dev libgif-dev zlib1g-dev libatk1.0-dev \
libglib2.0-dev libgtk2.0-dev libglade2-dev libart-2.0-dev \
libgnomevfs2-dev libgnome-desktop-dev libgnome2-dev libgnomecanvas2-dev \
libgnomeui-dev libgnomeprint2.2-dev libgnomeprintui2.2-dev \
libpanel-applet2-dev libnautilus-burn-dev librsvg2-dev \
libgtkhtml3.14-dev libgtksourceview2.0-dev libgtksourceview-dev \
libvte-dev libwnck-dev libnspr4-dev libnss3-dev libxul-dev \
libwebkit-dev libvala-dev

This should install all the necessary software and development headers needed for the compilation.

Step 2: Download mono 2.4 source archives.

Go to http://ftp.novell.com/pub/mono/sources-stable/ . You don’t need every archive in that list.
In this guide we will use: mono-2.4.tar.bz2libgdiplus-2.4.tar.bz2gluezilla-2.4.tar.bz2xsp-2.4.tar.bz2mono-tools-2.4.tar.bz2gecko-sharp-2.0-0.13.tar.bz2mono-debugger-2.4.tar.bz2mono-addins-0.4.zipgtk-sharp-2.12.8.tar.bz2gnome-sharp-2.20.1.tar.bz2gnome-desktop-sharp-2.20.1.tar.bz2webkit-sharp-0.2.tar.bz2

Also go to the MonoDevelop website and download the sources for monodevelop 2.0: monodevelop-2.0, monodevelop-debugger-mdb-2.0, monodevelop-debugger-gdb-2.0, monodevelop-database-2.0, monodevelop-java-2.0, monodevelop-vala-2.0

Create a directory in your home directory for the extracted sources, e.g. src/mono-2.4.

user@system$> mkdir -p src/mono-2.4; cd src/mono-2.4

Extract the downloaded archives to that directory.

Step 3: Prepare the parallel environment

Now it’s time to prepare our system for two versions of the mono runtime. A good idea is to install everything related to mono 2.2 to some path like /opt/mono-2.2 and create shell script to load an environment that will use the version located in that path instead of the default installation. That way you will not render your existing mono installation unstable or broken.

Now create a script that will load the separate mono-2.4 environment.

user@system$> cat > mono-2.4-environment
#!/bin/bash
MONO_PREFIX=/opt/mono-2.4
GNOME_PREFIX=/opt/gnome-2.4
export DYLD_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$MONO_PREFIX/include:$GNOME_PREFIX/include
export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig:$GNOME_PREFIX/lib/pkgconfig
PATH=$MONO_PREFIX/bin:$PATH
PS1="[mono-2.4] \w @ "

[Press Ctrl+D for EOF to write the file and get back to the prompt]

user@system$> sudo mv mono-2.4-environment /usr/local/bin
user@system$> sudo chmod +x /usr/local/bin/mono-2.4-environment

And create a second script that will load the environment and execute its argurments.

user@system$> cat > mono-2.4
#!/bin/bash
MONO_PREFIX=/opt/mono-2.4
GNOME_PREFIX=/opt/gnome-2.4
export DYLD_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$MONO_PREFIX/include:$GNOME_PREFIX/include
export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig:$GNOME_PREFIX/lib/pkgconfig
PATH=$MONO_PREFIX/bin:$PATH

exec "$@"

[Press Ctrl+D for EOF to write the file and get back to the prompt]

user@system$> sudo mv mono-2.4 /usr/local/bin
user@system$> sudo chmod +x /usr/local/bin/mono-2.4

Load the environment:

user@system$> source mono-2.4-environment

After this command, the prompt should change and contain [mono-2.4] to indicate that you are operating in a Mono 2.4 environment.

[mono-2.4] ~ @ cd ~/src/mono-2.4

NOTE! For the sake of readability the prompt indication in the instructions will remain the generic user@system$> but for the rest of the guide you must make sure that you follow each step while in the 2.4 environment.

And now create the directory where everything will be installed:

user@system$> sudo mkdir -p /opt/mono-2.4

Step 4: libgdiplus

Before compiling the main sources of mono we must compile libgdiplus if we want to have an implementation of the System.Drawing namespace.

user@system$> cd libgdiplus-2.4
user@system$> ./configure --prefix=/opt/mono-2.4 --with-pango

The output of the configure script should be something like this:

---
Configuration summary

   * Installation prefix = /opt/mono-2.4
   * Cairo = 1.8.0 (system)
   * Text = pango
   * EXIF tags = yes
   * Codecs supported:

      - TIFF: yes
      - JPEG: yes
      - GIF: yes
      - PNG: yes
      NOTE: if any of the above say 'no' you may install the
            corresponding development packages for them, rerun
            autogen.sh to include them in the build.

---

If any of the options say no then you have a missing dependency. You might want to use the Synaptic package manager to find the appropriate package to install. However, these dependencies are optional.

Now it’s time to build the source.

user@system$> make
user@system$> sudo make install

Step 5: mono-2.4

Now it’s time to compile mono’s main sources which will produce, among others, the c# compilers and the base class libraries.

user@system$> cd ../mono-2.4
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install

Verify that the mono compilers have been installed:

user@system$> which gmcs

This should output: /opt/mono-2.4/bin/gmcs
Your existing mono installation will be preserved since everything is installed to the /opt/mono-2.4 directory.

Step 6: gtk+ and gnome

Now it’s turn to compile libraries needed for desktop environment, namely gtk-sharp, gnome-sharp, gnome-desktop-sharp, gtksourceview-sharp.

user@system$> cd ../gtk-sharp-2.12.8
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../gnome-sharp-2.20.1
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../gnome-desktop-sharp-2.20.1
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install

Step 7: gluezilla, gecko-sharp, webkit-sharp

Now lets compile libraries for embedding the gecko and webkit html rendering engines.

user@system$> cd ../gluezilla-2.4
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../gecko-sharp-2.0-0.13
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../webkit-sharp-0.2
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install

Step 8: build Mono.Addins

Turn to compile the Mono.Addins libraries:

user@system$> cd ../mono-addins-0.4
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install

Step 9: build Mono tools

Now it’s turn to compile the marvelous collection of Mono tools, including Gendarme and GSharp (the C# interactive shell).

user@system$> cd ../mono-tools-2.4
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install

After this you have installed the gsharp tool. Test it out:

user@system$> gsharp

Play a little with the C# repl Smile Type quit; when you’re done.

Step 10: build Mono XSP

This is actually something very useful. XSP is a standalone web server developed in C#. It can be run through the command line or even embedded into your application by referencing the Mono.WebServer assembly.

user@system$> cd ../xsp-2.4
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install

Step 11: build the Mono Debugger

Getting closer to the end of our compilation session, let’s build the mono debugger allowing us to debug the faulty software we write.

user@system$> cd ../mono-debugger-2.4
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install

Step 12: build MonoDevelop 2.0

Now what would all this be without a nice IDE? MonoDevelop 2.0 brings us finally debugger support!

user@system$> cd ../monodevelop-2.0
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../monodevelop-debugger-mdb-2.0
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../monodevelop-debugger-gdb-2.0
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../monodevelop-database-2.0
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../monodevelop-java-2.0
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install
user@system$> cd ../monodevelop-vala-2.0
user@system$> ./configure --prefix=/opt/mono-2.4
user@system$> make
user@system$> sudo make install

And… That’s it. You now have a working mono-2.4 environment and an excellent IDE to work with.

You can launch any .NET program with Mono 2.4 with:

user@system$> mono-2.4 PATH_TO_THE_PROGRAM_AND_ITS_ARGUMENTS_IF_ANY

For example to launch MonoDevelop 2.0:

user@system#> mono-2.4 monodevelop

NOTE! This will work only for shell scripts that are normally distributed with mono applications. If you look at /opt/mono-2.4/bin/monodevelop you will see that it is a shell script that essentially runs something like this: mono /opt/mono-2.4/lib/monodevelop/bin/MonoDevelop.exe. Trying to execute a .NET application, e.g. called main.exe, by typing mono-2.4 main.exe will fail. You sould type mono-2.4 mono main.exe instead.

Enjoy hacking!

Share and enjoy Wink
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Reddit
  • Technorati
  • TwitThis

Tags: , , , , , , , ,

74 Responses to “Building Mono 2.4 from source on Ubuntu 8.10”

  1. forgot to mention
    i only use console apps on the xbox
    its a headless server
    so graphic environment not needed

  2. ProHvost says:

    1st: sorry for my english.

    2nd: on step 5, after ‘make’ I had error:

    MCS [net_2_0] al.exe
    Stacktrace:

    at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext,System.Collections.ArrayList&,bool,Mono.CSharp.Location)
    at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext,System.Collections.ArrayList&,bool,Mono.CSharp.Location)
    at Mono.CSharp.ConstructorInitializer.Resolve (System.Reflection.Emit.ConstructorBuilder,Mono.CSharp.EmitContext)
    at Mono.CSharp.Constructor.Emit ()
    at Mono.CSharp.TypeContainer.EmitConstructors ()
    at Mono.CSharp.TypeContainer.EmitType ()
    at Mono.CSharp.RootContext.EmitCode ()
    at Mono.CSharp.Driver.Compile ()
    at Mono.CSharp.Driver.Main (string[])
    at (wrapper runtime-invoke) Mono.CSharp.Driver.runtime_invoke_int_object (object,intptr,intptr,intptr)

    Native stacktrace:

    /home/prohvost/src/mono-2.4/mono-2.4/mono/mini/mono [0x80cbed4]
    /home/prohvost/src/mono-2.4/mono-2.4/mono/mini/mono [0x80f687b]
    [0x4001a410]
    [0x403e4066]
    [0x41150a81]
    [0x4114e50b]
    [0x4114e188]
    [0x4114c58e]
    [0x4114c0ef]
    [0x40f4d3dd]
    [0x4068693d]
    [0x40681203]
    /home/prohvost/src/mono-2.4/mono-2.4/mono/mini/mono(mono_runtime_exec_main+0×16e) [0x812696e]
    /home/prohvost/src/mono-2.4/mono-2.4/mono/mini/mono(mono_runtime_run_main+0×16b) [0x812708b]
    /home/prohvost/src/mono-2.4/mono-2.4/mono/mini/mono(mono_main+0×18ea) [0x80b38ea]
    /home/prohvost/src/mono-2.4/mono-2.4/mono/mini/mono [0x805af31]
    /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0x4014f685]
    /home/prohvost/src/mono-2.4/mono-2.4/mono/mini/mono [0x805ae61]

    Debug info from gdb:

    [Thread debugging using libthread_db enabled]
    [New Thread 0x402c1e30 (LWP 23259)]
    [New Thread 0x40b87b90 (LWP 23323)]
    [New Thread 0x40a66b90 (LWP 23322)]
    0×4001a430 in __kernel_vsyscall ()
    3 Thread 0×40a66b90 (LWP 23322) 0×4001a430 in __kernel_vsyscall ()
    2 Thread 0×40b87b90 (LWP 23323) 0×4001a430 in __kernel_vsyscall ()
    1 Thread 0×402c1e30 (LWP 23259) 0×4001a430 in __kernel_vsyscall ()

    Thread 3 (Thread 0×40a66b90 (LWP 23322)):
    #0 0×4001a430 in __kernel_vsyscall ()
    #1 0×40107906 in nanosleep () from /lib/tls/i686/cmov/libpthread.so.0
    #2 0×081aed38 in collection_thread (unused=0×0) at collection.c:34
    #3 0×4010050f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #4 0×4021aa0e in clone () from /lib/tls/i686/cmov/libc.so.6

    Thread 2 (Thread 0×40b87b90 (LWP 23323)):
    #0 0×4001a430 in __kernel_vsyscall ()
    #1 0×40106405 in sem_wait@@GLIBC_2.1 () from /lib/tls/i686/cmov/libpthread.so.0
    #2 0×08139ba9 in finalizer_thread (unused=0×0) at gc.c:935
    #3 0×0810b7d8 in start_wrapper (data=0×971a710) at threads.c:623
    #4 0×081a7ea6 in thread_start_routine (args=0×971cecc) at threads.c:286
    #5 0×081d0c78 in GC_start_routine (arg=0×26f20) at pthread_support.c:1382
    #6 0×4010050f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
    #7 0×4021aa0e in clone () from /lib/tls/i686/cmov/libc.so.6

    Thread 1 (Thread 0×402c1e30 (LWP 23259)):
    #0 0×4001a430 in __kernel_vsyscall ()
    #1 0×4010710b in read () from /lib/tls/i686/cmov/libpthread.so.0
    #2 0×080cc076 in mono_handle_native_sigsegv (signal=11, ctx=0×40401d0c) at /usr/include/bits/unistd.h:45
    #3 0×080f687b in mono_arch_handle_altstack_exception (sigctx=0×40401d0c, fault_addr=0×1f, stack_ovf=0)
    at exceptions-x86.c:881
    #4
    #5 mono_magic_trampoline (regs=0xbfbb15f8,
    code=0×41152bc2 “\203�20\203E�01\213G \213@\f9E�17\214P���\213E�\211E��E�”, m=0×9767d14, tramp=0×0)
    at mini-trampolines.c:341
    #6 0×403e4066 in ?? ()
    #7 0×41150a81 in ?? ()
    #8 0×4114e50b in ?? ()
    #9 0×4114e188 in ?? ()
    #10 0×4114c58e in ?? ()
    #11 0×4114c0ef in ?? ()
    #12 0×40f4d3dd in ?? ()
    #13 0×4068693d in ?? ()
    #14 0×40681203 in ?? ()
    #15 0×0812696e in mono_runtime_exec_main (method=0×124e38, args=0×47fc0, exc=0×0) at object.c:3301
    #16 0×0812708b in mono_runtime_run_main (method=0×973564c, argc=9, argv=0xbfbb1ec0, exc=0×0) at object.c:3089
    #17 0×080b38ea in mono_main (argc=13, argv=0xbfbb1eb4) at driver.c:969
    #18 0×0805af31 in main (argc=-2955184, argv=0xf000ff52) at main.c:34
    #0 0×4001a430 in __kernel_vsyscall ()

    =================================================================
    Got a SIGSEGV while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================

    what can I did wrong?

    • make sure u have enough ram available
      mono2.4 will fail i think at some point
      if there is not enough phys ram
      u cant count swap ram
      it could be that

    • Jan Dzik says:

      I don’t know if this could be a memory exhaustion issue. It looks like a segmentation fault, which means that would be a bug in mcs. I noticed similar segfaults a few times when compiling some of my own code with development snapshots of mono. Running the compiler again a second time seemed to get around it. I’d suggest typing make again. If the problem persists (you can recreate it) then file a bug report.

  3. works great
    how do i install the microsoft extensions
    that i have from my 191 install
    im getting an error on certain compile
    namespace Nwc not there
    so it cant find xmlrpc assembly
    i think these were supplied by some ubuntu packages
    in the mono 191 install
    thanx again for ur wonderful guide

    • Jan Dzik says:

      You do not need to install packages from an existing mono installation. There is a way to combine the GAC (Global Assembly Cache) of your existing mono installation (1.9.1 in your case) with the GAC of Mono 2.4. You can use the environmental variable MONO_GAC_PREFIX to set extra paths to be used along with the default GAC location by the runtime. This way, you could specify as an extra path, the path to the GAC of the 1.9.1 installation (should be in /usr/lib/mono/gac). Just add this: export MONO_GAC_PREFIX = /usr:$MONO_GAC_PREFIX with the rest of exports in the scripts in step 3. If you have the xmlrpc assembly installed in the GAC of 1.9.1 adding this to the scripts should work.

  4. Kev C says:

    Flawless instructions!

    Thanks man!

  5. [...] gustan compilarlo, sigan este howto y compilarán sin [...]

  6. confused says:

    I assume the /opt/mono-2.4 is all the source folders, extracted, copied to the /opt/mono-2.4 directory.

    What is the /opt/gnome-2.4?

    • Jan Dzik says:

      Hi, sorry for taking so long to answer, but i’ve been stuffed in work these last few days Frown As to your questiong, no, /opt/mono-2.4 is the directory under which all the binaries, libraries, configuration, etc will be installed after you make install the sources. The sources can be extracted anywhere you wish, it does not matter. The /opt/gnome-2.4 directory is provided in case an installation script will need to install gnome specific stuff.

  7. Hi, good post. I have been wondering about this issue,so thanks for posting.

  8. jmdeschamps says:

    Didn’t work… Frown
    some directory errors

    here are the last lines from the compile process of mono

    The which gmcs test didn’t produce anything

    By the way I am a real newbie, and would appreciate some direction to look into this. I’m trying to become less a newbie, and propose other stuff than MS to my colleagues!
    thanks in advance.

    make install-local
    make[6]: Entering directory `/home/jmd/src/mono-2.4/mono-2.4/mcs/errors’
    make[6]: Nothing to be done for `install-local’.
    make[6]: Leaving directory `/home/jmd/src/mono-2.4/mono-2.4/mcs/errors’
    make[5]: Leaving directory `/home/jmd/src/mono-2.4/mono-2.4/mcs/errors’
    make[5]: Entering directory `/home/jmd/src/mono-2.4/mono-2.4/mcs/docs’
    make install-local
    make[6]: Entering directory `/home/jmd/src/mono-2.4/mono-2.4/mcs/docs’
    /bin/sh ./../mkinstalldirs /opt/mono-2.4/lib/monodoc /opt/mono-2.4/lib/monodoc/sources
    mkdir -p — /opt/mono-2.4/lib/monodoc /opt/mono-2.4/lib/monodoc/sources
    /usr/bin/install -c -c -m 644 cs-errors.tree cs-errors.zip ecma334.tree ecma334.zip Mono.tree Mono.zip netdocs.tree netdocs.zip Novell.tree Novell.zip lang-csharp.source Mono.source netdocs.source Novell.source /opt/mono-2.4/lib/monodoc/sources
    /usr/bin/install: cannot stat `cs-errors.tree’: No such file or directory
    /usr/bin/install: cannot stat `cs-errors.zip’: No such file or directory
    /usr/bin/install: cannot stat `ecma334.tree’: No such file or directory
    /usr/bin/install: cannot stat `ecma334.zip’: No such file or directory
    /usr/bin/install: cannot stat `Mono.tree’: No such file or directory
    /usr/bin/install: cannot stat `Mono.zip’: No such file or directory
    /usr/bin/install: cannot stat `netdocs.tree’: No such file or directory
    /usr/bin/install: cannot stat `netdocs.zip’: No such file or directory
    /usr/bin/install: cannot stat `Novell.tree’: No such file or directory
    /usr/bin/install: cannot stat `Novell.zip’: No such file or directory
    make[6]: *** [install-local] Error 1
    make[6]: Leaving directory `/home/jmd/src/mono-2.4/mono-2.4/mcs/docs’
    make[5]: *** [do-install] Error 2
    make[5]: Leaving directory `/home/jmd/src/mono-2.4/mono-2.4/mcs/docs’
    make[4]: *** [install-recursive] Error 1
    make[4]: Leaving directory `/home/jmd/src/mono-2.4/mono-2.4/mcs’
    make[3]: *** [profile-do--net_1_1--install] Error 2
    make[3]: Leaving directory `/home/jmd/src/mono-2.4/mono-2.4/mcs’
    make[2]: *** [profiles-do--install] Error 2
    make[2]: Leaving directory `/home/jmd/src/mono-2.4/mono-2.4/mcs’
    make[1]: *** [install-exec] Error 2
    make[1]: Leaving directory `/home/jmd/src/mono-2.4/mono-2.4/runtime’
    make: *** [install-recursive] Error 1
    [mono-2.4] ~/src/mono-2.4/mono-2.4 @ which gmcs
    [mono-2.4] ~/src/mono-2.4/mono-2.4 @

    • Jan Dzik says:

      Hi! I assume this error occurs when you make install. Are you sure you execute sudo make install and not plain make install. sudo is required because you are installing files to system directories which requires administrator privileges and with sudo you authenticate that you have those.

      On the other hand if you are executing make install with admin privileges and still get an error then it most probably is because something went wrong with the compilation (during make. You can easily check this if the output of make says somewhere Error (like in the example output you posted).

      So, 1). make sure you are executing make install with admin privileges (by using sudo) and 2) make sure that make prior to make install did not produce an error.

      Hope I helped Smile

  9. Lucifer says:

    Hi Jan

    I hope you are well?

    I also have been trying to install Mono 2.4, mod_mono and xsp from the source on Fedora 11

    I am unable to install from rpm due an issue with amd64

    I have run into a number of problems… but I was wondering if you would have any ideas on how to solve my most recent:

    after doing:

    # ./configure –with-moonlight=no –prefix=/usr/local/

    and then

    # make

    Both as root

    I got this error:

    AOT [net_1_1] mscorlib.dll
    /bin/sh: line 1: 25637 Aborted MONO_PATH=./../../class/lib/net_1_1/ /root/mono-2.4/runtime/mono-wrapper –aot=bind-to-runtime-version ../../class/lib/net_1_1/mscorlib.dll > net_1_1_aot.log 2>&1
    make[8]: *** [../../class/lib/net_1_1/mscorlib.dll] Error 134
    make[8]: Leaving directory `/root/mono-2.4/mcs/class/corlib’
    make[7]: *** [do-all] Error 2
    make[7]: Leaving directory `/root/mono-2.4/mcs/class/corlib’
    make[6]: *** [all-recursive] Error 1
    make[6]: Leaving directory `/root/mono-2.4/mcs/class’
    make[5]: *** [all-recursive] Error 1
    make[5]: Leaving directory `/root/mono-2.4/mcs’
    make[4]: *** [profile-do--net_1_1--all] Error 2
    make[4]: Leaving directory `/root/mono-2.4/mcs’
    make[3]: *** [profiles-do--all] Error 2
    make[3]: Leaving directory `/root/mono-2.4/mcs’
    make[2]: *** [all-local] Error 2
    make[2]: Leaving directory `/root/mono-2.4/runtime’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/root/mono-2.4′
    make: *** [all] Error 2

    Please help?

    Lui

    • Jan Dzik says:

      Hi!

      I am not really certain as to what might be causing your problem. However, it seems that make is trying to invoke a mono runtime and it failed. It also seems that the process was being logged to a file net_1_1_aot.log. Try looking for that file and see what it says. I think it should be in the /root/mono-2.4/mcs/class/corlib directory but if not, try using find to see if it really was generated somewhere.

  10. [...] Building Mono 2.4 from source on Ubuntu 8.10 [...]

  11. arnold says:

    Hi

    Thanks for the tut.
    Whilst installing I didn’t have any problems, but when I try to run the needed program I get the following error

    /usr/local/bin/mono-2.4: line 10: exec: yWriter5.exe: not found.

    I am in the directory containing the yWrter5.exe by the way

    Any ideas?

    • Jan Dzik says:

      Hi! Grin The parameters you pass to the mono-2.4 script are passed on to the exec command. This means that the parameters are being looked up by the shell as executables in the directories specified by the PATH environmental variable. If the yWriter5.exe is not in a directory included in PATH then you should execute it with: mono-2.4 ./yWriter5.exe The “./” is the path to the directory that the executable resides in (in case that directory is the current directory). One final note. If that does not work then you should probably try running the executable with the mono runtime like this: mono-2.4 mono ./yWriter5.exe so that the .exe file is passed to the mono VM.

      Hope I helped Smile

  12. Payam Yavari says:

    Thank you for this great guide.
    I managed to install every thing but monodevelop-debugger-mdb-2.0
    When i try to compile it I get this error:

    ./RuntimeInvokeManager.cs(57,68): error CS1501: No overload for method `AbortInvocation’ takes `0′ arguments
    ./RuntimeInvokeManager.cs(78,60): error CS1501: No overload for method `AbortInvocation’ takes `0′ arguments
    Compilation failed: 2 error(s), 2 warnings
    make[1]: *** [../build/DebuggerServer.exe] Error 1

    I am installing exactly the same packages but with the newest version on the pages you have linked to.
    My environment is Ubuntu 8.04 and I have added libwebkit-dev from http://ppa.launchpad.net/webkit-team/ppa/ubuntu
    Do you have any idea of what I am doing wrong?

    • Dan Ward says:

      Payam – You are not doing anything wrong. I get the same results. It is due to a bug that has been reported (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=536902) and is said to be fixed in the upcoming release.

      Jan – You rock! Thanks for helping us noobs out. I really appreciate it.

    • Mike says:

      I’ve encountered the same issue, actually using xubuntu 9.04, everything up to here has worked flawlessly..
      This guide is fantastic btw, so few people take this type of time, and even fewer actively respond to readers.
      Thanks for this.

  13. Simon says:

    I have the same trouble as above…
    Everything compiled well, except monodevelop-debugger-mdb…
    Is there any solution?

  14. boykadyot says:

    have the same trouble as above…
    Everything compiled well, except monodevelop-debugger-mdb…
    Is there any solution?

    plz. I need the debugging.

  15. boykadyot says:

    by the way, i’m using ubuntu 8.10 amd64 desktop

    • Jan Dzik says:

      Hi! First of all, sorry for taking a while to address this issue. I updated my system to mono 2.4.2.2 and can confirm that this is a bug. The debian mono packaging team say seems to have solved the issue http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=536902 and provide updated packages for monodevelop. You could try to install these (unstable) packages instead of doing your own compilation.

      However, for those who do not want to wait for the next stable deb package (including myself), I think i found my way around the bug. The solution involves patching the monodevelop-debugger-mdb-2.0 source code by altering just two lines of code. I’ll explain what to do here manually, until I make a patch and post it here.

      Go to where you have extracted the monodevelop-debugger-mdb-2.0.tar.bz2 source package (e.g. ~/src/mono-2.4.2.2/monodevelop-debugger-mdb-2.0). Go to the directory Mono.Debugging.Server.Mdb and open the file RuntimeInvokeManager.cs. Comment out the lines 56,57 and 77,78. Configure and compile as usual and it should work.

      Now, this is just a quick and dirty solution. It compiles and I have tried debugging a simple console project in monodevelop and it seemed to be working. However, it needs more thorough testing so please give feedback.

      I’ll make a patch for this and post in a new blogpost soon explaining the process as soon as possible.

  16. Simon says:

    Thx Jan, it works. Btw thx for great guide Smile

    Beside i still have error and monodevelop crashes during saving… ehh
    I’ve got something like (sometimes) “resource temporarily unavailable on x server 0.0″ and i saw this error was noticed in earlier versions of MD and seemed to be fixed… but as i see now it’s still alive…

  17. [...] while ago I posted a how-to on compiling Mono 2.4 from source on Ubuntu. After the release of a minor version update for mono, [...]

  18. [...] 2.4 in Ubuntu 9.04 without affecting Ubuntu's default mono installation. Thanks to the instructions here (Building Mono 2.4 from source on Ubuntu 8.10), I was able to install latest mono/monodevelop in a parallel environment. Now I can work on C# 3.5 [...]

  19. Luqash says:

    Really great guide! I compiled monodevelop from SVN and it’s running great.

    Luqash from Slovakia

  20. Tom says:

    I cannot seem to shake this error no matter what I do when compiling gnome-sharp-2.20.1 using your guide:

    error CS2001: Source file `/opt/mono-2.4/lib/gtk-sharp-2.0/’ could not be found

    I compiled and installed gtk-sharp first using the same –prefix flag, all as a normal user (except installing under sudo). The directory /opt/mono-2.4/lib/gtk-sharp-2.0/ does exist. I tried chowning to the user running make, then chmodding 775, then 777, then all of mono-2.4 777, then all of /opt 777 and nothing will allow gnome-sharp to find this dir during make. Any clues?

Leave a Reply