Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Building

kaiwren edited this page Sep 13, 2010 · 45 revisions
Visual Studio
Command line
Rake
Mono
Tips

Visual Studio

  1. Start Visual Studio 2008 Professional or Expresss.
  2. Open the c:\path\to\Merlin\Main\Languages\Ruby\Ruby.sln solution file
  3. You will get two dialog boxes complaining about source control like VsSourceControlMessage1.png and VsSourceControlMessage2.png at http://www.ironruby.net/Support/Images. Press OK to both.
  4. Press “F6” to build the solution.

Note for VS Express users: you may see warnings about mscorlib or System not being found when using VS Express; just ignore those as it doesn’t seem to handle conditional references for Silverlight. However, this means that Silverlight builds won’t work from the IDE. If you absolutely need to build from the IDE, run this script to transform the csproj files to work in VS Express. Otherwise, see the section below about building from the command line.

Command line

If you have run dev.bat:

brbd
This is an alias for msbuild c:\path\to\Merlin\Main\Languages\Ruby\Ruby.sln /p:Configuration=Debug. See Alias.txt for the full list of aliases.

Silverlight

You must have Silverlight installed to build for it. If not, you can install it from here. Note: this is the developer version of Silverlight, which has more descriptive error messages.

To build for Silverlight:

bsd
This is an alias for msbuild c:\path\to\Merlin\Main\Hosts\Silverlight\Silverlight.sln /p:Configuration="Silverlight Debug" /p:SilverlightPath="C:\Program Files\Microsoft Silverlight\3.0.40624.0".

If you see a strange build error, then you probably have a newer/older version of Silverlight than the sources expect. To correc this, supply your machine’s path to Silverlight:

bsd /p:SilverlightPath=“C:\Program Files\Microsoft Silverlight\3.0.40723.0”
And feel free to submit a patch to Alias.txt so this can get fixed.

Command line (via rake)

  1. Install the latest Ruby with gems enabled (such as the Ruby One-Click Installer v1.8.6-25 or below)
  2. Install required gem. Open a command-prompt and type:
    gem install pathname2 rake
  3. Run dev.bat to get a nicely configured Command prompt.
  4. To view a list of all available rake targets, run the following command from anywhere under the Merlin directory of the source code:
    rake —tasks
  5. Run the following command
    rake compile

Mono

Instructions for building on Mono:

Building the Mono runtime

Often you can use the latest Mono release just fine.

Previously, you had to build Mono from SVN. Instruction is still provided below in case it is needed again.

svn co svn://anonsvn.mono-project.com/source/trunk/mono 
svn co svn://anonsvn.mono-project.com/source/trunk/mcs 
cd mono
./configure
make
make install

If you built Mono from source, make sure pkg-config can find the built Mono. For example:

export PKG_CONFIG_PATH=“/opt/mono/lib/pkgconfig”

Build IronRuby

The branch at http://github.com/casualjim/ironruby is likely to work better with Mono as it has continuous integration for Mono.

git clone git://github.com/casualjim/ironruby.git
cd ironruby
git checkout -b linux --track origin/linux

Check the status of the continuous integration to see if there are any known build issues. The steps for the build are:

rake compile MERLIN_ROOT=/path/to/ironruby/Merlin/Main MONO_LIB=/Library/Frameworks/Mono.framework/Versions/2.4/lib/ configuration=release

Alternatively you can use the build command that is included in that linux branch. That command will compile IronRuby and deploy it to ~/bin. If you then add ~/bin to your PATH environment variable you can run ironruby files by invoking the command ir my_file.rb. Also the iirb, igem, … commands are deployed to the ~/bin.

cd ironruby
chmod +x build
./build

And then you can run it with Mono

build/mono_debug/ir

Tips

  • Make sure .NET is installed on your machine; Windows Vista and Windows 7 have .NET 3.0 and .NET 3.5 preinstalled, respectively. The minimum required version is 2.0 (2.0.50727.42).
  • Make sure that csc.exe is in your PATH environment variable. Default location is:
     c:\Windows\Microsoft.NET\Framework\v2.0.50727 
  • Make sure that resgen.exe is in your PATH environment variable. Default location is:
     c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin