Thursday, October 10, 2013

How to install Monodevelop 4 with F# support in Fedora

After spending quite some time to build mono & monodevelop from sources and enable F# support, I was able to do so more easily with the following steps:

1.Install Mono and Monodevelop from:

2. Setup an alternate mono environment by creating a bash script named something like ~/mono-dev-env. 
Its contents should be similar to the following:

#!/bin/bash
MONO_PREFIX=/opt/mono
GNOME_PREFIX=/opt/gnome
export DYLD_FALLBACK_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_FALLBACK_PATH
export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$MONO_PREFIX/include:$GNOME_PREFIX/include
export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig:$GNOME_PREFIX/lib/pkgconfig
export PATH=$MONO_PREFIX/bin:$PATH
PS1="[mono] \w @ "

Along with setting appropriate environment variables to only use sources from /opt/mono and /opt/gnome, it also sets the Bash prompt to something other than the default, so it is easy to detect when Bash is in this alternate environment.
Finally, to enter this environment at any time, run the following from a Bash prompt:
source ~/mono-dev-env

3. Install F# from sources:
su
yum install autoconf libtool pkg-config make git
git clone https://github.com/fsharp/fsharp
cd fsharp
./autogen.sh --prefix=/opt/mono/
make
make install

4. Install F# Monodevelop addin:
- open Monodevelop
- go to Tools -> Addin Manager -> Gallery -> Language Bindings
- install F# language binding

5. Test that all works: 

No comments: