[gmx-developers] Clang static analyzer (scan-build and scan-view)

Schulz, Roland roland.schulz at intel.com
Thu Dec 8 20:51:06 CET 2016


Hi,

The c++ compiler command has to be c++-analyzer. You either can run "scan-build cmake" (it sets CXX=c++-analyzer)  and not set CMAKE_CXX_COMPILER manually or set it to c++-analyzer.

Roland

-----Original Message-----
From: gromacs.org_gmx-developers-bounces at maillist.sys.kth.se [mailto:gromacs.org_gmx-developers-bounces at maillist.sys.kth.se] On Behalf Of Vedran Miletic
Sent: Thursday, December 8, 2016 11:20 AM
To: GROMACS developers <gmx-developers at gromacs.org>
Subject: [gmx-developers] Clang static analyzer (scan-build and scan-view)

Hi,

I am trying to reproduce Jenkins' Clang static analyzer locally. I have Clang / LLVM latest git installed in /usr/local (for some reason 3.8 that comes with Fedora 24 is unable to compile a simple test, did not look into it further).

Per admin/builds/clang-analyzer.py I do

$ cmake -DCMAKE_BUILD_TYPE=Debug -DGMX_DEVELOPER_BUILD=ON -DGMX_GPU=OFF -DGMX_OPENMP=OFF -DGMX_SIMD=None -DGMX_FFT_LIBRARY=fftpack -DCMAKE_C_COMPILER=/usr/local/bin/clang
-DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ ..

and then

$ scan-build make -j8

but never get any warnings. I tried infesting the code with known positives and even calling it from other functions to make sure it doesn't get optimized out, but did not help. I tried setting --use-cc=/usr/local/bin/clang --use-c++=/usr/local/bin/clang++ but did not help. Also, running

$ scan-build clang++ helloworld.cpp

works as expected. Any ideas what I am doing wrong and what I can try?

Regards,
Vedran

--
Vedran Miletić
vedran.miletic.net
--
Gromacs Developers mailing list

* Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request at gromacs.org.


More information about the gromacs.org_gmx-developers mailing list