Setup a new project

Get the example project

For this example, we will use a code sample from the following open-source project: here.

You may retrieve it using any of these methods:

  • Using the following command:

    git clone https://github.com/wedolow/Codes-Samples
  • Downloading the latest version as a zip here and unzipping it.

The code used in this example is contained in the subfolder FFT-C. This code implements a CPU-based Fast Fourier Transform algorithm, includes a Makefile to build it, and contains test cases to stimulate the algorithm.

The code does not need to be able to build or run on your own system, as we will be using a Debian 11 Docker container for build, run, analysis and optimization, provided to you by WedoLow.


Create a new project

1

Open projects page and create a new project

Once logged in, you end up on the projects page.

beLow projects page

Click on Create a new project.

2

Enter project name and description

Enter a project name (for example: FFT-C), an optional description and click Next.

Project name and description settings
3

Select project mode and version

Select Copy the project and enter a version name.

  • In Copy mode, beLow works on a copy of your project.

  • In Local mode, it works directly in the project's directory (only possible for projects that can build on your own system).

Project mode and version settings
4

Select the source folder

Provide the root directory of your project by either:

  • Clicking Browse and selecting the FFT-C directory, or

  • Drag-and-dropping the FFT-C directory from your file explorer.

Click Confirm and next.

Source directory selection

Target platform, analysis and execution setup

In each project setup, define two platforms:

  • Build platform: the system where all build actions, analyses and optimizations occur.

  • Target platform: the system where the compiled code executes.

Example: if cross-compiling on Windows for a Raspberry Pi:

  • Build platform: Windows (x86_64 Intel Skylake)

  • Target platform: Linux (AARCH64 Cortex-A53 ARMv8)

In this FFT-C example, build and target platforms are the same: Debian 11 Linux on x86_64.

Even if your PC is not Skylake, select Skylake as a representative generic x86_64 architecture.

Platform and analysis settings

On the platform selection page:

  • Select "Linux System - Debian GNU/Linux 11 (bullseye) - x86_64 - Intel skylake".

  • Activate "Dynamic analysis (auto)" so beLow automatically manages dynamic traces and profiling.

  • Activate "Restructuring optimizations" to enable search for additional code optimizations when beLow can build/execute the project in a closed loop.

Click Confirm and next.


Run script setup

Decide whether the execution script runs on the build platform or on the target platform.

  • If on the build platform, the script must send the compiled binary to the target, execute it, and retrieve profiling data.

  • If on the target platform, a beLow runner must be present to run and retrieve profiling data.

In this example the build and target are the same, so either option works.

Our test bench is the binary app_test.exe at the project root. Configure the run script as follows:

  • Script content:

./app_test.exe
  • Script execution path: (project root — leave empty)

  • Shell: Bash or Sh

Click Confirm and next.

Run script settings

Target options

You may choose to install software/packages or inject environment variables on the target platform. For this example, no target additions are needed.

Click Confirm and next.

Target options

Build platform and build settings

Build platform selection

On this screen select the build platform. You may see two possible platforms:

  • Linux System - Debian GNU/Linux 11 (bullseye) - x86_64 - Any CPU (a Dockerized platform provided by beLow)

  • Another platform corresponding to your own system

Select Linux System - Debian GNU/Linux 11 (bullseye) - x86_64 - Any CPU and click Confirm and next.


Build options — install required software

In build options, you need to install a package check required by the FFT-C build process.

  • Unroll the "Software to install" section and wait while the package list loads (the first time the Debian 11 Docker image is downloaded/extracted — may take a few minutes).

  • Use the search bar to find the check package and select it.

  • Click Confirm and next.

Build options

Build scripts setup

Tell beLow how to build the project for the selected target.

  • Configure section: leave blank (no configuration required).

  • Clean section:

    • Script content:

      make clean
    • Script execution path: project root (leave empty)

    • Shell: Bash or Sh

A clean script is optional but can help beLow understand the compilation process and run operations from a clean state.

  • Build section:

    • Script content:

      make app_test.exe
    • Script execution path: project root (leave empty)

    • Shell: Bash or Sh

Click Confirm and next.

Build scripts setup

Build platform build and run scripts (for restructuring optimizations)

Because "Restructuring optimizations" is activated, provide build scripts that run on the build platform and how to run the executable on the build platform.

In this example the build and target platforms are the same, so these scripts are identical to the previous ones.

  • Configure: leave blank

  • Clean:

    make clean
  • Build:

    make app_test.exe
  • Run:

    ./app_test.exe
  • Script execution path: project root (leave empty)

  • Shell: Bash or Sh

Click Confirm and next.

Host build scripts

Build and exploration process

After setup, jobs are triggered to:

  • Test your project build

  • Attempt to understand your build actions

  • Explore source code to identify functions and hierarchy

When the job finishes, you will see a table with the list of all project functions.

Select a top function that represents the highest level in the hierarchy to be analyzed/optimized. All functions called by this function (recursively) will be considered. Functions in independent graphs or upstream of the top function graph will not.

Click View function tree to inspect how functions relate (optional).

Function tree

Close the graph when done.

In this example, select app_exec as the top function. The functions that call it are test bench setup functions that do not need optimization, and app_exec is the entry point for FFT function calls of interest.

Top function selection

Leave quality settings untouched in this example.

After a short post-processing job, your project setup is complete. Proceed to run an analysis as described in your workflow.

Last updated