Build PandA framework from source

The PandA project is an open-source project and you can find the codebase on GitHub at

Install PandA build dependencies

To compile and install the PandA framework on one of the supported operating systems you must first install build dependencies. Here is a generic list of the tools and libraries required to compile the framework:

- Automake
- Autoconf
- Bison
- Doxygen
- Flex (>=2.6.4)
- GCC/Clang compiler with C++17 support
- BuDDy library (optional: necessary to build front-end alias analysis plugin)
- Boost headers
- GLPK (optional: needed to build SDC scheduling)
- Libtool
- Make
- MPFI (only to build FloPoCo)
- Suite Sparse libraries (optional: needed to build SDC scheduling)
- libicu
- liblzma
- libtinfo5
- libxml2
- lsb-release
- pkgconfig
- zlib

Furthermore, to compile the PandA Bambu HLS tool, at least one of the supported Clang LLVM compilers must be installed on the host machine. Common Clang and GCC compilers are used as frontend from the High-Level Synthesis flow to process the input source code and generate the internal Intermediate Representation (IR). Supported fronted compilers are:

Exact supported distribution of each one of the supported compilers can be downloaded from PandA release website at for convenience. Compilers packages from APT may be valid but are not guaranteed to work and are not tested, but should still be fine to use.

Debian-based systems

The following command can be used on Debian-based systems to install PandA framework build dependencies:

sudo apt-get install -y \
    autoconf autoconf-archive automake bison bzip2 \
    doxygen flex g++ g++-multilib gcc gcc-multilib ghostscript \
    graphviz libbdd-dev libboost-all-dev libc6-dev-i386 libfl-dev libglpk-dev \
    libicu-dev libltdl-dev liblzma-dev libmpc-dev libmpfi-dev libmpfr-dev \
    libsuitesparse-dev libtinfo5 libtool libxml2-dev linux-libc-dev \
    lsb-release make pkg-config texlive-fonts-recommended \
    texlive-latex-extra texlive-latex-recommended time xz-utils zlib1g-dev

To install GNU GCC compiler from APT, the following packages are required:

To install Clang LLVM compiler from APT, the following packages are required:

Fedora-based systems

The following command can be used on Fedora-based systems (CentOS, RHEL, Oracle Linux) to install PandA framework build dependencies:

sudo yum install -y \
    autoconf autoconf-archive automake bison bzip2 ca-certificates ccache curl doxygen \
    flex gcc gcc-c++ gcc-gfortran gettext-devel ghostscript glpk-devel gmp-devel \
    graphviz glibc-devel glibc-devel.i686 indent libicu-devel libstdc++-devel \
    libstdc++-devel.i686 libxml2-devel make mpfr-devel ncurses-libs openblas-devel \
    pkgconfig redhat-lsb rsync suitesparse-devel texinfo time wget zlib-devel \
    devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-gcc-gfortran \
    glpk-static gmp-static glibc-static libstdc++-static suitesparse-static zlib-static

Depending on the OS distribution it may also be required to build some dependencies from source, since they are not provided as needed by the system package provider (i.e. older version, missing static libraries, ...).

Libtool 2.4.7

Libtool is provided as a system package, but it does not provide static libraries, thus it is necessary to compile it from source if you need statically compiled binaries.

wget -qO- | tar xz
cd libtool-2.4.7
./configure --prefix=/usr --libdir=/usr/lib64
make -j4
sudo make install

Flex 2.6.4

Flex is provided as a system package, but in an older version that generates erratic code when compiled using C++17 standard (i.e. register keyword is used).

# Install help2man (required to install Flex)
wget -qO- | tar xJ
cd help2man-1.49.3
sudo make install

# Install Flex
git clone --depth 1 --branch v2.6.4
cd flex
make -j4
sudo make install

BuDDy library

BuDDy library is needed to compile the Bambu HLS front-end plugin used to perform alias analysis during the HLS flow.

wget -qO- | tar xz
cd buddy-2.4
./configure --prefix=/usr --libdir=/usr/lib64
make -j4
sudo make install

Clone PandA repository

Once all build dependencies have been successfully installed on the host machine, you may clone the git repository of the PandA framework on your machine and enter the root directory:

git clone --depth 1
cd PandA-bambu

Configure PandA build options

