Chorn Sokun's Weblog

Conquer inner fear, push it to the limit!

Build mono on Ubuntu Karmic 9.10 x64

with 8 comments

As always I would start off with CRY ME A RIVER :L, lol I told myself that I will never ever build mono from release source or /trunk again. I am lying myself :( ok here I go again this time I load Ubuntu Karmic x64 on my Toshiba M100 ~2 years old the original purpose is to just load it with multimedia app so that my wife could enjoy watching DVD, play MP3, browse the Inernet and blah blah blah … all just for entertainment :) It turn out !

Ok, here is the main story it turn out that I caught an e-mail from mono mailing list Mono 2.6 for Ubuntu its haunting me. Why don’t I just spend sometime with that instead of wasting time playing JX2 :D yeah let try.

  1. Download Mono 2.6.1 stable source
  2. Read instruction Parallel Mono Environment; ** people keep telling me to reference this instruction although I did follow the exact step, perhaps someone better shot a webcast instead of writing unworkable instruction.

Build Source

First thing first extract the source code from .tar.bz2 since I not a command savvy *yet* I use nautilus context menu to extract the source file; when all source code extracted let get into command line:

// create mono-dev-env using script written in http://www.mono-project.com/Parallel_Mono_Environments
> ./mono-dev-env
// your command prompt now shall look like this where ~src is the location that I stored source code
[mono] ~src @

libgdiplus-2.6

// just in case execute
[mono] ~src @ sudo apt-get build-dep libgdiplus
// ... now you are ready to build libgdiplus-2.6
[mono] ~src @ cd libgdiplus-2.6
[mono] ~src/libgdiplus-2.6 @ ./configure --prefix=/opt/mono
[mono] ~src/libgdiplus-2.6 @ make; sudo make install

mono-2.6.1

[mono] ~src @ cd mono-2.6.1
[mono] ~src/mono-2.6.1  @ ./configure --prefix=/opt/mono
[mono] ~src/mono-2.6.1  @ make; sudo make install

gtk-sharp-2.12.9

Here come the pain :D as gtk-sharp depend on a lot of library we need to make sure those library are installed first before compile gtk-sharp-2.12.9 as of Ubuntu Karmic I need to install the following packages:

> sudo apt-get intall libpango1.0-dev libatk1.0-dev libgtk2.0-dev
// after that I can just do
[mono] ~src/gtk-sharp-2.12.9 @ ./configure  --prefix=/opt/mono
[mono] ~src/gtk-sharp-2.12.9 @ make; sudo make install

gnome-sharp-2.24.1

// dependency library just in case
> sudo apt-get install libgnomecanvas2-dev libgnome2-dev
// resume build task
[mono] ~/src/gnome-sharp-2.24.1 @ ./configure --prefix=/opt/mono
[mono] ~/src/gnome-sharp-2.24.1 @ make; sudo make install

gnome-desktop-sharp-2.24.0

[mono] ~/src/gnome-desktop-sharp-2.24.0 @ ./configure --prefix=/opt/mono
[mono] ~/src/gnome-desktop-sharp-2.24.0 @ make; sudo make install

The rest of the library seem to go just fine, I learn that execute sudo ./configure cause me a lot of troubles thanks @alex for pointing this out.

mono-tools-2.6.1

description on what this library give coming up next …

mono-addins-0.4

description on what this library give coming up next …

mono-debugger-2.6

As I reached to this point ./configure started to complain me like this > configure: error: Cannot find termcap library to solve the problem I need to install

// ref: http://ubuntuforums.org/showpost.php?p=2929293&postcount=3
$ sudo apt-get install libncurses5-dev

Side Note

Petit Eric <surfzoid[at]gmail[dot]com> wrote:

For those who want 2.6.1 deb, there is OBS repository for i586 http://bit.ly/MonoDebOBS, the X86_64 are available here http://surfzoid.free.fr/Mono/ubuntu9.10/ or http://dl.free.fr/c1roVOfLL
in sources directory you will find  libgdiplus sources and all files need to build deb from them (.dsc, …) here http://dl.free.fr/iHFHXaIuj you will find mono2.6 idem

Advertisements

Written by Chorn Sokun

January 15, 2010 at 9:30 pm

Posted in Mono 2.6, OSS, Ubuntu

8 Responses

Subscribe to comments with RSS.

  1. If I couldn’t do it I’ll switch to OpenSuse for 3 weeks; how does that sound :)

    Chorn Sokun

    January 15, 2010 at 9:34 pm

  2. Hey, there’s some issues with you steps:

    1. “sudo make; make install” looks odd. Why not “make; sudo make install”?

    2. Double check you’ve sourced “mono-dev-env” file before ./configure-ing gtk-sharp. You should see “[mono]” before your shell prompt. Check you understand how environment variables work (and w.r.t export statement) if you didn’t use mono-dev-env.

    3. Good luck :)

    Alex

    January 15, 2010 at 10:04 pm

    • Thank @Alex my typing mistakes I fixed that,
      By the way I did get [mono] ~/src/gtk-sharp-2.12.9 @ _

      Chorn Sokun

      January 15, 2010 at 10:23 pm

  3. start from gtk-sharp i got the following summary

    Configuration summary

    * Installation prefix = /opt/mono
    * C# compiler: /usr/bin/mcs

    This mean that mcs not taken from /opt/mono/bin :( should i keep on compile more library? or I need to step back and fix mcs first ?

    Chorn Sokun

    January 15, 2010 at 10:47 pm

    • Fix mcs. Try ‘which mcs’ to see if it gives you the correct one. Also try echo $PATH; echo $PKG_CONFIG_PATH to make sure everything is OK.

      Alex

      January 15, 2010 at 10:55 pm

      • Test setting result as follow:

        [mono] ~/src @ which mcs
        /opt/mono/bin/mcs
        [mono] ~/src @ echo $PATH
        /opt/mono/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
        [mono] ~/src @ echo $PKG_CONFIG_PATH
        /opt/mono/lib/pkgconfig:/usr/lib/pkgconfig

        Now I delete gtk-sharp-2.12.9 and extract it from tarball again then
        [mono] ~/src/gtk-sharp-2.12.9 @ sudo ./configure –prefix=/opt/mono
        or
        [mono] ~/src/gtk-sharp-2.12.9 @ sudo PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig ./configure
        …. i got the same summary as follow
        Configuration summary

        * Installation prefix = /opt/mono
        * C# compiler: /usr/bin/mcs -define:GTK_SHARP_2_6 -define:GTK_SHARP_2_8 -define:GTK_SHARP_2_10 -define:GTK_SHARP_2_12

        How can I fix C# compiler in this case? have I done anything wrong?

        Chorn Sokun

        January 15, 2010 at 11:06 pm

  4. Hm.. your PATH and PKG_CONFIG_PATH looks good.

    > sudo ./configure –prefix=/opt/mono

    You don’t need sudo here. Although it doesn’t affect PATH on my box, it might make difference for you.

    Alex

    January 15, 2010 at 11:23 pm

    • Ah huh ! that really make a different now I delete the source and extract it again then
      > ./configure –prefix=/opt/mono
      and i got the expected summary
      Configuration summary

      * Installation prefix = /opt/mono
      * C# compiler: /opt/mono/bin/mcs -define:GTK_SHARP_2_6 -define:GTK_SHARP_2_8 -define:GTK_SHARP_2_10 -define:GTK_SHARP_2_12

      I am ready to roll more compilation :)

      Chorn Sokun

      January 15, 2010 at 11:37 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: