Compiling and Installing Fossil
Not logged in

0.0 Using A Pre-compiled Binary

Released versions of fossil come with pre-compiled binaries and a source archive for that release. You can thus skip the following if you want to run or build a release version of fossil. Just download the appropriate package from the downloads page and put it on your $PATH. To uninstall, simply delete the binary. To upgrade from an older release, just overwrite the older binary with the newer one.

0.1 Executive Summary

Building and installing is very simple. Three steps:

  1. Download and unpack a source tarball or ZIP.
  2. ./configure; make
  3. Move the resulting "fossil" or "fossil.exe" executable to someplace on your $PATH.


1.0 Obtaining The Source Code

Fossil is self-hosting, so you can obtain a ZIP archive or tarball containing a snapshot of the latest version directly from Fossil's own fossil repository. Additionally, source archives of released versions of fossil are available from the downloads page. To obtain a development version of fossil, follow these steps:

  1. Point your web browser at http://www.fossil-scm.org/.

  2. Click on the Timeline link at the top of the page.

  3. Select a version of of Fossil you want to download. The latest version on the trunk branch is usually a good choice. Click on its link.

  4. Finally, click on one of the "Zip Archive" or "Tarball" links, according to your preference. These link will build a ZIP archive or a gzip-compressed tarball of the complete source code and download it to your browser.

Aside: Is it really safe to use an unreleased development version of the Fossil source code?

Yes! Any check-in on the trunk branch of the Fossil Fossil self-hosting repository will work fine. (Dodgy code is always on a branch.) In the unlikely event that you pick a version with a serious bug, it still won't clobber your files. Fossil uses several self-checks prior to committing any repository change that prevent loss-of-work due to bugs.

The Fossil self-hosting repositories, especially the one at http://www.fossil-scm.org/fossil, usually run a version of trunk that is less than a week or two old. Look at the bottom right-hand corner of this screen (to the right of "This page was generated in...") to see exactly which version of Fossil is rendering this page. It is always safe to use whatever version of the Fossil code you find running on the main Fossil website.

2.0 Compiling

  1. Unpack the ZIP or tarball you downloaded then cd into the directory created.

  2. (Optional, unix only) Run ./configure to construct a makefile.

    1. If you do not have the OpenSSL library installed on your system, then add --with-openssl=none to omit the https functionality.

    2. To build a statically linked binary (suitable for use inside a chroot jail) add the --static option.

    3. Other configuration options can be seen by running ./configure --help

  3. Run "make" to build the "fossil" or "fossil.exe" executable. The details depend on your platform and compiler.

    1. Unix → the configure-generated Makefile should work on all unix and unix-like systems. Simply type "make".

    2. Unix without running "configure" → if you prefer to avoid running configure, you can also use: make -f Makefile.classic. You may want to make minor edits to Makefile.classic to configure the build for your system.

    3. MinGW/MinGW-w64 → Use the mingw makefile: "make -f win/Makefile.mingw". On a Windows box you will need either Cygwin or Msys as build environment. On Cygwin, Linux or Darwin you may want to make minor edits to win/Makefile.mingw to configure the cross-compile environment.

    4. MSVC → Use the MSVC makefile. First change to the "win/" subdirectory ("cd win") then run "nmake /f Makefile.msc".

      Alternatively, the batch file "win\buildmsvc.bat" may be used and it will attempt to detect and use the latest installed version of MSVC.

      To enable the optional OpenSSL support, first download the official source code for OpenSSL and extract it to an appropriately named "openssl-X.Y.ZA" subdirectory within the local compat directory (e.g. "compat/openssl-1.0.1i"), then make sure that some recent Perl binaries are installed locally, and finally run one of the following commands:

      nmake /f Makefile.msc FOSSIL_ENABLE_SSL=1 PERLDIR=C:\full\path\to\Perl\bin
      
      buildmsvc.bat FOSSIL_ENABLE_SSL=1 PERLDIR=C:\full\path\to\Perl\bin
      

    5. Cygwin → The same as other unix-like systems. It is recommended to configure using: "configure --disable-internal-sqlite", making sure you have the "libsqlite3-devel" , "zlib-devel" and "openssl-devel" packages installed first.

3.0 Installing

  1. The finished binary is named "fossil" (or "fossil.exe" on windows). Put this binary in a directory that is somewhere on your PATH environment variable. It does not matter where.

  2. (Optional:) To uninstall, just delete the binary.

4.0 Additional Considerations