Skip to content

Latest commit

 

History

History
146 lines (96 loc) · 4.89 KB

INSTALL.md

File metadata and controls

146 lines (96 loc) · 4.89 KB

Binary releases

Building F* from sources

On Windows 7/8 using Visual Studio

On Linux or Mac OS X using Mono

  • Install mono 3.10.x or 3.12.x and fsharp 3.1.x

  • Import certificates for Mono

      $ mozroots --import --sync
    
  • Get a Z3 4.3.2 binary and add it to your PATH

    • On Linux (any distribution, not just Ubuntu) get binary from here:

      For instance, for a 64bit architecture you can do

      $ wget "https://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=z3&DownloadId=923684&FileTime=130586905368570000&Build=20959" -O z3-4.3.2.0713535fa6a3-x64-ubuntu-14.04.zip
      $ unzip z3-4.3.2.0713535fa6a3-x64-ubuntu-14.04.zip
      $ export PATH=z3-4.3.2.0713535fa6a3-x64-ubuntu-14.04/bin:$PATH
      
    • On Mac OS X get binary from here:

  • Compile F* from sources

      $ git clone https://github.com/FStarLang/FStar.git
      $ cd FStar
      $ make -C src
    
  • Try out

      $ source setenv.sh
      $ make test.net -C src
    
  • If make test.net (make boot in fact) causes stack overflow try issuing ulimit -s unlimited in the terminal beforehand.

Bootstrapping the compiler in OCaml

Prerequisites on Windows

  1. Use Visual Studio for building fstar.exe as describes above (note: running cygwin/wodi make in src will probably just give you a broken binary).

  2. Use Wodi for installing OCaml (version 4.01.0 or newer)

  3. Wodi also installs it's own version of Cygwin. By installing Wodi you get a special Cygwin terminal where you should run all the commands below.

    Note: If you want to also build F* binaries (instruction in the next section), when Wodi asks which Cygwin packages you want add git to the default list. If you forgot to do this, you can still do that by downloading Cygwin's setup-x86.exe and pointing it at your Wodi install.

  4. Use the Wodi ocaml package manager to install batteries; you can do this either from the visual package manager or by issuing the command godi_add godi-batteries in Wodi's Cygwin terminal.

Prerequisites on Linux and Mac OS X

  1. OCaml (version 4.01.0 or later)

    • Can be installed using either your package manager or using OPAM (see below).
  2. OPAM (version 1.2.x).

  3. Install OCaml Batteries using OPAM:

     $ opam install batteries
    

Bootstrapping the compiler in OCaml

  • Once you satisfy the prerequisites for your platform, generate the OCaml backend by running the following commands in src:

      $ make
      $ make ocaml
    

Creating binary packages for your platform

(no cross-platform compilation supported at the moment)

  1. Make sure you have the Z3 binary in your <fstar-home>/bin folder (this prerequisite could go away at some point)

  2. Bootstrap the compiler in OCaml using the instructions above

  3. Run the following commands in src/ocaml-output:

     $ make parser
     $ make
     $ make package
    
  4. Test that the binary is good by expanding the archive and running make in the examples folder inside