It is now necessary to run the Automake build configuration script. The configuration of PandA framework exposes the following options:

 Usage: ../configure [OPTION]... [VAR=VALUE]...

 To assign environment variables (e.g., CC, CFLAGS...), specify them as
 VAR=VALUE.  See below for descriptions of some of the useful variables.

 Defaults for the options are specified in brackets.

 Installation directories:
 --prefix=PREFIX         install architecture-independent files in PREFIX
 --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX

 By default, `make install' will install all the files in
 `/usr/local/bin', `/usr/local/lib' etc.  You can specify
 an installation prefix other than `/usr/local' using `--prefix',
 for instance `--prefix=$HOME'.

 Optional Features:
 --disable-option-checking  ignore unrecognized --enable/--with options
 --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
 --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
 --enable-silent-rules   less verbose build output (undo: "make V=1")
 --disable-silent-rules  verbose build output (undo: "make V=0")
 --enable-shared[=PKGS]  build shared libraries [default=no]
                         do not reject slow dependency extractors
                         speeds up one-time build
 --enable-clanglibcpp         Clang is going to use libc++
 --enable-oldclangabi         Clang plugins are compiled with the old abi
 --disable-nls           do not use Native Language Support
                         optimize for fast installation [default=no]
 --enable-static[=PKGS]  build static libraries [default=yes]
 --disable-libtool-lock  avoid locking (might break parallel builds)
 --enable-all                 compile all tools
 --enable-spider              compile spider tool for parse profiling analysis data
 --enable-bambu               compile bambu tool for High-Level Synthesis
 --enable-eucalyptus          compile eucalyptus tool for RTL characterization
 --enable-treegcc             compile tree-panda-gcc tool for gimple compilation
 --enable-release             compile the source code for release (default enabled)
 --enable-unordered           compile the source code with unordered data structure (default disabled)
 --enable-Werror              compile the source code with Werror option; a subset of possible warning is considered
 --disable-asserts            disable most of the runtime check (default enabled)
 --enable-debug               compile the source code with debug symbols (default disabled)
 --enable-opt                 compile the source code with -O2 (default enabled)
 --enable-allstatic           create static binaries
 --enable-32bits              create 32bits binaries
 --enable-flopoco             compile FloPoCo external library
 --disable-openmp        do not use OpenMP

 Optional Packages:
 --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
 --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
 --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                         shared library versioning (aka "SONAME") variant to
                         provide on AIX, [default=aix].
 --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
 --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                         compiler's sysroot if not specified).
 --with-boost[=DIR]      use boost (default is yes) - it is possible to
                         specify the root directory for boost (optional)
 --with-blas=<lib>       use BLAS library <lib>
 --with-lapack=<lib>     use LAPACK library <lib>
 --with-gcc49=executable-path path where the GCC 4.9 is installed
 --with-gcc5=executable-path path where the GCC 5 is installed
 --with-gcc6=executable-path path where the GCC 6 is installed
 --with-gcc7=executable-path path where the GCC 7 is installed
 --with-gcc8=executable-path path where the GCC 8 is installed
 --with-clang4=executable-path path where the CLANG 4.0 is installed
 --with-clang5=executable-path path where the CLANG 5.0 is installed
 --with-clang6=executable-path path where the CLANG 6.0 is installed
 --with-clang7=executable-path path where the CLANG 7.0 is installed
 --with-clang8=executable-path path where the CLANG 8.0 is installed
 --with-clang9=executable-path path where the CLANG 9.0 is installed
 --with-clang10=executable-path path where the CLANG 10.0 is installed
 --with-clang11=executable-path path where the CLANG 11.0 is installed
 --with-clang12=executable-path path where the CLANG 12.0 is installed
 --with-clang13=executable-path path where the CLANG 13.0 is installed
 --with-clang16=executable-path path where the CLANG 16.0 is installed
 --with-clangvvd=executable-path path where the CLANG vvd is installed
 --with-opt-level=<level> set the optimization level with which panda is compiled

Install prefix path must always be specified for a successful build process. Also, if frontend compilers are not available in system path (i.e. they have not been installed from APT), it is mandatory to add the corresponding option to set the compiler path: –with-clang<big_version>="/path/to/clang+llvm/bin/clang" for Clang LLVM compilers and –with-gcc<version>="/path/to/bin/gcc" for GNU GCC compilers.

By default, an optimized release version of all PandA framework tools is built, thus it is not necessary to use any additional option.
The following can be used to create a build directory and run the configuration for a release build of the PandA framework:

mkdir build
cd build
../configure --prefix=/opt/panda

The configure procedure can take a while, since some external libraries are compiled and installed in the given prefix path during the process.

It is also possible to set a specific compiler for the build process using CC and CXX variables. Both GNU GCC and Clang LLVM compilers may be used given the offer C++17 support:

../configure --prefix=/opt/panda CC=clang-16 CXX=clang++-16

Build PandA framework

After the build configuration has completed successfully, it is possible to start the PandA framework build process by running make inside the build directory:

make -j 4
NOTE: parallel builds may require a large amount of RAM on the system, an approximate 1GB per process has to be considered.

Install PandA framework

Finally, it is necessary to install the PandA frameowrk binaries and libraries using the make install command:

make install

Use PandA framework installed tools

Once the build and installation processes have been completed, you can find all PandA binaries in the prefix path you sepcified during the build configuration procedure inside the bin directory. Following the above, you should have the following:

ls /opt/panda
bambu  eucalyptus  fplll  latticegen  sollya  spider  tree-panda-gcc

Next steps

Generated on Mon Feb 12 2024 13:03:38 for PandA-2024.02 by doxygen 1.8.13