[Mono-dev] How can I build a minimal mono runtime system?

Robert Jordan robertj at gmx.net
Sun Dec 19 14:03:45 EST 2010


On 18.12.2010 20:12, CodeSlinger wrote:
>
> Sorry for cross posting but I think I should have posted this in the dev
> forum in the first place.
>
> I'm a .NET Windows guy and not a guru on Linux but with Justin Malcom's help
> I have the latest 2.8.1 mono installed on an older RHEL45 dev system and it
> seems to be working quite well and is quite fast. In order for me to be able
> to run on our prod system I would like a minimal runtime only install or
> identify what I can minimally copy from our dev machine. I won't be allowed
> to add all the source and do the large build on prod like I did on dev.

Supposing that you have a mirror of the production system,
you can compile Mono on this system and copy the binaries to
production.

> All I want on dev or prod, is the runtime for command line programs and the
> debugger. No compilers, probably no other tools, no web or gui stuff - I
> only need to be able to run and debug command line pgms and have the typical
> common non-gui non-web class libraries available. Ideally I could pick and
> choose what I wanted to build and/or install.
>
> I was somewhat amazed at how much stuff was installed. Ideally it would have
> been isolated into a /mono/bin directory instead of adding to /usr/bin.
> Perhaps the configure program's --prefix option would do that?

Well, 'configure' did what it was told to do. Change the prefix
to something like '--prefix /opt/mono' if you want to keep these
bits together.

> I did reduce requirements somewhat by running configure with the
> "--with-libgdiplus=no" option as below to eliminate install failing since I
> did not have the gdi prereq, but I am hoping for some suggestions on how to
> really pare it down.

You don't need --with-libgdiplus=no. "no" isn't a valid value anyway.

Libgdiplus is a separate project that must be installed on its own.
If you omit it, System.Drawing (and other assemblies that depend on it)
won't work, but if you don't reference them, then you should be fine.

While Mono does not provide an out-of-the-box machinery for trimming
unneeded assemblies, it's pretty straightforward to lose some weight:

Configure & install into /opt/mono and remove the
assemblies you don't need from /opt/mono/lib/mono/x.x/ and from
/opt/mono/lib/mono/gac/.

Robert



More information about the Mono-devel-list mailing list