Robert
Robert

Reputation: 6437

How to build the F# compiler from source

After the recent announcement that the F# compiler source was available under the apache license I decided I'd like to have a go at building the compiler from source. However, I fell at the first post as there seems to be a missing file “Microsoft.FSharp-proto.Targets”. Is this the same “Microsoft.FSharp-proto.Targets” that is available in “Microsoft F#, August 2010 Community Technology Preview”? What other steps are necessary to build the compiler. Will the F# team be providing a script that “just works” to build the compiler?

Upvotes: 11

Views: 945

Answers (3)

gradbot
gradbot

Reputation: 13862

I just downloaded and successfully compiled F# so I thought I'd add an update.

  1. I downloaded from http://fsharppowerpack.codeplex.com/SourceControl/list/changesets
  2. I extracted the files and navigated to fsharppowerpack-66272\compiler\2.0\Aug2011
  3. It contains a readme.html that suggests a number of ways to build.
  4. With that readme I made the following script which successfully compiled F# for me.

Install NUnit first if you want to compile the unit tests.

set MSB40=C:\Windows\Microsoft.NET\Framework\v4.0.30319\
set Path=%Path%;%MSB40%
cd src
msbuild fsharp-proto-build.proj /p:TargetFramework=cli\4.0
ngen install ..\Proto\cli\4.0\bin\fsc-proto.exe
msbuild fsharp-library-build.proj /p:TargetFramework=cli\4.0
msbuild fsharp-compiler-build.proj /p:TargetFramework=cli\4.0
msbuild fsharp-library-unittests-build.proj /p:TargetFramework=cli\4.0
msbuild fsharp-compiler-unittests-build.proj /p:TargetFramework=cli\4.0
ngen install ..\Debug\cli\4.0\bin\fsi.exe
pause

Note: I already had VS2010 and the FSharpPowerPack installed.

Upvotes: 2

Tim Robinson
Tim Robinson

Reputation: 54734

I haven't run these yet (PC configuration problems?), but there's a detailed set of instructions in the source distribution at compiler/2.0/Nov2010/README.html.

These instructions are a little different to the ones @desco wrote that relate to the previous CTP.

Upvotes: 6

desco
desco

Reputation: 16782

Not so long ago before this announcement I've written about building compiler from sources supplied with F# CTP (F#: Building compiler from sources.). Hope nothing was changed since that time.

Upvotes: 3

Related Questions