Skip to content

cppcheck, try to use proper install prefix so as the files to be able to be located

I see after the installation

which cppcheck
/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/2021-12-11T2101/AthenaExternals/22.0.50/InstallArea/x86_64-centos7-gcc11-opt/bin/cppcheck

trying to run

cppcheck -j8  --std=c++17  --error-exitcode=1 --enable=warning,portability,performance  --inline-suppr  -D__CPPCHECK__  -DATOMIC_POINTER_LOCK_FREE=2   --template=gcc  --suppress=*:*Boost*  --suppress=*:*Dict.* --suppress=*:*_test.*  --project=compile_commands.json
nofile:0:0: warning: Failed to load std.cfg. Your Cppcheck installation is broken, please re-install. The Cppcheck binary was compiled with FILESDIR set to "/build/atnight/localbuilds/nightlies/Athena/master/build/build/AthenaExternals/External/cppcheck/CMakeFiles/cppcheckBuild/share/Cppcheck" and will therefore search for std.cfg in /build/atnight/localbuilds/nightlies/Athena/master/build/build/AthenaExternals/External/cppcheck/CMakeFiles/cppcheckBuild/share/Cppcheck/cfg. [failedToLoadCfg]

running with strace

strace -o out  ~/cppcheck-install_2/bin/cppcheck --error-exitcode=1 --enable=warning,portability,performance  --inline-suppr  -D__CPPCHECK__  -DATOMIC_POINTER_LOCK_FREE=2   --template=gcc  --suppress=*:*Boost*  --suppress=*:*Dict.* --suppress=*:*_test.*  --project=compile_commands.json

i see

[christos@aiatlas034 build]$ cat out | grep std.cfg
open("std.cfg", O_RDONLY)               = -1 ENOENT (No such file or directory)
open("/afs/cern.ch/user/c/christos/cppcheck-install_2/bin/std.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/afs/cern.ch/user/c/christos/cppcheck-install_2/bin/cfg/std.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/afs/cern.ch/user/c/christos/cppcheck-install/share/Cppcheck/cfg/std.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
Edited by Christos Anastopoulos

Merge request reports