Build FIO from Source

Download FIO Source

To download the FIO source code, clone the fio repo and its submodules. It is advised to create a home fio folder first and download all the FIO related software there:

mkdir -p ~/fioprotocol && cd ~/fioprotocol
git clone --recursive

Update Submodules

If a repository is cloned without the --recursive flag, the submodules must be updated before starting the build process:

cd ~/fioprotocol/fio
git submodule update --init --recursive

Pull Changes

When pulling changes, especially after switching branches, the submodules must also be updated. This can be achieved with the git submodule command as above, or using git pull directly:

[git checkout <branch>]  (optional)
git pull --recurse-submodules

Build FIO Binaries

The build script first installs all dependencies and then builds FIO. The script has several options, including ‘-P’ (pinned build), ‘-i’ (install directory), and ‘-o’ (build type, i.e. Release, Debug, etc.). Providing no options will use default options, i.e. a local build directory, $HOME/fio, as the install directory.

To build, first change to the ~/fioprotocol/fio folder, then execute the script as follows:

cd ~/fioprotocol/fio/scripts
./ -P

The build process writes temporary content to the fio/build folder. After building, the program binaries can be found at fio/build/programs.

To confirm your clang version, go to the build directory or if inspecting an installed binary, the install directory (e.g., ~/fio, /usr/local/bin/nodeos, etc.). To locate a running instance of fio:

ps -ef | grep nodeos

Next, insert your nodeos dir in the following command:

strings /usr/local/bin/nodeos | grep -i clang | head -10

Install FIO Binaries

For ease of contract development, FIO will be installed in the ~/fio folder using the script within the fio/scripts folder. Adequate permission is required to install in system folders, e.g., /usr/local/bin/nodeos.

cd ~/fioprotocol/fio/scripts