<commit_before>
Supported boards
-----------------

MicroFlo for Embedded Linux is *work-in-progress*.
A basic [I/O backend](../microflo/linux.hpp) with support for sysfs-based GPIO exists.

It has been tested on:

* Raspberry Pi
* Desktop Linux like Arch, Ubuntu
* add-your-board-here

Prerequisites
-----------------

1. Download and install [Node.JS](http://nodejs.org)
2. Download and install a C++ toolchain for your Embedded Linux device


Building MicroFlo
------------------
It is assumed that you have common build tools such as 'make', 'git'

1. Install MicroFlo

    ```
    npm install microflo
    export PATH=`pwd`/node_modules/.bin/
    ```

2. Download example code

    ```
    wget https://github.com/microflo/microflo/raw/master/examples/embedding.cpp
    ```

3. Build

    ```
    microflo generate embedding.cpp build/ --target linux
    g++ -o build/main embedding.cpp -std=c++11 -I./build -I./node_modules/microflo/microflo
    # TODO: add a way to get include flags from MicroFlo executable
    ```

4. Run

    ```
    ./build/firmware
    # Should print out 14
    ```

5. Open code, make changes, GOTO .3

    ```
    $EDITOR embedding.cpp
    ```
<commit_msg>add an alternate method to build the linux embedding example from within the microflo module<commit_after>
Supported boards
-----------------

MicroFlo for Embedded Linux is *work-in-progress*.
A basic [I/O backend](../microflo/linux.hpp) with support for sysfs-based GPIO exists.

It has been tested on:

* Raspberry Pi
* Desktop Linux like Arch, Ubuntu
* add-your-board-here

Prerequisites
-----------------

1. Download and install [Node.JS](http://nodejs.org)
2. Download and install a C++ toolchain for your Embedded Linux device


Building MicroFlo
------------------
It is assumed that you have common build tools such as 'make', 'git', also that microflo is being installed in a module other than microflo itself. To build the embedding example from the microflo module please see the alternate method.

1. Install MicroFlo

    ```
    npm install microflo
    export PATH=`pwd`/node_modules/.bin/
    ```

2. Download example code

    ```
    wget https://github.com/microflo/microflo/raw/master/examples/embedding.cpp
    ```

3. Build

    ```
    microflo generate embedding.cpp build/ --target linux
    g++ -o build/firmware embedding.cpp -std=c++11 -I./build -I./node_modules/microflo/microflo
    # TODO: add a way to get include flags from MicroFlo executable
    ```

4. Run

    ```
    ./build/firmware
    # Should print out 14
    ```

5. Open code, make changes, GOTO .3

    ```
    $EDITOR embedding.cpp
    ```


Alternatively the embedding example can be built from within the micrfoflo module like this.

1. Create the target directory

    ```
    rm -rf build/embedding && mkdir build/embedding
    ```

2. Build

    ```
    node microflo.js generate examples/embedding.cpp build/embedding --target linux
    g++ -o build/embedding/firmware examples/embedding.cpp -std=c++11 -I./build/embedding -I./microflo
    # TODO: add a way to get include flags from MicroFlo executable
    ```

3. Run

    ```
    ./build/embedding/firmware
    # Should print out 14
    ```

4. Open code, make changes, GOTO .2

    ```
    $EDITOR examples/embedding.cpp
    ```

{'fraction_non_alphanumeric': 0.1343101343101343, 'fraction_numerical': 0.010073260073260074, 'mean_word_length': 2.585339168490153, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2190547', 'n_tokens_mistral': 1067, 'n_tokens_neox': 967, 'n_words': 350}