Tuesday, January 15, 2013

F# 3.0 on Mono 3.0 on FreeBSD

(continued from phosphorescence: Mono 3.0.x is also ready for FreeBSD)

When we want to use F# on Mono 3.0 on FreeBSD, we should build from source file, not from ports' fsharp.

How

$ git clone https://github.com/fsharp/fsharp.git
$ cd fsharp
$ vi configure.ac
In configure.ac, update around sgen options as acomments. Reasons later.
#if test "x$MONO_SGEN" = "xno"; then
#       mono_gc_options=
#else
#       mono_gc_options=--gc=sgen
#fi
And then,
$ ./autogen.sh --with-gacdir=/usr/local/lib/mono/gac
$ gmake
$ sudo gmake install
Let's launch F# REPL.
$ fsharpi

Why disable sgen option on F#

The reason is the status of LLVM support for Mono on FreeBSD.

mono-sgen - The FreeBSD Forums
  • Mono LLVM option for FreeBSD is not stable.
  • For Mono on POSIX, pthread is the only thread mechanism until LLVM (supporting "__thread") will support mono on FreeBSD stably.
  • On FreeBSD, so that we can use pthread without sgen, and also can use sgen without pthread.

2 comments:

Ruffian Eo said...

It would be helpful to state, where to place the tree obtained from GIT so the build works.
I just got it to my /opt/lib/fsharp location and there, the build does not seem to work. I find fsi.exe and fsc.exe etc. only in fsharp/lib/bootstrap/4.0 but nowhere else.
Also there is no /usr/local/lib/mono/gac after my installation.

Youhei Kondou said...

Check these PRs:
http://www.freebsd.org/cgi/query-pr.cgi?pr=176018
http://www.freebsd.org/cgi/query-pr.cgi?pr=176030

We may wait a few weeks, so we will use fsharp on sgen as out-of-the-box.

Post a Comment