Getting Started: Building and Installing PollyProf
Requirements
In order to make use of PollyProf and our empirical study, you need to be able, to compile Polly (Available here), i.e., have all of its prerequisites.Build
Get the code
The profiling information we generate is timing information, retrieved with the PAPI library. In order to be able to generate and analyze the required profiling information, we require several patches to the LLVM compiler framework. For now, we suggest to use our LLVM source code (the PAPI extension will be added to LLVM in the future):- The LLVM source code with our profiling patches included is available here
- The PollyProf source code is available here. Extract this archive in the tools directory of the llvm sources (above).
- libPAPI (Available: here)
- clang (Available: here). The version used for this study was: SVN revision 159735. Newer versions might not work.
Set the directory layout:
export BASE=`pwd` export LLVM_SRC=${BASE}/llvm export POLLY_SRC=${LLVM_SRC}/tools/polly # Also build the matching clang-version (optional) export CLANG_SRC=${LLVM_SRC}/tools/clang
Polly's Prerequisites
- libgmp
- CLooG/isl
libgmp
Install libgmp (library + developer package) through the package management system of your operating system.CLooG/isl
Polly is tested with a fixed version of CLooG and isl. To obtain the source code of CLooG (including isl) use checkout_cloog.sh as available in ${POLLY_SRC}/utils/checkout_cloog.sh.Set the directory layout:
export CLOOG_SRC=${BASE}/cloog_src export CLOOG_INSTALL=${BASE}/cloog_install export PAPI_INSTALL=${BASE}/papi_install
First installation
${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC} cd ${CLOOG_SRC} ./configure --prefix=${CLOOG_INSTALL} make make install cd ${BASE}
Update the installation
Updating CLooG may become necessary, if Polly uses a feature only available in a recent version of CLooG.${POLLY_SRC}/utils/checkout_cloog.sh ${CLOOG_SRC} cd ${CLOOG_SRC} make make install cd ${BASE}
Build PollyProf
To build PollyProf you can use cmake build system.Set the directory layout:
export LLVM_BUILD=${BASE}/llvm_build mkdir ${LLVM_BUILD} cd ${LLVM_BUILD}
CMake
cmake -DCMAKE_PREFIX_PATH=${CLOOG_INSTALL} ${LLVM_SRC} cmake -DCMAKE_PREFIX_PATH=${PAPI_INSTALL} . cmake -DPOLLY_ENABLE_PPROF=ON . cmake -DBUILD_SHARED_LIBS=ON . makeMake sure libprofile gets built and installed along with LLVM/Polly/PollyProf
make -Cruntime/libprofile make -Cruntime/libprofile install
Test Polly
To check if Polly works correctly you can run make polly-test for the cmake build.
If you get something like "... libisl.so.9: cannot open shared object file ..", it is because you installed cloog to a non-standard path, and libisl/libcloog could not be found. To solve this issue, you need to append the path of parent directory of libisl/libcloog, i.e. ${CLOOG_INSTALL}/lib, to LD_LIBRARY_PATH by:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CLOOG_INSTALL}/lib