You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
<b>Questions?</b> If you have questions about the source code, please ask in the issues and discussion forums.
333
-
334
-
<h3>Compilation Instructions</h3>
335
-
336
-
<p>When you build the compiler using the standard instructions below, you get<code>fsc.exe</code>,<code>fsi.exe</code>,<code>FSharp.Core.dll</code>,<code>FSharp.Compiler.dll</code> and some related DLLs.</p>
337
-
338
-
<p>
339
-
The compiler binaries produced are "private" and
340
-
strong-named signed with a test key (src\fsharp\test.snk). They use CLI assembly version nunmber 2.9.9.999. You can place these components in the GAC but they will not replace
341
-
the components used by Visual Studio or other normal F# programs.
342
324
</p>
343
325
326
+
<h3>Compilation Instructions</h3>
344
327
345
-
<h3>Notes on the build</h3>
346
328
347
329
<p>
348
-
The prerequisites and build command line for compiling the source (on Windows) are shown
349
-
later in this README. Here's the logic of the build:
350
-
</p>
351
-
<ul>
352
-
<li>We first need an existing F# compiler, using the one in the 'lkg' directory. Let's assume this compiler has an FSharp.Core.dll with version X.</li>
353
-
<li>
354
-
We use this compiler to compile the source in this distribution, to produce a "proto" compiler, in the Proto
355
-
directory. When run, this compiler still relies on the FSharp.Core.dll with version X.
356
-
</li>
357
-
<li>
358
-
We use the proto compiler to compile the source for FSharp.Core.dll in this distribution, producing
359
-
an FSharp.Core.dll with the version identified in src\source-build-version, usually 1.9.999.
360
-
</li>
361
-
<li>
362
-
We use the proto compiler to compile the source for FSharp.Compiler.dll, fsc.exe, fsi.exe and other
363
-
binaries found in this distribution. When run, these binaries will rely on the FSharp.Core.dll with version
364
-
1.9.999. This is good, since it means the 1.9.999 binaries now form a consistent, bootstrapped compiler. If
365
-
you like you should now be able to throw away the compiler with version X.
366
-
</li>
367
-
</ul>
368
-
<p>
369
-
Some additional tools are required to build the compiler, notably fslex.exe, fsyacc.exe,
370
-
FSharp.PowerPack.Build.Tasks.dll, FsSrGen.exe, FSharp.SRGen.Build.Tasks.dll and the other
371
-
tools found in the lkg directory. These are "Last Known Good" binaries created from a version of the F# Power Pack
372
-
on CodePlex. If you like you can throw away these binaries and use your own compiled versions of these tools.
330
+
The compiler is compiled as a set of .NET 4.0 components using a bootstrap process.
331
+
When you build the compiler using the standard instructions below, you get<code>fsc.exe</code>,<code>fsi.exe</code>,<code>FSharp.Core.dll</code>,<code>FSharp.Compiler.dll</code> and some related DLLs.
373
332
</p>
374
333
375
-
<h3>1. Building a Proto Compiler and the F# core library for .net 4.0, .net 2.0, and .net portable profile 47</h3>
334
+
335
+
<h3>1. Building a Proto Compiler</h3>
376
336
377
337
<p>This uses the lkg compiler to build. Note that you need the .NET framework 3.5 installed on your machine in order to complete this step.</p>
</pre><p>[Optional] Use the provided script to update the GAC, add required strong name validation skips, and NGen. Requires admin privileges.<pre>
393
365
update.cmd debug -ngen
394
366
</pre>
395
367
396
-
<h3>3. Verify the F# compiler build with simple smoke test</h3>
368
+
<p>There are language tests under the<code>tests</code> directory. The test apparatus uses batch files, assuming<ahref="http://www.perl.org/get.html">Perl</a> (ActiveState Perl 5.16.3 is known to work fine) is installed. You can run these on Windows using:</p>
369
+
<pre>
370
+
cd ..\tests
371
+
BuildTestTools.cmd debug
372
+
Runtests.cmd debug fsharp
373
+
Runtests.cmd debug fsharpqa
374
+
Runtests.cmd debug coreunit
375
+
</pre>
376
+
<p>
377
+
For more details on how to run, debug, and write tests, see<ahref="tests\TESTGUIDE.html">tests\TESTGUIDE.html</a>.
378
+
</p>
379
+
397
380
398
-
<li>Simple FSI run and quit test.</li>
399
-
<pre>
381
+
<p>You can also use the F# compiler and F# interactive as follows:</p>
382
+
383
+
<pre>
384
+
..\Debug\net40\bin\fsc.exe /help
385
+
..\Debug\net40\bin\fsi.exe /help
400
386
..\Debug\net40\bin\fsi.exe
401
387
1 + 1;;
402
388
#q;;
403
-
</pre><li>Verify tool command lines</li><pre>
404
-
..\Debug\net40\bin\fsi.exe /help
405
-
..\Debug\net40\bin\fsc.exe /help
406
-
407
389
</pre>
408
-
<li>Compile hello world.</li><pre>
390
+
<p>Compile hello world.</p>
391
+
<pre>
409
392
echo printfn "hello world"> hello.fs
410
393
..\Debug\net40\bin\fsc.exe hello.fs
411
394
copy ..\Debug\net40\bin\FSharp.Core.dll .
@@ -414,64 +397,56 @@ <h3>3. Verify the F# compiler build with simple smoke test</h3>
414
397
del /q FSharp.Core.dll
415
398
</pre>
416
399
417
-
<h3>4. Building FSharp.Data.TypeProviders for .NET 4.0</h3>
418
-
419
-
<p>This uses the proto compiler to build the type provider assembly FSharp.Data.TypeProviders.dll for .NET 4.0.</p>
<h3>5. Building F# Core Unit Tests for .NET 4.0</h3>
425
-
426
-
<p>This uses the proto compiler to build the unit tests that check some parts of FSharp.Core.dll and FSharp.Compiler.dll. You must have<ahref="http://nunit.org/?p=download">NUnit</a> (2.6.3 is known to work fine) installed.</p>
<p>Below are the very basic commands you can use to execute the included unit tests and general compiler/runtime tests.
432
-
For more details on how to run, debug, and write tests, see<ahref="tests\TESTGUIDE.html">tests\TESTGUIDE.html</a>.</p>
433
-
434
-
<p>There are language tests under the<code>tests</code> directory. The test apparatus uses batch files, assuming<ahref="http://www.perl.org/get.html">Perl</a> (ActiveState Perl 5.16.3 is known to work fine) is installed. You can run these on Windows using:</p>
435
-
<pre>
436
-
cd ..\tests
437
-
BuildTestTools.cmd debug
438
-
Runtests.cmd debug fsharp
439
-
Runtests.cmd debug fsharpqa
440
-
Runtests.cmd debug coreunit</pre>
441
-
442
-
<h3>6. [Alternate Build Instructions] Build an optimised F# (Release) compiler for .NET 4.0 profile</h3>
400
+
<h3>4. [Optional] Building and testing the "release" compiler</h3>
443
401
444
402
<p>This uses the proto compiler to build the FSharp.Compiler.dll and fsc.exe to run on for Mono/.NET 4.0.</p>
</pre><p>[Optional] Use the provided script to update the GAC, add required strong name validation skips, and NGen. Requires admin privileges.<pre>
448
-
update.cmd release -ngen
449
405
</pre>
450
406
451
-
<h3>7. Verify the optimised F# compiler buildwithsimple smoke test</h3>
407
+
<h3>5. [Optional] Open a solutionwithVisual Studio</h3>
452
408
453
-
<li>Simple FSI run and quit test.</li>
454
-
<pre> ..\Release\net40\bin\fsi.exe
455
-
1 + 1;;
456
-
#q;;
457
-
</pre><li>Verify tool command lines</li><pre>
458
-
..\Release\net40\bin\fsi.exe /help
459
-
..\Release\net40\bin\fsc.exe /help
460
-
461
-
</pre>
462
-
<li>Compile hello world.</li>
463
-
<pre>
464
-
echo printfn "hello world"> hello.fs
465
-
..\Release\net40\bin\fsc.exe hello.fs
466
-
copy ..\Release\net40\bin\FSharp.Core.dll .
467
-
hello.exe
468
-
del /q hello.fs
469
-
del /q FSharp.Core.dll
470
-
</pre>
409
+
<p>
410
+
You can use "fsharp.sln" to browse source code using Visual Studio.
411
+
However, you need to complete step 1) and 2) in order to properly
412
+
open this solution. In addition, FSharp.Core.Unittests project requires NUnit installed.
413
+
</p>
414
+
415
+
<h3>Notes on the build</h3>
471
416
472
-
<h3>8. [Optional] Open a solution with Visual Studio</h3>
417
+
<p>
418
+
The compiler binaries produced are "private" and
419
+
strong-named signed with a test key (src\fsharp\test.snk). They use CLI assembly version nunmber 2.9.9.999. You can place these components in the GAC but they will not replace
420
+
the components used by Visual Studio or other normal F# programs.
421
+
</p>
422
+
423
+
<p>
424
+
The prerequisites and build command line for compiling the source (on Windows) are shown
425
+
later in this README. Here's the logic of the build:
426
+
</p>
427
+
<ul>
428
+
<li>We first need an existing F# compiler, using the one in the 'lkg' directory. Let's assume this compiler has an FSharp.Core.dll with version X.</li>
429
+
<li>
430
+
We use this compiler to compile the source in this distribution, to produce a "proto" compiler, in the Proto
431
+
directory. When run, this compiler still relies on the FSharp.Core.dll with version X.
432
+
</li>
433
+
<li>
434
+
We use the proto compiler to compile the source for FSharp.Core.dll in this distribution, producing
435
+
an FSharp.Core.dll with the version identified in src\source-build-version, usually 1.9.999.
436
+
</li>
437
+
<li>
438
+
We use the proto compiler to compile the source for FSharp.Compiler.dll, fsc.exe, fsi.exe and other
439
+
binaries found in this distribution. When run, these binaries will rely on the FSharp.Core.dll with version
440
+
1.9.999. This is good, since it means the 1.9.999 binaries now form a consistent, bootstrapped compiler. If
441
+
you like you should now be able to throw away the compiler with version X.
442
+
</li>
443
+
</ul>
444
+
<p>
445
+
Some additional tools are required to build the compiler, notably fslex.exe, fsyacc.exe,
446
+
FSharp.PowerPack.Build.Tasks.dll, FsSrGen.exe, FSharp.SRGen.Build.Tasks.dll and the other
447
+
tools found in the lkg directory. These are "Last Known Good" binaries created from a version of the F# Power Pack
448
+
on CodePlex. If you like you can throw away these binaries and use your own compiled versions of these tools.
449
+
</p>
473
450
474
-
<p> You can use "fsharp.sln" to browse source code using Visual Studio. However, you need to complete step 1) and 2) in order to properly open this solution. In addition, FSharp.Core.Unittests project requires NUnit installed.</p>