Building from Github

Requirements

Python

The full bootstrapping build requires Python 3.2 or better. Python 3.1 won't work due to a critial API change.

Ocaml

You will need Ocaml 3.11 or better native code compiler. Felix currently will not work with the bytecode compiler.

C++ language level

Felix tries to build with clang -std=c++11, and gcc using -std=c++0x. C++11 is mandatory. Gcc 5.1 should work. Clang 3.7 should work. Note, the Apple supplied clang available with OSX 10.10 does NOT work.

Operating System Tools

On Linux and OSX, Felix requires a couple of standard bin utils including things like cp and of course make.

Operating System API

On Unix and OSX based systems Felix requires Posix API. On Windows, the standard C library emulations are usually used for convenience instead of the native Windows APIs. Felix should also build on Cygwin64 (pretending it is Linux).

Asynchronous I/O

Felix does asynchronous socket I/O using one of these event notification services:

Building from Source

The source build is available if you require the latest code and meet more stringent requirements. It is the only way to get a Windows build at this time, you will need to join the mailing list and get help to get the build to work.

Felix builds on Linux, BSD and OSX. It builds on Windows using MSVC++ as well. For Windows specific build instructions see here. For BSD specific build instructions see the "Installing Felix: POSIX (BSD)" section of the INSTALL File located in the top level of the felix source distrobution.

Install location

Felix can be used after the build is complete without installation. Installing simply saves longer command names and the need to set environment variables.

You can put a Felix installation anywhere you like. Just copy the build/release directory.

The Unix install location is:

/usr/local/lib/felix/felix-<version>
where version is the current version. A link should be created:
/usr/local/lib/felix/felix-latest
by the install process. On windows the install location is:
C:\usr\local\lib\felix\felix-<versio>
that is, the same as on Unix.

Initial download

Then issue these commands: For registered developers, using SSH:
git clone git@github.com:felix-lang/felix.git
For everyone else:
git clone https://github.com/felix-lang/felix.git
then
cd felix
Now, depending on you platform you need to set PATH, LD_LIBRARY_PATH, DYLD_LIBRARY_PATH for the second stage boostrap and then run the build. This is done by
. buildscript/osxsetup.sh
make
on OSX,
. buildscript/linuxsetup.sh
make
on Linux and
buildscript\winsetup.bat
nmake
on Windows. By default, Linux build wll use gcc if found, OSX build will use clang if found, and Windows always uses CL.EXE. The default can be change for Linux or OSX by setting the environment variable:
FLX_BUILD_TOOLCHAIN_FAMILY=gcc
or FLX_BUILD_TOOLCHAIN_FAMILY=clang

Now to install Felix:

make install           # sudo password required
Felix should now be installed in
/usr/local/lib/felix/felix-1.1.9dev
the core binary flx in
/usr/local/bin
.

All versions of Felix are installed concurrently. If you're finished using a version you should delete the installation directory. The binary /usr/local/bin/flx is a copy of the host/bin/flx in the last install directory.

Updating Felix

To update felix do this:
cd felix
git pull
make rebuild 
Now you can install as before. If the build doesn't work properly, you can clean up with
rm -rf build
make build
make rebuild
This is even more drastic: git clean -dfx

Normally, Felix can rebuild itself. However if the structure changes enough, the build tools won't be able to rebuild the system. This also happens if you're editing code and create a bug which stops the build tools being built. The makefile recompiles the build tools using flx in order to build the system, rather than use the pre-built build tools, since this is necessary when the build tools themselves are being upgraded. However this can lead to situation where a bug breaks the bootstrap process and the only recovery is to rebuild from scratch.

Alternate rebuild

There's a second way to rebuild Felix that creates the entire new system and tests it in directory build-trial instead of overwriting the system in build as it goes.

make bootstrap