48

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

Kredns
  • 36,461
  • 52
  • 152
  • 203

9 Answers9

34
  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.

Janus Troelsen
  • 20,267
  • 14
  • 135
  • 196
Piotr Zurek
  • 2,800
  • 2
  • 24
  • 32
  • 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... – Nels Beckman Jun 28 '10 at 20:27
  • 3
    @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. – J D Nov 07 '10 at 00:46
  • @Jon: same for me. Any progress? – Muhammad Alkarouri Nov 19 '10 at 23:36
  • @Muhammad: Apparently this was a bug in F# and I *think* it was fixed in their November release http://blogs.msdn.com/b/dsyme/archive/2010/11/10/november-2010-f-2-0-free-tools-update.aspx – J D Nov 22 '10 at 09:17
  • @Jon: I will have another go at it then. Thanks a lot. – Muhammad Alkarouri Nov 23 '10 at 11:48
  • @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. – J D Nov 23 '10 at 17:13
18

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.

gezakovacs
  • 301
  • 2
  • 2
14

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

Jose Basilio
  • 50,714
  • 13
  • 121
  • 117
5

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

sblom
  • 26,911
  • 4
  • 71
  • 95
3

In 2019, a lot of these earlier answers are outdated. No need for zip files or the like.

From Ubuntu 19.04 onwards, i.e. disco you can now install packages with:

sudo apt-get install mono-complete fsharp

That gives you the F-sharp compiler at /usr/bin/fsharpc

Alternatively, if you want the latest, you can add the Mono repository and pull packages from there, as detailed at:

https://www.mono-project.com/download/stable/#download-lin

timbo
  • 13,244
  • 8
  • 51
  • 71
3

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.
huusom
  • 1,909
  • 2
  • 10
  • 4
1

If you are on Ubuntu, follow the following three steps.

  1. Download and install ".deb" package from here.
  2. Run the following commands.

    sudo apt-add-repository ppa:directhex/ppa 
    sudo apt-get update 
    sudo apt-get install monodevelop
    
  3. Start MonoDevelop. go to add-in manager, Gallery > Language bindings > F#, install.

missingfaktor
  • 90,905
  • 62
  • 285
  • 365
1

Look also here for detailled installation instructions including F# PowerPack and MySQL connector: http://2sharp4u.wordpress.com/2010/09/03/installing-f-2-0-on-monolinux

2sharp
  • 11
  • 1
1

Joe Pamer, one of the F# compiler authors, helped me get this working back in July, I wrote up the steps here: http://saladwithsteve.com/2010/07/building-fsharp-on-the-mac.html

stevej
  • 71
  • 2