Here I document what I did when updating to clang3.6 and include-what-you-use

Note: it is useful to sign up for the include-what-you-use mailing list, but I never check regularly. I usually check only when looking for new releases, trouble in the reports etc.

setup up IWYU

since recently, one doesn't need to compile the full LLVM and make the whole build area availabe for IWYU, an out-of-llvm-build works just fine.

So go to the http://include-what-you-use.org/downloads/ area and check for a matching IWYU release.

At the time of writing, this is is llvm3.6 and iwyu-0.4. Setup llvm, get the release and untar:

source /afs/cern.ch/sw/lcg/external/llvm/3.6/x86_64-slc6/setup.sh
wget http://include-what-you-use.org/downloads/include-what-you-use-0.4.src.tar.gz
tar xvfz 

Read the README !

Setup cmake:

export PATH=${PATH}:/afs/cern.ch/sw/lcg/contrib/CMake/3.2.3/Linux-x86_64/bin

start out of source build (mostly from the README):

mkdir build
cd build
# to determine path for LLVM_PATH do
which clang
cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++`  -DLLVM_PATH=/afs/cern.ch/sw/lcg/external/llvm/3.6/x86_64-slc6/lib ../include-what-you-use
make

Voila, you have now a working include-what-you-use program.

running scans of the ATLAS code base

To run efficiently, I am setting up code base in AFS, with the source code taken automatically from the latest available kit in dev, rel_6. The analysis will be run on atmic001, a machine with 64 GB of real memory, the scanill be done in /dev/shm Scripts for now are in ~soco/workArea/iwyu-0.4/scanner, they will be imported into a repository soon.
run_scanner.sh
has all the logic for running the scan and delegate the post-processing to some further scripts.

Then, in run_cron.sh there's further additional steps which makes this fully automated, and possible to run from an acron job.

Some performance considerations

Initially, the cron job on clang3.5/IWYU was run on pcmpp002, a 5-year old machine with Nhalem processor and 16 cores with hyper-threading. The scan was done on a spinning harddisk. The full scan of a Atlas nightly takes about 10 hours.

With clang3.6/IWYU I installed it on atmic001, where the scan is performed in a RAM disk in /dev/shm. This machine has 32 cores, again hyper-threaded, with 64GB of physical RAM. The full scan here takes 6 3/4 hours.

Further possible performance improvements

  • install the executable for include-what-you-use also in /dev/shm
  • install also clang in /dev/shm
  • install also the gcc compiler in /dev/shm
The purpose of the last two steps is to have extremey fast access to the system header files which are read over and over. This can boost the performance.

Other points:

  • use a compilation data base. With cmake this is trivial to get, just one option to the cmake configuration. With CMT one has to use things like 'bear'.

Other improvements

The tool reports a lot of include files originating in e.g. Gaudi. This should be cleared up with IWYU mapping files.

-- RolfSeuster - 2015-09-03

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2015-09-03 - RolfSeuster
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback