Tau clang plugin: Difference between revisions

From OACISS Systems Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 5: Line 5:
= Compilation and installation =
= Compilation and installation =


As TAU relies on LLVM's Intermediate Representation, the TAU plugin is built upon an LLVM installation. If no installation is currently accessible, LLVM's installation can be done by following these commands:
As TAU relies on LLVM's Intermediate Representation, the TAU plugin is built upon an LLVM installation. That means an LLVM install is needed, as well as a TAU install.
 
== TAU installation ==
 
TAU installation is done by following these commands:
 
<code>
git clone https://github.com/UO-OACISS/tau2.git
 
cd tau2
 
./installtau -cc=clang -c++=clang++ -dwarf=download -bfd=download -iowrapper -iowrapper -otf=download
</code>
 
TAU records all configurations used to install it in the <code> .allconfigs </code> file. The last used configuration is stored in the <code> .lastconfig </code> file.
 
== LLVM installation ==
 
LLVM's installation can be done by following these commands:


<code>
<code>
Line 19: Line 37:
</code>
</code>


That being done the plugin can be built upon LLVM:
== Plugin installation ==
 
With LLVM installed, the plugin can be built upon it:


<code>
<code>

Revision as of 22:46, 7 January 2021

Use

The aim of this plugin is to facilitate the use of TAU. Parsing a function-listing file, the TAU plugin runs a function pass on each function from the original source, adding them to be instrumented if the function-listing file specifies it.

Compilation and installation

As TAU relies on LLVM's Intermediate Representation, the TAU plugin is built upon an LLVM installation. That means an LLVM install is needed, as well as a TAU install.

TAU installation

TAU installation is done by following these commands:

git clone https://github.com/UO-OACISS/tau2.git

cd tau2

./installtau -cc=clang -c++=clang++ -dwarf=download -bfd=download -iowrapper -iowrapper -otf=download

TAU records all configurations used to install it in the .allconfigs file. The last used configuration is stored in the .lastconfig file.

LLVM installation

LLVM's installation can be done by following these commands:

git clone https://github.com/llvm/llvm-project.git

cd llvm-project/llvm

mkdir build; cd build

cmake ../../llvm -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/../install -DLLVM_ENABLE_PROJECTS="clang;mlir;polly;flang;libcxx;libcxxabi"

make -j install

Plugin installation

With LLVM installed, the plugin can be built upon it:

git clone https://github.com/coti/tau-llvm-plugin.git

cd tau-llvm-plugin

mkdir build; cd build

cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../install -DLLVM_ROOT=/PATH/TO/LLVM/INSTALLATION/install

make -j install

Running it

The TAU plugin is a function pass, meaning it takes effect during the compilation of the executable to be instrumented. To do so, the compiling command resembles this:

/PATH/TO/LLVM/INSTALLATION/install/bin/clang -fplugin=/PATH/TO/PLUGIN/INSTALLATION/install/lib/TAU_Profiling.so -mllvm -tau-input-file=/PATH/TO/FUNCTION/LISTING/FILE/select.tau -ldl -L/PATH/TO/TAU/lib/SPECIFIC_TAU_INSTALLATION -lTAU -Wl,-rpath,/PATH/TO/TAU/lib/SPECIFIC_TAU_INSTALLATION -lm [project files]

That being done, execute the code by calling:

tau_exec -T clang,serial ./a.out

Then, to access the instrumentation results, call:

pprof

Packaging

Linux

Mac OS

brew install --build-from-source llvm