Skip to content

Building Bambu through Docker

Serena Curzel edited this page Nov 7, 2023 · 1 revision

Prerequisites

Before you begin, make sure you have the following software installed on your system:

Build PandA Bambu HLS

1. Clone the Repository

Start by cloning the repository to your local machine:

git clone https://github.com/ferrandi/PandA-bambu.git
cd PandA-bambu

2. Configure Docker environment

Project dependencies are already installed inside the base image, but you also need to select what fronted compilers to use in PandA Bambu HLS. To do this, you need to set the APP_COMPILERS variable to specify which compilers you need. Available options are:

  • gcc-4.5
  • gcc-4.6
  • gcc-4.7
  • gcc-4.8
  • gcc-4.9
  • gcc-5
  • gcc-6
  • gcc-7
  • gcc-8
  • clang-4
  • clang-5
  • clang-6
  • clang-7
  • clang-8
  • clang-9
  • clang-10
  • clang-11
  • clang-12
  • clang-13
  • clang-16

You must always select at least one compiler from the Clang family since it is mandatory for PandA Bambu HLS to work properly. Now you can launch the following command to install required compilers inside the container:

make -f Makefile.init appimage-setup APP_COMPILERS="gcc-4.9,gcc-8,clang-12,clang-16"

If you wish to add different compilers later you can run the command again with the updated APP_COMPILERS list.

3. Build the executables

Once setup is completed, you need to run the compile command as follows:

make -f Makefile.init appimage-build APP_CONFIGURE="--enable-glpk --enable-opt --enable-release"

The default compiler available inside the build container will be used to compile PandA Bambu HLS, but this can be changed by adding CC and CXX options to the APP_CONFIGURE string as follows: APP_CONFIGURE="<other_options> CC=clang-16 CXX=clang++-16".

The AppImage package will be generated by default, but if you plan to work on the code and build the code frequently you may want to avoid the packaging procedure to be executed after each compilation. AppImage package generation may be skipped by adding --skip-package as the beginning of the APP_CONFIGURE string: APP_CONFIGURE="--skip-package <other_options>".

4. Run the executable

After the build task has been completed, you will find the PandA Bambu HLS AppImage package in the panda_dist folder in the root directory of the project. To run the AppImage set the execution permissions on the file and enjoy:

chmod +x panda_dist/bambu.AppImage
./panda_dist/bambu.AppImage --help

When passing the --skip-package option in the APP_CONFIGURE string, the AppImage is not generated, thus you need to run the Bambu executable directly as follows:

APPDIR="/abs/path/to/panda_dist/distdir" /abs/path/to/panda_dist/distdir/usr/bin/bambu --help

The APPDIR environment variable must be set to the absolute path pointing to panda_dist/distdir folder in the project root to allow proper execution of the bambu executable.