yuyangJin / BaguaTool

Performance analysis with graph analysis and hybrid static-dynamic analysis
1 stars 0 forks source link

BaguaTool

Dependency and Build

BaguaTool is dependent on

igraph has been integrated into baguatool as submodule. Dyninst and PAPI need user to build themselves.

There are two ways to build baguatool. One is to build dependency from source and specify their location when building baguatool, the other is to use spack to build these.

Build Dependency from Source

cmake .. -DBOOST_ROOT=/path_to_your_boost_install_dir -DDyninst_DIR=/path_to_your_dyninst_install_dir/lib/cmake/Dyninst -DPAPI_PREFIX=/path_to_your_papi_install_dir

# You should make sure that there is `DyninstConfig.cmake` in /path_to_your_dyninst_install_dir/lib/cmake/Dyninst
# And there is `include` `lib` in /path_to_your_papi_install_dir
# And there is `include` `lib` in /path_to_your_boost_install_dir, `boost` in /path_to_your_boost_install_dir/include

Note that if dyninst is built from source, the boost will be downloaded and installed automatically with it, in the install directory of dyninst.

In this case, the cmake commands will be like

cmake .. -DBOOST_ROOT=/path_to_your_dyninst_install_dir  -DDyninst_DIR=/path_to_your_dyninst_install_dir/lib/cmake/Dyninst -DPAPI_PREFIX=/path_to_your_papi_install_dir

Build Dependency from Spack

The recommended way to build Dyninst (with Boost) and PAPI is to use Spack

spack install dyninst # boost will be installed at the same time
spack install papi

# before building BaguaTool
spack load dyninst # boost will be loaded at the same time
spack load papi

# build
mkdir build
cd build
cmake ..