How to get F# working with Mono?

22,276

Solution 1

  1. Go here and download fsharp.zip
  2. Unzip it and open the created folder
  3. Open the terminal and run ./install-mono.sh as root (On some systems, it is necessary to convert the newline characters in that script from CRLF to LF)

This will give you the basic functionality which means you will be able to run "mono fsi.exe" and compiled F# apps as "mono myApp.exe".

Usefull tips:

  1. It makes sense to create scripts for the compiler and F# interactive. i.e.:

    /usr/local/bin/fsc

    #!/bin/sh exec /usr/bin/mono /usr/local/src/FSharp-1.9.9.9/bin/fsc.exe $@

    /usr/local/bin/fsi

    #!/bin/sh exec /usr/bin/mono /usr/local/src/FSharp-1.9.9.9/bin/fsi.exe $@

  2. F# interactive (fsi.exe) is trying to reference System.Windows.Forms by default so in order to run it WinForms support in Mono will be required

  3. fsi.exe works better in Xterm than in Gnome Terminal.

Solution 2

For reference, there are now Linux (.deb and .rpm) packages and a Mac OS X installer available at http://fsxplat.codeplex.com/ which will save you the work of having to manually copy around files and make your own launcher scripts.

Solution 3

Yes, there's one. Check this out: F# for Mono

Solution 4

You can download the F# zip file from Microsoft and then run (for example) "mono fsi.exe".

Solution 5

What Piotr Zurek said is basically what i did to get F# and mono to work on Ubuntu 9.04, with the following comments:

  1. Rember to install WinForm support with Mono. Otherwise you can't start fsi.exe.
  2. ./install-mono.sh should be run with root privileges (sudo ./install-mono.sh).
  3. Gnome Terminal dosn't play well with fsi.exe. Start a normal xterm and run fsi.exe whithin that.
Share:
22,276

Related videos on Youtube

vishwas kumar
Author by

vishwas kumar

Bad programming is easy. Idiots can learn it in 21 days, even if they are dummies. --Teach Yourself Programming In Ten Years

Updated on November 01, 2020

Comments

  • vishwas kumar
    vishwas kumar over 3 years

    I can't seem to find a compiler/plugin for mono. Does one exist?

  • Nels Beckman
    Nels Beckman almost 14 years
    Any particular version of Mono needed? I have 2.0, which I assume is pretty old, and F# complains that some DLLs are missing, in particular System.Windows.Forms...
  • epotter
    epotter over 13 years
    It looks like this link is dead.
  • Matti
    Matti over 13 years
    Updated the link to point to the latest download. Thanks for the heads-up, @epotter.
  • Totti
    Totti over 13 years
    @Nels: I've tried with pretty much every FSI and Mono ever released and can rarely get them to work. Right now, F# 2.0 and Mono 2.8 just appear to hang after I enter anything.
  • Muhammad Alkarouri
    Muhammad Alkarouri over 13 years
    @Jon: same for me. Any progress?
  • Totti
    Totti over 13 years
    @Muhammad: Apparently this was a bug in F# and I think it was fixed in their November release blogs.msdn.com/b/dsyme/archive/2010/11/10/…
  • Muhammad Alkarouri
    Muhammad Alkarouri over 13 years
    @Jon: I will have another go at it then. Thanks a lot.
  • Totti
    Totti over 13 years
    @Muhammad: No, I just tried the latest Nov 2010 release of F# and it is still broken in exactly the same way. I have no idea why.
  • AxA
    AxA over 11 years
    could not succeed installing the addin on mono develop 2.8