Installing Mono on a 64-bit AMD Opteron Cluster running CentOS 5 Linux
Mono is used to develop an Ecma standard compliant, .NET-compatible set of tools, including a C# compiler and a Common Language Runtime.
To install change to the appropriate directory. Download from Novell. Extract in the sensible place. Change to the extracted directory, check then run the sample config and run make, make install and make check. After this create a module for the environment variables and logout.
cd /usr/local/src/MONO/
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.8.tar.bz2
tar xvf mono-2.8.tar.bz2
../config
make
make install
make check
cd /usr/local/Modules/modulefiles/mono
ln -s .base .base 2.8
exit
The .config file simply parses some sed to generate a configure path
#!/bin/bash ./configure --prefix=/usr/local/$(basename $(pwd) | sed 's%-%/%')
The .base file represents a standard set of variable i.e.,
#%Module1.0##################################################################### ## ## $name modulefile ## set ver [lrange [split [ module-info name ] / ] 1 1 ] set name [lrange [split [ module-info name ] / ] 0 0 ] set loading [module-info mode load] proc ModulesHelp { } { puts stderr "\tThis module sets the envinronment for $name v$ver" } module-whatis "Set environment variables to use $name version $ver" #prepend-path --delim " " CPPFLAGS -I/usr/local/$name/$ver/include #prepend-path --delim " " LDFLAGS -L/usr/local/$name/$ver/lib prepend-path LD_LIBRARY_PATH /usr/local/$name/$ver/lib prepend-path MANPATH /usr/local/$name/$ver/share/man prepend-path PATH /usr/local/$name/$ver/bin
Now login to the HPC system as a normal user, load the environment variables module, write a brief `hello world` program in C#, compile it and run it. i.e.,
nano HelloWorld.cs
Enter the following:
using System; public class HelloWorld { static public void Main() { Console.WriteLine("Hello World"); } }
Write out and quit. Now compile the program and run the executable.
mcs HelloWorld.cs
mono HelloWorld.exe
This should result with Hello World
.