How to Compile


SCF thrives to be a framework that can be used to create micro service components in C++. To that end the framework leans towards development with docker for docker. These instructions were tested docker but should be applicable even without docker as long as dependencies are installed.
  1. Clone the the repo

    git clone https://github.com/dccarter/suil.git
    

    This optional step opens up suil project in a docker container.

    docker run -it --rm --name suil-dev -v `pwd`/suil:/home/suil -w /home/suil suilteam/remote:ubuntu bash
    
  2. Create a build directory and run CMake from the this directory to generate the project build files

    mkdir build
    cd build
    cmake ..-DCMAKE_BUILD_TYPE=Debug
    

    The following options are available for configuring the build

    Build optionExplanation
    CMAKE_BUILD_TYPECan be used to specified the build type (or configuration). This provided by and CMake is well documented at their website
    CMAKE_INSTALL_PREFIXThis optiona can be used to specify the installation directory that will be used when installing the build.
    ENABLE_UNIT_TESTS (ON|OFF)If set to ON, CMake will generate unit test targets (default: ON)
    ENABLE_EXAMPLES (ON|OFF)If set to ON CMake will generate targets for examples included in project (default: ON)
    SUIL_ENABLE_BACKTRACE (ON|OFF)Enable back tracing API. When enabled, message logged with Critical log level will include a backtrace (default: OFF)
    SUIL_ENABLE_TRACE (ON|OFF)Enable trace logging in debug builds. Trace logging is very verbose and only available in debug builds (default: ON)
  3. After successfully building a project, third party dependencies need to be built before attempting to build any other component.

    make deps
    

    This step needs to be run when 3rdParty dependencies have been updated to pull the updates.

  4. Build the project with the following command (if your machine has the power to parallelize make, please do so by appending -jN to the command where N is the desired parallelism)

    make
    

    This command will build suil libraries, scc generator plugins , unit tests and examples (if enabled).

  5. The project binaries can also be installed on the target system by using the make install command. This will install all suil libraries, their associated header files, generate CMake files and scc header files.

    cd suil
    mkdir -p build
    cd build
    cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=`pwd`/artifacts
    ...
    make deps
    ...
    make -j7
    ...
    make install package
    
    • Note that I change the install prefix -DCMAKE_INSTALL_PREFIX=$(pwd)/artifacts to allow make to install artifacts to a directory named artifacts within my current directory.
    • Install is combined with package above. suil supports generating compressed archives of install-ables which can be copied to another directory/system and installed without having to rebuild