FPChecker Installation

A practical script

Install in Attenborough

  1. You need to install llvm, see LLVM - installation to install the llvm thoroughly. It seems version 10, 11, 12 are OK
  2. Download FPchecker
git clone --recursive https://github.com/LLNL/FPChecker.git
cd FPChecker
mkdir FPChecker_install
  1. Change the Cmake file
    Change the fist few lines in FPchecker - CMakeLists.txt > Code, see reason here
  2. Build
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=../FPChecker_install .. 
make install
  1. Add binary to PATH in ~/.bashrc
export PATH=/home/xinyi/FPChecker/FPChecker_install/bin:$PATH
  1. Set
  2. Test (need install pytest by pip)
(in build)
ctest -V


Cannot find clang/AST module - llvm install issue


/path/to/your/llvm/bin/llvm-config --cxxflags

find clang/ are not in the include path, see solution LLVM - installation > Cannot find the clang libraries when FPCheck Installation

CPU test are all failed -- didn't specify the right clang compiler

In FPChecker/cpu_checking, modify compilers in all *_frontend.sh files as our compiler.
E.g. we modify cc_frontend as

export FPC_COMPILER='/home/xinyi/llvm/llvm10/bin/clang'
export FPC_COMPILER_PARAMS=`printf "%q " "$@"`
DIR=`dirname $0`
exec "$DIR/../cpu_checking/clang_fpchecker.py"
MPI problem (usually cannot find useful symbols)

When running MPI problem, it used the default clang++. Thus, we need to specify the default clang++ as the correct clang.

E.g. in Attenborough
export PATH=~/llvm/llvm12/bin:$PATH