I can't seem to find a compiler/plugin for mono. Does one exist?
问题:
回答1:
- Go here and download fsharp.zip
- Unzip it and open the created folder
- 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:
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 $@
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
fsi.exe works better in Xterm than in Gnome Terminal.
回答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.
回答3:
Yes, there's one. Check this out: F# for Mono
回答4:
You can download the F# zip file from Microsoft and then run (for example) "mono fsi.exe".
回答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:
- Rember to install WinForm support with Mono. Otherwise you can't start fsi.exe.
- ./install-mono.sh should be run with root privileges (sudo ./install-mono.sh).
- Gnome Terminal dosn't play well with fsi.exe. Start a normal xterm and run fsi.exe whithin that.
回答6:
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
回答7:
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
回答8:
If you are on Ubuntu, follow the following three steps.
- Download and install ".deb" package from here.
Run the following commands.
sudo apt-add-repository ppa:directhex/ppa sudo apt-get update sudo apt-get install monodevelop
Start MonoDevelop. go to add-in manager, Gallery > Language bindings > F#, install.
回答9:
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