Compiling Nemerle SVN on Mono SVN
Compiling Nemerle from a Subversion repository is an easy task. You need Mono 1.1.9, but we will also talk about getting it from SVN. This is not intented as the ultimate guide for builders, but as a quick guide for people who, like me, come from a Windows environment and aren't used to using tools such as patch or svn.
You should create a directory to work. In my case, I used /root/mono-svn.
Well, let's start. Open a terminal and change to the folder using cd. First of all we need to check-out Mono and MCS sources, so let's use the svn command.
svn co svn://svn.myrealbox.com/source/trunk/monoThen we have to go to the mono folder that svn created. You know, cd mono. Finish getting mono sources by using:
svn co svn://svn.myrealbox.com/source/trunk/mcsGetting mcs sources will take much longer than mono ones, because it includes the entire Base Class Library sources plus Mono additions to it. The final directory structure on the folder should be:
mono/
libgc/
mono/
data/
docs/
...
mcs/
class/
bmcs/
mcs/
gmcs/
(UPDATE: Patching Mono is not longer neccessary as the pacthes have been finally accepted. You can skip this section.) Until Nemerle creators patches to Mono are accepted, we have to use them by hand. Get mono-all.patch from http://nemerle.org/~malekith/temp/mono-all.patch and copy it in the top level mono directory (be careful, because there exists another mono/mono/ folder, as you can see). Do the same with http://nemerle.org/mailman/pipermail/devel-en/attachments/20050905/e147cce6/monop.obj, saving it as monop.patch. Now apply the patches: go to the top level mono, and run these commands:
patch -p0 < mono-all.patchIn a not very long time these patches won't be neccessary. Even at the moment of this writing, some patches have been approved, so patch asks you this:
patch -p0 < monop.patch
Reversed (or previously applied) patch detected! Assume -R? [n] nAnswer both "n", as you don't want to reverse or either apply the patch in a newer version.
Apply anyway? [n] n
It shouldn't ask you about a location. If it does, check you've copied the file in the correct folder.
(UPDATE: Continue from here if you have skipped patching section)
Now it's time to compile mono. First of all use ./autogen.sh. This small script ensures you've all the dependencies needed to build Mono. By default, Mono builds to the system library folder, but if you are running it from SVN, you will sure want to build it in a directory apart from your normal applications, so you need to provide a "prefix". In my case, I'll use /devel/mono, so my autogen command will look like this:
./autogen.sh --prefix=/devel/monoIf autogen tells some dependency or file is needed try using yum, apt-get or whatever package manager ships with your distro. The real compilation will start when you type
makeand press Enter.
If make complains about a not usable mcs installation, try using make get-monolite-latest and then running make again.
Finally, if everything it's OK (it doesn't end with any error), install Mono in the desired "prefix" running the command.
make installNote: there's also a make check command that will check good compilation, but it not neccessary to run it, furthermore if you're in a hurry. Indeed, in SVN versions it fails most of times.
Now let's compile Nemerle. First of all, get the sources. I suggest using a different folder for this svn, so everything doesn't come mixed up. In my case, I'll use /root/nemerle-svn. So I change to its parent folder using cd, and then check out the sources (the last parameter, nemerle-svn, is the folder where I want the sources to be saved):
svn co http://nemerle.org/svn/nemerle/trunk nemerle-svnSubversion will tell you the revision you have got. Then go to the newly created folder and run ./configure. You can pass some other arguments to this scripts
- --mono-from=path: if you compiled Mono with a prefix, use it here. But be aware you must tell the bin directory, not the base one.
- --prefix=path: as on Mono, if you don't want the compiler to live in the standar library directory, specify where you want to install it here.
./configure --mono-from=/devel/mono/bin --prefix=/devel/nemerleThen compile and install the sources using:
makeNemerle compilation has 4 stages. The first three build the compiler and the main libraries that contains macros and special Nemerle types, such as lists. In the last stage, some additional tools as nemerlish (Nemerle Interactive Shell).
make check (optional, as in Mono)
make install
Note: of course, you can also leave out prefixes, so use of Mono and Nemerle will be easier. If you don't care so much about your data and apps (and both Mono and Nemerle should not make anything to them). But use it at your own risk (the only thing I can say is that I use them this way and I have no problems).


1 Comments:
This post has been removed by a blog administrator.
Post a Comment
<< Home