<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog blog("Baptiste Wicht"); (Posts about Tools)</title><link>https://baptiste-wicht.com/</link><description></description><atom:link href="https://baptiste-wicht.com/categories/tools.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Sun, 15 Feb 2026 06:57:39 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Switching from vim to neovim</title><link>https://baptiste-wicht.com/posts/2023/09/switching-from-vim-to-neovim.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;As mentioned in my last article, I am now using neovim instead of vim. I just wanted to comment shortly on this change.&lt;/p&gt;
&lt;p&gt;I have been using vim as my IDE for many years now (more than 10 years at least). But at the beginning of the year,
I switched to neovim instead.&lt;/p&gt;
&lt;p&gt;neovim is a fork of vim, so it is quite similar, but it has some very important differences. It started in 2015, after
a multithreading patch was rejected from vim.&lt;/p&gt;
&lt;p&gt;Here are some of the advantages:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Very powerful Builtin Langauge Server Protocol (LSP)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Faster startup&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Builtin LUA support (the configuration can be written entirely in LUA)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Asynchronous tasks (was later added to vim)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A lot of things are compatible between both editors. When I started with neovim, I simply copied over my vim
configuration and started using neovim with only very minor changes.&lt;/p&gt;
&lt;p&gt;But what really convinced me to keep using neovim was the LSP. This feature and the great plugins that make use of it
greatly simplify how to deeply integrate C++ into neovim. I am now taking advantage of the clang tooling to analyze C++
code on the fly. And I get great autocompletion as well.&lt;/p&gt;
&lt;p&gt;All of this is doable with vim as well, but the last time I tried with vim, it was a nightmware to configure. With the
help of (quite a few) plugins, I could setup automcompletion in a great way. This allows me to jump to declarations and
definitions very easily.&lt;/p&gt;
&lt;p&gt;I am far from being a neovim expert, but I am very happy with this tool. It definitely makes my life easier for
configuring complex features, compared to vim.&lt;/p&gt;
&lt;p&gt;If you are interested, you can find my neovim configuration in my &lt;cite&gt;dotfiles repository&amp;lt;https://github.com/wichtounet/dotfiles&amp;gt;&lt;/cite&gt;. It's very fresh because it was previously saved on another place and was recently copied there. I plan to improve it and little by little rewrite it in LUA. There are still some experimental stuff and it could be improved significantly. But I am really happy with the features configured.&lt;/p&gt;
&lt;p&gt;What about you? What do you think of neovim?&lt;/p&gt;</description><category>neovim</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2023/09/switching-from-vim-to-neovim.html</guid><pubDate>Wed, 20 Sep 2023 17:25:24 GMT</pubDate></item><item><title>Jenkins Tip: Send notifications on fixed builds in declarative pipeline</title><link>https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;In &lt;a class="reference external" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html"&gt;my previous post&lt;/a&gt;, I presented a few news about Jenkins and about the fact that I switched to declarative pipelines and Github Organization support for my projects.&lt;/p&gt;
&lt;p&gt;The main issue I had with this system is that I lost the ability to get
notifications on build that recover. Normally, I would get an email indicating
that build X was back to normal, but I haven't found a way to solve that for
declarative pipeline.&lt;/p&gt;
&lt;p&gt;By following a few posts on StackOverflow, I now have the solution and it is the
same problem that was already present in scripted pipelines. Namely, the status
of the current build is not set early enough for the notification.  Basically,
you have to set the notification yourself. Here is what a declarative pipeline
looks like:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code groovy"&gt;&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-1" name="rest_code_94fba423c460431890fa2a45951108d3-1" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;pipeline&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-2" name="rest_code_94fba423c460431890fa2a45951108d3-2" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;any&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-3" name="rest_code_94fba423c460431890fa2a45951108d3-3" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-3"&gt;&lt;/a&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-4" name="rest_code_94fba423c460431890fa2a45951108d3-4" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;stages&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-5" name="rest_code_94fba423c460431890fa2a45951108d3-5" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-5"&gt;&lt;/a&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-6" name="rest_code_94fba423c460431890fa2a45951108d3-6" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-6"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;// Normal Stages&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-7" name="rest_code_94fba423c460431890fa2a45951108d3-7" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-7"&gt;&lt;/a&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-8" name="rest_code_94fba423c460431890fa2a45951108d3-8" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-8"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'success'&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-9" name="rest_code_94fba423c460431890fa2a45951108d3-9" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-9"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-10" name="rest_code_94fba423c460431890fa2a45951108d3-10" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-10"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;script&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-11" name="rest_code_94fba423c460431890fa2a45951108d3-11" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-11"&gt;&lt;/a&gt;&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="n"&gt;currentBuild&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'SUCCESS'&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-12" name="rest_code_94fba423c460431890fa2a45951108d3-12" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-12"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-13" name="rest_code_94fba423c460431890fa2a45951108d3-13" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-13"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-14" name="rest_code_94fba423c460431890fa2a45951108d3-14" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-14"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-15" name="rest_code_94fba423c460431890fa2a45951108d3-15" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-15"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-16" name="rest_code_94fba423c460431890fa2a45951108d3-16" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-16"&gt;&lt;/a&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-17" name="rest_code_94fba423c460431890fa2a45951108d3-17" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-17"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-18" name="rest_code_94fba423c460431890fa2a45951108d3-18" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-18"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;failure&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-19" name="rest_code_94fba423c460431890fa2a45951108d3-19" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-19"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;script&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-20" name="rest_code_94fba423c460431890fa2a45951108d3-20" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-20"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;currentBuild&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'FAILURE'&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-21" name="rest_code_94fba423c460431890fa2a45951108d3-21" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-21"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-22" name="rest_code_94fba423c460431890fa2a45951108d3-22" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-22"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-23" name="rest_code_94fba423c460431890fa2a45951108d3-23" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-23"&gt;&lt;/a&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-24" name="rest_code_94fba423c460431890fa2a45951108d3-24" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-24"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-25" name="rest_code_94fba423c460431890fa2a45951108d3-25" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-25"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="o"&gt;([&lt;/span&gt;&lt;span class="n"&gt;$class&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'Mailer'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-26" name="rest_code_94fba423c460431890fa2a45951108d3-26" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-26"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="nl"&gt;notifyEveryUnstableBuild:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-27" name="rest_code_94fba423c460431890fa2a45951108d3-27" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-27"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="nl"&gt;recipients:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"baptiste.wicht@gmail.com"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-28" name="rest_code_94fba423c460431890fa2a45951108d3-28" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-28"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="nl"&gt;sendToIndividuals:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-29" name="rest_code_94fba423c460431890fa2a45951108d3-29" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-29"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-30" name="rest_code_94fba423c460431890fa2a45951108d3-30" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-30"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_94fba423c460431890fa2a45951108d3-31" name="rest_code_94fba423c460431890fa2a45951108d3-31" href="https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html#rest_code_94fba423c460431890fa2a45951108d3-31"&gt;&lt;/a&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There are two important things here. First, a new stage (success) is added that
simply set the result of the current build to SUCCESS once it is done. It must
be the last stage on the pipeline. This could also be added as the last step of
the last stage instead of adding a new stage, but I think it's clearer like
this. The second thing is the failure block in which the result of the current
build is set to FAILURE. With these two things, the Mailer plugin now sends
notification when a build has been fixed.&lt;/p&gt;
&lt;p&gt;I hope that will help some of you. I personally think that it should be much
easier than that. All this boilerplate is polluting the pipeline that should be
kept more maintainable, but for now it seems, it's the nicest way to achieve
that, short of handling all conditions in the post block and sending mail
directly there, but that would result in even more boilerplate code.&lt;/p&gt;</description><category>Continuous Integration</category><category>Jenkins</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2017/06/jenkins-tip-send-notifications-fixed-builds-declarative-pipeline.html</guid><pubDate>Wed, 07 Jun 2017 07:52:57 GMT</pubDate></item><item><title>Jenkins Declarative Pipeline and Awesome Github Integration</title><link>https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;This post is about some news about Jenkins and how I've updated my Jenkins
usage. This may be a bit of an enthusiastic post ;)&lt;/p&gt;
&lt;p&gt;At the beginning of Jenkins, the best way to define the commands to be executed
for your builds was simply to write the commands in the Jenkins interface. This
worked quite well. Later on, Jenkins introduced the notion of Pipeline. Instead
of a single set of commands to be executed, the build was defined in
multi-stages pipeline of commands. This is defined as a Groovy script. One big
advantage of this is that all the code for creating the build is inside the
repository. This has the advantage that each build is reproducible. This enabled
to define complex pipelines of commands for your builds. Moreover, this also
allows to have a clean view of which steps are failing and which steps are
taking how much of the time of the build. For instance, here it's a view of the
pipeline steps for my DLL project:&lt;/p&gt;
&lt;img alt="Jenkins stage view for DLL pipeline." class="align-center" src="https://baptiste-wicht.com/images/jenkins_pipeline_dll.png"&gt;
&lt;p&gt;I think that's pretty cool :)&lt;/p&gt;
&lt;p&gt;They recently added a new feature, the declarative pipelines. Instead of
scripting the Pipeline in Groovy, the new system uses its own syntax, completely
declarative, to put blocks together and add ways of doing actions at specific
points and setting environment and so on. I think the new syntax is much nicer
than the Groovy scripted Pipeline way, so I started converting my scripts. I'll
give an example in a few paragraphs. But first, I'd like to talk about Github
integration. Before, every time I created a new project, I add to add it to
Jenkins by creating a new project, updating the link to the Github project and
a few things in order to add it. This is not so bad but what if you want to
build on several branches and keep track of the status of the branches and maybe
of the Pull Requests as well. All of this is now very simple. You can now
declare the Github organizations (and users) you are of building projects from
and the projects inside the organization will be automatically detected as long
as they have a Jenkinsfile inside. That means that you'll never have to create
a project yourself or handle branches. Indeed, all the created projects can now
handle multiples. For instance, here is the status of the two current branches
of my dll project:&lt;/p&gt;
&lt;img alt="Jenkins branches for DLL Github project" class="align-center" src="https://baptiste-wicht.com/images/jenkins_github_branches.png"&gt;
&lt;p&gt;It's maybe not the best example since one branch is failing and the other is
unstable, but you can see that you can track the builds for each branch in
a nice way.&lt;/p&gt;
&lt;p&gt;A very good feature of this integration is that Jenkins will now automatically
marks commits on your Github with the status of your builds at no cost! For
instance, here is the status on my ETL project after I configured on Jenkins and
made the first builds:&lt;/p&gt;
&lt;img alt="Jenkins marking commits in Github" class="align-center" src="https://baptiste-wicht.com/images/jenkins_github_integration_marks.png"&gt;
&lt;p&gt;Pretty cool I think :)&lt;/p&gt;
&lt;p&gt;Another nice thing in Jenkins is the Blue Ocean interface. This is an
alternative interface, especially well-suited for multi-branch projects and
pipelines. It looks much more modern and I think it's quite good. Here are a few
views of it:&lt;/p&gt;
&lt;p&gt;The Activity view for the last events of the project:&lt;/p&gt;
&lt;img alt="Jenkins Blue Ocean Activity view for DLL project" class="align-center" src="https://baptiste-wicht.com/images/jenkins_blue_ocean_dll_activity.png"&gt;
&lt;p&gt;The Branches view for the status of each branch:&lt;/p&gt;
&lt;img alt="Jenkins Blue Ocean Branches view for DLL project" class="align-center" src="https://baptiste-wicht.com/images/jenkins_blue_ocean_dll_branches.png"&gt;
&lt;p&gt;The view of the status of a build:&lt;/p&gt;
&lt;img alt="Jenkins Blue Ocean view of a build for DLL project" class="align-center" src="https://baptiste-wicht.com/images/jenkins_blue_ocean_dll_build.png"&gt;
&lt;p&gt;The status of the tests for a given build:&lt;/p&gt;
&lt;img alt="Jenkins Blue Ocean view of a build tests for DLL project" class="align-center" src="https://baptiste-wicht.com/images/jenkins_blue_ocean_dll_build_tests.png"&gt;
&lt;p&gt;It's likely that it won't appeal to everyone, but I think it's pretty nice.&lt;/p&gt;
&lt;p&gt;If we get back to the declarative Pipeline, here is the declarative pipeline for
my Expression Templates Library (ETL) project:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code groovy"&gt;&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-1" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-1" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;pipeline&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-2" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-2" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;any&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-3" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-3" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-3"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-4" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-4" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;environment&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-5" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-5" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="n"&gt;CXX&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"g++-4.9.4"&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-6" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-6" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-6"&gt;&lt;/a&gt;&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="n"&gt;LD&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"g++-4.9.4"&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-7" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-7" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="n"&gt;ETL_MKL&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'true'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-8" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-8" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-8"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-9" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-9" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-9"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-10" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-10" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-10"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;stages&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-11" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-11" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-11"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'git'&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-12" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-12" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-12"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-13" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-13" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-13"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;checkout&lt;/span&gt;&lt;span class="o"&gt;([&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-14" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-14" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-14"&gt;&lt;/a&gt;&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="n"&gt;$class&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'GitSCM'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-15" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-15" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-15"&gt;&lt;/a&gt;&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="nl"&gt;branches:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;scm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-16" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-16" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-16"&gt;&lt;/a&gt;&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="nl"&gt;doGenerateSubmoduleConfigurations:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-17" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-17" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-17"&gt;&lt;/a&gt;&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="nl"&gt;extensions:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;scm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;extensions&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;$class&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'SubmoduleOption'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;disableSubmodules:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;recursiveSubmodules:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;reference:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;trackingSubmodules:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;]],&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-18" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-18" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-18"&gt;&lt;/a&gt;&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="nl"&gt;submoduleCfg:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[],&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-19" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-19" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-19"&gt;&lt;/a&gt;&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="nl"&gt;userRemoteConfigs:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;scm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;userRemoteConfigs&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-20" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-20" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-20"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-21" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-21" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-21"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-22" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-22" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-22"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-23" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-23" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-23"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'pre-analysis'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-24" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-24" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-24"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-25" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-25" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-25"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'cppcheck --xml-version=2 -j3 --enable=all --std=c++11 `git ls-files "*.hpp" "*.cpp"` 2&amp;gt; cppcheck_report.xml'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-26" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-26" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-26"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'sloccount --duplicates --wide --details include/etl test workbench &amp;gt; sloccount.sc'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-27" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-27" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-27"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'cccc include/etl/*.hpp test/*.cpp workbench/*.cpp || true'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-28" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-28" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-28"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-29" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-29" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-29"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-30" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-30" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-30"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-31" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-31" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-31"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'build'&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-32" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-32" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-32"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-33" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-33" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-33"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'make clean'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-34" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-34" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-34"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'make -j6 release'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-35" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-35" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-35"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-36" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-36" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-36"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-37" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-37" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-37"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-38" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-38" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-38"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'test'&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-39" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-39" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-39"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-40" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-40" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-40"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'ETL_THREADS=-j6 ETL_GPP=g++-4.9.4 LD_LIBRARY_PATH=\"${LD_LIBRARY_PATH}:/opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64\" ./scripts/test_runner.sh'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-41" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-41" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-41"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;archive&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'catch_report.xml'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-42" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-42" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-42"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;junit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'catch_report.xml'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-43" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-43" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-43"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-44" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-44" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-44"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-45" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-45" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-45"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-46" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-46" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-46"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sonar-master'&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-47" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-47" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-47"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;when&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-48" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-48" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-48"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;branch&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'master'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-49" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-49" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-49"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-50" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-50" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-50"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-51" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-51" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-51"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/opt/sonar-runner/bin/sonar-runner"&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-52" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-52" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-52"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-53" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-53" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-53"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-54" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-54" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-54"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-55" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-55" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-55"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sonar-branch'&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-56" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-56" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-56"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;when&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-57" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-57" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-57"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-58" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-58" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-58"&gt;&lt;/a&gt;&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="n"&gt;branch&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'master'&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-59" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-59" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-59"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-60" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-60" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-60"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-61" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-61" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-61"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-62" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-62" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-62"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;sh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/opt/sonar-runner/bin/sonar-runner -Dsonar.branch=${env.BRANCH_NAME}"&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-63" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-63" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-63"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-64" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-64" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-64"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-65" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-65" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-65"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-66" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-66" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-66"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;stage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'bench'&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-67" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-67" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-67"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-68" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-68" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-68"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;job:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'etl - benchmark'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;wait:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-69" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-69" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-69"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-70" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-70" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-70"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-71" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-71" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-71"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-72" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-72" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-72"&gt;&lt;/a&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-73" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-73" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-73"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-74" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-74" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-74"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;always&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-75" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-75" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-75"&gt;&lt;/a&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="o"&gt;([&lt;/span&gt;&lt;span class="n"&gt;$class&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'Mailer'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-76" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-76" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-76"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="nl"&gt;notifyEveryUnstableBuild:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-77" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-77" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-77"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="nl"&gt;recipients:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"baptiste.wicht@gmail.com"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-78" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-78" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-78"&gt;&lt;/a&gt;&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="nl"&gt;sendToIndividuals:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-79" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-79" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-79"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-80" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-80" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-80"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;a id="rest_code_2b9f82b278df4b9683d6b62e7548f533-81" name="rest_code_2b9f82b278df4b9683d6b62e7548f533-81" href="https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html#rest_code_2b9f82b278df4b9683d6b62e7548f533-81"&gt;&lt;/a&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There is nothing really fancy about, it's probably average. Moreover, since I'm
not an expert on pipelines and I've just discovered declarative pipelines, it
may not be optimal, but it works. As you'll see there are some problems
I haven't been able to fix.&lt;/p&gt;
&lt;p&gt;The first part declares the environment variables for the build. Then, the
multiple build stages are listed. The first stage checkout the code from the
SCM. This ugly piece of code is here to allow to checkout the submodules. It is
the only solution I have found so far. It's very ugly but it works. The second
steps is simply some basic static analysis. The next step is the classical build
step. Then, the tests are run. In that case, I'm using a script because the
tests are compiled with several different sets of options and it was much easier
to put that in a script that in the Pipeline. Moreover, that also means I can
run them standalone. The variables in the line to run the script is another
problem I haven't been able to fix so far. If I declare these variables in an
environment block, they are not passed to the script for some reason, so I had
to use this ugly line. The next two blocks are for Sonar analysis. If you start
with Sonar, you can simply the second block that passed the branch information
to Sonar. Unfortunately, Sonar is very limited in terms of Git branches. Each
branch is considered as another totally different project. That means the false
positives defined in the master branch will not be used in the second branch.
Therefore, I kept a clean master and several different projects for the other
branches. Once Sonar improves this branch handling stuff, if they ever do, I'll
be able to get rid of one of these conditional stages. The last stage is simple
running the benchmark job. Finally, the post block is using the Mailer plugin to
send failed builds information. Again, there is a problem here since this does
not send "Back to normal" information as it used to do before. I've asked this
question on StackOverflow, but haven't received an answer so far. I'll post
a better solution on this blog once I have one. If any of you have some
solutions to these problems, don't hesitate to post in the comments below or to
contact me on Github.&lt;/p&gt;
&lt;p&gt;Here it is. I really think Jenkins is getting even greater now with all this
cool stuff and I advice you to try it out!&lt;/p&gt;</description><category>Continuous Integration</category><category>Jenkins</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2017/06/jenkins-declarative-pipeline-and-awesome-github-integration.html</guid><pubDate>Sun, 04 Jun 2017 18:52:10 GMT</pubDate></item><item><title>Migrated from owncloud 5 to Nextcloud 11</title><link>https://baptiste-wicht.com/posts/2017/03/migrated-from-owncloud-5-to-nextcloud-11.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;For several years now I've been using Owncloud running on one of my servers.
I'm using simply using as a simple synchronization, I don't use any of the tons
of fancy features they keep adding. Except from several synchronization issues,
I haven't had too much issues with it.&lt;/p&gt;
&lt;p&gt;However, I have had a very bad time with updates of Owncloud. The last time
I tried, already long ago, was to upgrade from 5.0 to 6.0 and I never succeeded
without losing all the configuration and having to do the resync. Therefore,
I've still an Owncloud 5.0 running. From this time, I had to say that I've been
lazy and didn't try again to upgrade it. Recently, I've received several mails
indicating that this is a security threat.&lt;/p&gt;
&lt;p&gt;Since I was not satisfied with updates in Owncloud and its security has been
challenged recently, I figured it would be a good moment to upgrade to Nextcloud
which is a very active fork of Owncloud that was forked by developers of
Owncloud.&lt;/p&gt;
&lt;p&gt;I haven't even tried to do an upgrade from such an old version to the last
version of Nextcloud, it was doomed to fail. Therefore, I made a new clean
installation. Since I only use the sync feature of the tool, it does not really
matter, it is just some time lost to sync everything again, but nothing too bad.&lt;/p&gt;
&lt;p&gt;I configured a new PostgreSQL on one of my servers for the new database and then
installed Nextcloud 11 on Gentoo. It's a bit a pain to have a working Nginx
configuration for Nextcloud, I don't advice to do it by hand, better take one
from the official documentation, you'll also gain some security. One very bad
thing in the installation process is that you cannot choose the database prefix,
it's set like Owncloud. The problem with that is that you cannot install both
Owncloud and Nextcloud on the same database which would be more practical for
testing purpose. It's a bit retarded in my opinion, but not a big problem in the
end. Other than these two points, everything went well and it was installation
pretty nicely. Then, you should have your user ready to go.&lt;/p&gt;
&lt;img alt="Nextcloud view" class="align-center" src="https://baptiste-wicht.com/images/nextcloud.png"&gt;
&lt;p&gt;As for the interface, I don't think there is a lot to tell here. Most of it is
what you would except from this kind of tool. Moreover, I very rarely use the
web interface or any of the feature that are not the sync feature. One thing
that is pretty cool I think is the monitoring graphs in the Admin section of the
interface. You can the number of users connected, the memory used and the CPU
load. It's pretty useful if you share your Nextcloud between a lot of different
users.&lt;/p&gt;
&lt;p&gt;I didn't have any issue with the sync either. I used the nextcloud-client
package on Gentoo directly and it worked perfectly directly. It took about 10
minutes to sync everything again (about 5GB). I'll have to do the same thing on
my other computer as well, but I don't think I'll have any issue.&lt;/p&gt;
&lt;p&gt;So far, I cannot say that this is better than Owncloud, I just hope the next
upgrade will fare better than they did on Owncloud. Moreover, I also hope that
the security that they promise is really here and I won't have any problem with
it. I'll see in the future!&lt;/p&gt;
&lt;p&gt;For more information about nextcloud and owncloud compared to each other, you
can read &lt;a class="reference external" href="https://civihosting.com/blog/nextcloud-vs-owncloud/"&gt;this in-depth comparison&lt;/a&gt;, by David Feldman.&lt;/p&gt;</description><category>Gentoo</category><category>Linux</category><category>Server</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2017/03/migrated-from-owncloud-5-to-nextcloud-11.html</guid><pubDate>Fri, 03 Mar 2017 08:08:58 GMT</pubDate></item><item><title>PVS-Studio on C++ Library Review</title><link>https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;PVS-Studio is a commercial static analyzer for C, C++ and C#. It works in both
Windows and Linux.&lt;/p&gt;
&lt;p&gt;It has been a long time since I wanted to test it on my projects. I contacted
The PVS-Studio team and they gave me a temporary license so that I can test the
tool and make a review.&lt;/p&gt;
&lt;p&gt;I tried the static analyzer on my Expression Templates Library (ETL) project.
This is a heavily-templated C++ library. I tried it on Linux of course.&lt;/p&gt;
&lt;section id="usage"&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;The installation is very simple, simply untar an archive and put the executables
in your PATH (or use absolute paths). There are also some deb and rpm packages
for some distributions. You need strace to make the analyzer work, it should be
available on any Linux platform.&lt;/p&gt;
&lt;p&gt;The usage of PVS-Studio on Linux should be straightforward. First, you can use the
analyzer directly with make and it will detect the invocations of the compiler.
For instance, here is the command I used for ETL:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_c4b243e018ec4ded8e2f006909d4af83-1" name="rest_code_c4b243e018ec4ded8e2f006909d4af83-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_c4b243e018ec4ded8e2f006909d4af83-1"&gt;&lt;/a&gt;pvs-studio-analyzer trace -- make -j5 debug/bin/etl_test
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that you can use several threads without issues, which is really great.
There does not seem to be any slowdown at this stage, probably only collecting
compiler arguments.&lt;/p&gt;
&lt;p&gt;This first step creates a strace_out file that will be used by the next stage.&lt;/p&gt;
&lt;p&gt;Once, the compilation has been analyzed, you can generate the results with the
analyze function, for which you'll need a license. Here is what I did:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_e9956812b49e4eb7aa0550c95afdc43f-1" name="rest_code_e9956812b49e4eb7aa0550c95afdc43f-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_e9956812b49e4eb7aa0550c95afdc43f-1"&gt;&lt;/a&gt;pvs-studio-analyzer analyze -l ~/pvs_studio/PVS-Studio.lic -j5
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Unfortunately, this didn't work for me:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_6fc1e7856ad1493fa61c370937a54e9a-1" name="rest_code_6fc1e7856ad1493fa61c370937a54e9a-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6fc1e7856ad1493fa61c370937a54e9a-1"&gt;&lt;/a&gt;No compilation units found
&lt;a id="rest_code_6fc1e7856ad1493fa61c370937a54e9a-2" name="rest_code_6fc1e7856ad1493fa61c370937a54e9a-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6fc1e7856ad1493fa61c370937a54e9a-2"&gt;&lt;/a&gt;Analysis finished in 0:00:00.00
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Apparently, it's not able to use the strace_out it generated itself...&lt;/p&gt;
&lt;p&gt;Another possibility is to use the compilation database from clang to use
PVS-Studio. So I generated my compile_commands.json file again (it was not up to
date...) with &lt;a class="reference external" href="https://github.com/rizsotto/Bear"&gt;Bear&lt;/a&gt;. And then, you only
need to run the analyze step:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_5d9682c93dba436c9a36e363c76386f1-1" name="rest_code_5d9682c93dba436c9a36e363c76386f1-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_5d9682c93dba436c9a36e363c76386f1-1"&gt;&lt;/a&gt;pvs-studio-analyzer analyze -l ~/pvs_studio/PVS-Studio.lic -j5
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Make sure you have the same compiler configured than the one used to generate
the compilation database to avoid errors with compiler arguments.&lt;/p&gt;
&lt;p&gt;Unfortunately, this just printed a load of crap on my console:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-1" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-1"&gt;&lt;/a&gt;(L8Pu(]-'Lo8h&amp;gt;uo(_uv(uo2(-&amp;gt;'2h_u(uo2(uvU2K h&amp;gt;'o8a=}Lkk;x[G^%cuaa8acr[VS%
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-2" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-2"&gt;&lt;/a&gt;$ckUaoc8 c'8&amp;gt;_-o-8&amp;gt;U2cu/kau==-8&amp;gt;c-=cU2]Uf=c U2=u%c&amp;amp;kU__-&amp;gt;j}c@uvu2%cJ
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-3" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-3"&gt;&lt;/a&gt;(L8Pu(]-'Lo8h&amp;gt;uo(_uv(uo2(-&amp;gt;'2h_u(uo2(uvU2K h&amp;gt;'o8a=}Lkk;JVJ^%cuaa8acr[VS%
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-4" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-4" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-4"&gt;&lt;/a&gt;$ckUaoc8 c'8&amp;gt;_-o-8&amp;gt;U2cu/kau==-8&amp;gt;c-=cU2]Uf=c U2=u%c&amp;amp;kU__-&amp;gt;j}c@uvu2%cJ
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-5" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-5" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-5"&gt;&lt;/a&gt;(L8Pu(]-'Lo8h&amp;gt;uo(_uv(uo2(-&amp;gt;'2h_u(uo2(uvU2K h&amp;gt;'o8a=}Lkk;*[G^%cuaa8acr[VS%
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-6" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-6" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-6"&gt;&lt;/a&gt;$ckUaoc8 c'8&amp;gt;_-o-8&amp;gt;U2cu/kau==-8&amp;gt;c-=cU2]Uf=c U2=u%c&amp;amp;kU__-&amp;gt;j}c@uvu2%cJ
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-7" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-7" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-7"&gt;&lt;/a&gt;(L8Pu(]-'Lo8h&amp;gt;uo(_uv(uo2(-&amp;gt;'2h_u(uo2(uvU2K h&amp;gt;'o8a=}Lkk;b[b^%cuaa8acr[VS%
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-8" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-8" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-8"&gt;&lt;/a&gt;$ckUaoc8 c'8&amp;gt;_-o-8&amp;gt;U2cu/kau==-8&amp;gt;c-=cU2]Uf=c U2=u%c&amp;amp;kU__-&amp;gt;j}c@uvu2%cJ
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-9" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-9" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-9"&gt;&lt;/a&gt;(L8Pu(]-'Lo8h&amp;gt;uo(_uv(uo2(-&amp;gt;'2h_u(uo2(uvU2K h&amp;gt;'o8a=}Lkk;[[x^%cuaa8acr[VS%
&lt;a id="rest_code_6cbc1a71b01b430da6c01042d41dd278-10" name="rest_code_6cbc1a71b01b430da6c01042d41dd278-10" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6cbc1a71b01b430da6c01042d41dd278-10"&gt;&lt;/a&gt;$ckUaoc8 c'8&amp;gt;_-o-8&amp;gt;U2cu/kau==-8&amp;gt;c-=cU2]Uf=c U2=u%c&amp;amp;kU__-&amp;gt;j}c@uvu2%cJ
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Pretty nice, isn't it ?&lt;/p&gt;
&lt;p&gt;Let's try again in a file:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_b53f644bca85422f87d6e2476153dc7b-1" name="rest_code_b53f644bca85422f87d6e2476153dc7b-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_b53f644bca85422f87d6e2476153dc7b-1"&gt;&lt;/a&gt;pvs-studio-analyzer analyze -o results.log -l ~/pvs_studio/PVS-Studio.lic -j5
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The time is quite reasonable for the analysis, it took much less time than the
compilation time. In total, it took 88 seconds to analyze all the files. It's
much faster than the clang static analyzer.&lt;/p&gt;
&lt;p&gt;This time it worked, but the log file is not readable, you need to convert it
again:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_181f747017c643e9b85332a9d279af5b-1" name="rest_code_181f747017c643e9b85332a9d279af5b-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_181f747017c643e9b85332a9d279af5b-1"&gt;&lt;/a&gt;plog-converter -t errorfile -o errors results.log
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And finally, you can read the results of the analysis in the errors file.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="results"&gt;
&lt;h2&gt;Results&lt;/h2&gt;
&lt;p&gt;Overall, PVS-Studio found 236 messages in the ETL library, I was expecting more.
I also wish there was an HTML report that include the source code as well as the
error message. I had to lookup at the code for each message (you could integrate
it in vim and then use the quickfix window to do that). There are some
visualization but in things like QtCreator or LibreOffice which I don't have nor
want on my computer.&lt;/p&gt;
&lt;p&gt;Let's look at the results. For each message, I'll include the message from
PVS-Studio and the code if it's relevant.&lt;/p&gt;
&lt;p&gt;The first is about using the comma:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_564d384d49374dafa9fd5386f888750f-1" name="rest_code_564d384d49374dafa9fd5386f888750f-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_564d384d49374dafa9fd5386f888750f-1"&gt;&lt;/a&gt;include/etl/traits.hpp:674:1: error: V521 Such expressions using the ',' operator are dangerous. Make sure the expression is correct.
&lt;a id="rest_code_564d384d49374dafa9fd5386f888750f-2" name="rest_code_564d384d49374dafa9fd5386f888750f-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_564d384d49374dafa9fd5386f888750f-2"&gt;&lt;/a&gt;include/etl/traits.hpp:674:1: error: V685 Consider inspecting the return statement. The expression contains a comma.
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_22483ac9c957489d99db788a72a2a81d-1" name="rest_code_22483ac9c957489d99db788a72a2a81d-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_22483ac9c957489d99db788a72a2a81d-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;typename&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_22483ac9c957489d99db788a72a2a81d-2" name="rest_code_22483ac9c957489d99db788a72a2a81d-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_22483ac9c957489d99db788a72a2a81d-2"&gt;&lt;/a&gt;&lt;span class="k"&gt;constexpr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dimensions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;noexcept&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_22483ac9c957489d99db788a72a2a81d-3" name="rest_code_22483ac9c957489d99db788a72a2a81d-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_22483ac9c957489d99db788a72a2a81d-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;etl_traits&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="n"&gt;dimensions&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;a id="rest_code_22483ac9c957489d99db788a72a2a81d-4" name="rest_code_22483ac9c957489d99db788a72a2a81d-4" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_22483ac9c957489d99db788a72a2a81d-4"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here I'm simply using the comma operand to ignore expr to avoid a warning. To
make this compile in C++11, you need to do it in one line otherwise it's not
a constexpr function. It's probably not perfect to use this construct, but there
is no problem here.&lt;/p&gt;
&lt;p&gt;There is a bunch of these, let's filter them, it remains 207 warnings. Let's
jump to the next one:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_b820ca523e044d0b9c348e1ba7f8a58f-1" name="rest_code_b820ca523e044d0b9c348e1ba7f8a58f-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_b820ca523e044d0b9c348e1ba7f8a58f-1"&gt;&lt;/a&gt;include/etl/impl/blas/fft.hpp:29:1: error: V501 There are identical sub-expressions to the left and to the right of the '==' operator: (DFTI_SINGLE) == DFTI_SINGLE
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-1" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-1"&gt;&lt;/a&gt;&lt;span class="kr"&gt;inline&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;fft_kernel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;complex&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;complex&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-2" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;DFTI_DESCRIPTOR_HANDLE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-3" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-3"&gt;&lt;/a&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-4" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-4" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;in_ptr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;const_cast&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;static_cast&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-5" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-5" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-5"&gt;&lt;/a&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-6" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-6" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-6"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;DftiCreateDescriptor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DFTI_SINGLE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DFTI_COMPLEX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;//Specify size and precision&lt;/span&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-7" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-7" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;DftiSetValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DFTI_PLACEMENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DFTI_NOT_INPLACE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;         &lt;/span&gt;&lt;span class="c1"&gt;//Out of place FFT&lt;/span&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-8" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-8" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-8"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;DftiCommitDescriptor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;                                   &lt;/span&gt;&lt;span class="c1"&gt;//Finalize the descriptor&lt;/span&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-9" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-9" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-9"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;DftiComputeForward&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;in_ptr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;                        &lt;/span&gt;&lt;span class="c1"&gt;//Compute the Forward FFT&lt;/span&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-10" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-10" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-10"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;DftiFreeDescriptor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;                                    &lt;/span&gt;&lt;span class="c1"&gt;//Free the descriptor&lt;/span&gt;
&lt;a id="rest_code_cd2d987def7540ed8aca1d9434fc2d78-11" name="rest_code_cd2d987def7540ed8aca1d9434fc2d78-11" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_cd2d987def7540ed8aca1d9434fc2d78-11"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Unfortunately, the error is inside the MKL library. Here, I really don't think
it's an issue. There is pack of them. I forgot to exclude non-ETL code from the
results. Once filter from all dependencies, 137 messages remain.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_afc158d70f8e45f681a35fdcd996ab0d-1" name="rest_code_afc158d70f8e45f681a35fdcd996ab0d-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_afc158d70f8e45f681a35fdcd996ab0d-1"&gt;&lt;/a&gt;include/etl/eval_functors.hpp:157:1: warning: V560 A part of conditional expression is always false: !padding.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is true, but not an issue since padding is a configuration constant that
enables the use of padding in vector and matrices. There was 27 of these at
different locations and with different configuration variables.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_c1b5d17cd2df47c79136bf52a6f1f0cf-1" name="rest_code_c1b5d17cd2df47c79136bf52a6f1f0cf-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_c1b5d17cd2df47c79136bf52a6f1f0cf-1"&gt;&lt;/a&gt;include/etl/op/sub_view.hpp:161:1: note: V688 The 'i' function argument possesses the same name as one of the class members, which can result in a confusion.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is again true, but not a bug in this particular case. It is still helpful and
I ended up changing these to avoid confusion. Again, there was a few of these.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_349de7aa590f4def902f72338d7b9da5-1" name="rest_code_349de7aa590f4def902f72338d7b9da5-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_349de7aa590f4def902f72338d7b9da5-1"&gt;&lt;/a&gt;etl/test/src/conv_multi_multi.cpp:23:1: error: V573 Uninitialized variable 'k' was used. The variable was used to initialize itself.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This one is in the test code:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-1" name="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_43ebf8e281b84c778f18fb38a7bd4dab-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;dim&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-2" name="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_43ebf8e281b84c778f18fb38a7bd4dab-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;dim&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;I&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-3" name="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_43ebf8e281b84c778f18fb38a7bd4dab-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;C_ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;conv_2d_valid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;I&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// HERE&lt;/span&gt;
&lt;a id="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-4" name="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-4" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_43ebf8e281b84c778f18fb38a7bd4dab-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-5" name="rest_code_43ebf8e281b84c778f18fb38a7bd4dab-5" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_43ebf8e281b84c778f18fb38a7bd4dab-5"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I don't see any error, k is initialized correctly to zero in the first loop.
This is a &lt;strong&gt;false positive&lt;/strong&gt; for me. There were several of these in different
places. It seems to that the use of the operator() is confusing for PVS-Studio.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_91ffbd08150b4bc39470ba079936c4e0-1" name="rest_code_91ffbd08150b4bc39470ba079936c4e0-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_91ffbd08150b4bc39470ba079936c4e0-1"&gt;&lt;/a&gt;include/etl/traits.hpp:703:1: note: V659 Declarations of functions with 'rows' name differ in the 'const' keyword only, but the bodies of these functions have different composition. This is suspicious and can possibly be an error. Check lines: 693, 703.
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-1" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;typename&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;E&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cpp_disable_if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decay_traits&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="n"&gt;is_fast&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-2" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-2"&gt;&lt;/a&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;//693&lt;/span&gt;
&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-3" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;etl_traits&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="n"&gt;dim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-4" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-4" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-4"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-5" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-5" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-5"&gt;&lt;/a&gt;
&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-6" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-6" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-6"&gt;&lt;/a&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;typename&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;E&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cpp_enable_if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decay_traits&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="n"&gt;is_fast&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-7" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-7" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-7"&gt;&lt;/a&gt;&lt;span class="k"&gt;constexpr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;noexcept&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;//703&lt;/span&gt;
&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-8" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-8" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-8"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;etl_traits&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;E&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dim&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;a id="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-9" name="rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-9" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_6be8dec82dd24d68b5a56a29b3eda6cf-9"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Unfortunately, this is again a &lt;strong&gt;false positive&lt;/strong&gt; because PVS-Studio failed to
recognized SFINAE and therefore the warning is wrong.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_e79ad9d904d04c51a7b0126ecd221ecf-1" name="rest_code_e79ad9d904d04c51a7b0126ecd221ecf-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_e79ad9d904d04c51a7b0126ecd221ecf-1"&gt;&lt;/a&gt;include/etl/builder/expression_builder.hpp:345:1: note: V524 It is odd that the body of '&amp;gt;&amp;gt;=' function is fully equivalent to the body of '*=' function.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This one is interesting indeed. It is true that they are exactly because in ETL
&amp;gt;&amp;gt; is used for scalar element-wise multiplication. This is quite interesting that
PVS-Studio points that out. There was a few of these oddities but all were
normal in the library.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_20be4f7f69d948ea9f507be2f4fb9c6c-1" name="rest_code_20be4f7f69d948ea9f507be2f4fb9c6c-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_20be4f7f69d948ea9f507be2f4fb9c6c-1"&gt;&lt;/a&gt;etl/test/src/compare.cpp:23:1: error: V501 There are identical sub-expressions to the left and to the right of the '!=' operator: a != a
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Again, it is nice that PVS-Studio finds that, but this is done on purpose on the
tests to compare an object to itself. If I remove all the oddities in the test
cases, there are only 17 left in the headers. None of the warnings on the test
case was serious, but there was no more false positives either, so that's great.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_5cb0db96470a40179fc5c5aef50077a6-1" name="rest_code_5cb0db96470a40179fc5c5aef50077a6-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_5cb0db96470a40179fc5c5aef50077a6-1"&gt;&lt;/a&gt;include/etl/impl/vec/sum.hpp:92:1: error: V591 Non-void function should return a value.
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_f292438cfc4046e184c954919bbbc22e-1" name="rest_code_f292438cfc4046e184c954919bbbc22e-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_f292438cfc4046e184c954919bbbc22e-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;typename&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;L&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cpp_disable_if&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;vec_enabled&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;all_vectorizable&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;vector_mode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_f292438cfc4046e184c954919bbbc22e-2" name="rest_code_f292438cfc4046e184c954919bbbc22e-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_f292438cfc4046e184c954919bbbc22e-2"&gt;&lt;/a&gt;&lt;span class="n"&gt;value_t&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;L&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;lhs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_f292438cfc4046e184c954919bbbc22e-3" name="rest_code_f292438cfc4046e184c954919bbbc22e-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_f292438cfc4046e184c954919bbbc22e-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;cpp_unused&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lhs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_f292438cfc4046e184c954919bbbc22e-4" name="rest_code_f292438cfc4046e184c954919bbbc22e-4" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_f292438cfc4046e184c954919bbbc22e-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;cpp_unused&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_f292438cfc4046e184c954919bbbc22e-5" name="rest_code_f292438cfc4046e184c954919bbbc22e-5" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_f292438cfc4046e184c954919bbbc22e-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;cpp_unused&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_f292438cfc4046e184c954919bbbc22e-6" name="rest_code_f292438cfc4046e184c954919bbbc22e-6" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_f292438cfc4046e184c954919bbbc22e-6"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;cpp_unreachable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"vec::sum called with invalid parameters"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_f292438cfc4046e184c954919bbbc22e-7" name="rest_code_f292438cfc4046e184c954919bbbc22e-7" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_f292438cfc4046e184c954919bbbc22e-7"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This one is interesting. It's not a false positive since indeed the function
does not return a value, but there is a __builtin_unreachable() inside the
function and it cannot be called. In my opinion, the static analyzer should be
able to handle that, but this is really a corner case.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_291688ccfb4e43e4b6ee948ca076facb-1" name="rest_code_291688ccfb4e43e4b6ee948ca076facb-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_291688ccfb4e43e4b6ee948ca076facb-1"&gt;&lt;/a&gt;include/etl/sparse.hpp:148:1: note: V550 An odd precise comparison: a == 0.0. It's probably better to use a comparison with defined precision: fabs(A - B) &amp;lt; Epsilon.
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_20f4ac746b2a4a5799718b3218472f35-1" name="rest_code_20f4ac746b2a4a5799718b3218472f35-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_20f4ac746b2a4a5799718b3218472f35-1"&gt;&lt;/a&gt;&lt;span class="kr"&gt;inline&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;is_zero&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_20f4ac746b2a4a5799718b3218472f35-2" name="rest_code_20f4ac746b2a4a5799718b3218472f35-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_20f4ac746b2a4a5799718b3218472f35-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_20f4ac746b2a4a5799718b3218472f35-3" name="rest_code_20f4ac746b2a4a5799718b3218472f35-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_20f4ac746b2a4a5799718b3218472f35-3"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is not false, but again this is intended because of the comparison to zero
for a sparse matrix. There were 10 of these in the same class.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_05e5aa5aa0e9466cad26068326e5be47-1" name="rest_code_05e5aa5aa0e9466cad26068326e5be47-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_05e5aa5aa0e9466cad26068326e5be47-1"&gt;&lt;/a&gt;include/etl/impl/blas/fft.hpp:562:1: note: V656 Variables 'a_padded', 'b_padded' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'etl::size(c)' expression. Check lines: 561, 562.
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_230b942ed0a14f4dab2fd6ea26243ebb-1" name="rest_code_230b942ed0a14f4dab2fd6ea26243ebb-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_230b942ed0a14f4dab2fd6ea26243ebb-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;dyn_vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;complex&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a_padded&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;a id="rest_code_230b942ed0a14f4dab2fd6ea26243ebb-2" name="rest_code_230b942ed0a14f4dab2fd6ea26243ebb-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_230b942ed0a14f4dab2fd6ea26243ebb-2"&gt;&lt;/a&gt;&lt;span class="n"&gt;dyn_vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;complex&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b_padded&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It's indeed constructed with the same size, but for me I don't think it's an
odd pattern. I would not consider that as a warning, especially since it's
a constructor and not a assignment.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_fa3a21a3b9e9481e90963483556182a4-1" name="rest_code_fa3a21a3b9e9481e90963483556182a4-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_fa3a21a3b9e9481e90963483556182a4-1"&gt;&lt;/a&gt;include/etl/dyn_base.hpp:312:1: warning: V690 The 'dense_dyn_base' class implements a copy constructor, but lacks the '=' operator. It is dangerous to use such a class.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is again a kind of corner case in the library because it's a base class
and the assignment is different between the sub classes and not a real
assignment in the C++ sense.&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_9690f453e27244c29768c1de8e91ce93-1" name="rest_code_9690f453e27244c29768c1de8e91ce93-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_9690f453e27244c29768c1de8e91ce93-1"&gt;&lt;/a&gt;include/etl/impl/reduc/conv_multi.hpp:657:1: warning: V711 It is dangerous to create a local variable within a loop with a same name as a variable controlling this loop.
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_7c9b733c0e71408db82a9a78755a8ad2-1" name="rest_code_7c9b733c0e71408db82a9a78755a8ad2-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_7c9b733c0e71408db82a9a78755a8ad2-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_7c9b733c0e71408db82a9a78755a8ad2-2" name="rest_code_7c9b733c0e71408db82a9a78755a8ad2-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_7c9b733c0e71408db82a9a78755a8ad2-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;K&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_7c9b733c0e71408db82a9a78755a8ad2-3" name="rest_code_7c9b733c0e71408db82a9a78755a8ad2-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_7c9b733c0e71408db82a9a78755a8ad2-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;conv_temp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_7c9b733c0e71408db82a9a78755a8ad2-4" name="rest_code_7c9b733c0e71408db82a9a78755a8ad2-4" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_7c9b733c0e71408db82a9a78755a8ad2-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_7c9b733c0e71408db82a9a78755a8ad2-5" name="rest_code_7c9b733c0e71408db82a9a78755a8ad2-5" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_7c9b733c0e71408db82a9a78755a8ad2-5"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is again a false positive... It really seems that PVS-Studio is not able to
handle the operator().&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_102c84e1759245239b059a01a3f94459-1" name="rest_code_102c84e1759245239b059a01a3f94459-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_102c84e1759245239b059a01a3f94459-1"&gt;&lt;/a&gt;include/etl/impl/pooling.hpp:396:1: error: V501 There are identical sub-expressions to the left and to the right of the '||' operator: P1 || P2 || P1
&lt;/pre&gt;&lt;/div&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_9c431a47b96c4263adf055fd49888e30-1" name="rest_code_9c431a47b96c4263adf055fd49888e30-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_9c431a47b96c4263adf055fd49888e30-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;C1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;C2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;C3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;S1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;S2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;S3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;typename&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;A&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;typename&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;M&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_9c431a47b96c4263adf055fd49888e30-2" name="rest_code_9c431a47b96c4263adf055fd49888e30-2" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_9c431a47b96c4263adf055fd49888e30-2"&gt;&lt;/a&gt;&lt;span class="k"&gt;static&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;apply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;M&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_9c431a47b96c4263adf055fd49888e30-3" name="rest_code_9c431a47b96c4263adf055fd49888e30-3" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_9c431a47b96c4263adf055fd49888e30-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;o1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;dim&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;C1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;S1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_9c431a47b96c4263adf055fd49888e30-4" name="rest_code_9c431a47b96c4263adf055fd49888e30-4" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_9c431a47b96c4263adf055fd49888e30-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;o2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;dim&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;C2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;S2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_9c431a47b96c4263adf055fd49888e30-5" name="rest_code_9c431a47b96c4263adf055fd49888e30-5" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_9c431a47b96c4263adf055fd49888e30-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;o3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;dim&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;C3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;S3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_9c431a47b96c4263adf055fd49888e30-6" name="rest_code_9c431a47b96c4263adf055fd49888e30-6" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_9c431a47b96c4263adf055fd49888e30-6"&gt;&lt;/a&gt;
&lt;a id="rest_code_9c431a47b96c4263adf055fd49888e30-7" name="rest_code_9c431a47b96c4263adf055fd49888e30-7" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_9c431a47b96c4263adf055fd49888e30-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;P1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P1&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Last but not least, this time, it's entirely true and it's in fact a bug in my
code! The condition should be written like this:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_0df036f3572f4094afe7819ef1a57b9a-1" name="rest_code_0df036f3572f4094afe7819ef1a57b9a-1" href="https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html#rest_code_0df036f3572f4094afe7819ef1a57b9a-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;P1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;||&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;P3&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is now fixed in the master of ETL.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="conclusion"&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The installation was pretty easy, but the usage was not as easy as it could
because the first method by analyzing the build system did not work.
Fortunately, the system supports using the Clang compilation database directly
and therefore it was possible to use.&lt;/p&gt;
&lt;p&gt;Overall, it found 236 warnings on my code base (heavily templated library).
Around 50 of them were in some of the extend libraries, but I forgot to filter
them out. The quality of the results is pretty good in my opinion. It was able
to &lt;strong&gt;find a bug&lt;/strong&gt; in my implementation of pooling with padding. Unfortunately,
there was quite a few false positives, due to SFINAE, bad handling of the
operator() and no handling of __builtin_unreachable. The remaining were all
correct, but were not bug considering their usages.&lt;/p&gt;
&lt;p&gt;To conclude, I think it's a great static analyzer that is really fast compared
to other one in the market. There are a few false positives, but it's really not
bad compared to other tools and some of the messages are really great. An HTML
report including the source code would be great as well.&lt;/p&gt;
&lt;p&gt;If you want more information, you can consult
&lt;a class="reference external" href="http://www.viva64.com/en/pvs-studio/"&gt;the official site&lt;/a&gt;. There is even a way
to use it on open-source code for free, but you have to add comments on top of
each of your files.&lt;/p&gt;
&lt;p&gt;I hope it was helpful ;)&lt;/p&gt;
&lt;/section&gt;</description><category>C++</category><category>C++11</category><category>C++14</category><category>Review</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2016/12/pvs-studio-on-cpp-library-review.html</guid><pubDate>Tue, 20 Dec 2016 08:40:12 GMT</pubDate></item><item><title>Short review of Bullseye Coverage</title><link>https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;&lt;a class="reference external" href="http://www.bullseye.com/"&gt;Bullseye&lt;/a&gt; is a commercial Code Coverage analyzer.
It is fully-featured with an export to HTML, to XML and even a specific GUI to
see the application.It costs about 800$, with a renewal fee of about 200$ per
year.&lt;/p&gt;
&lt;p&gt;I'm currently using gcov and passing the results to Sonar. This works well, but
there are several problems. First, I need to use gcovr to generate the XML file,
that means two tools. Then, gcov has no way to merge coverage reports. In my
tests of ETL, I have seven different profiles being tested and I need the
overall coverage report. lcov has a merge feature but it is slow as hell (it
takes longer to merge the coverage files than to compile and run the complete
test suite seven times...). For now, I'm using a C++ program that I wrote to
combine the XML files or a Python script that does that, but neither are perfect
and it needs maintenance. Finally, it's impossible to exclude some code from the
coverage report (there is code that isn't meant to be executed (exceptional
code)). For now, I'm using yet another C++ program  that I wrote to do this from
comments in code.&lt;/p&gt;
&lt;p&gt;Bullseye does have all these feature, so I got an evaluation license online and
tried this tool and wrote a short review of it.&lt;/p&gt;
&lt;section id="usage"&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;The usage is pretty simple. You put the coverage executables in your PATH
variable and activate coverage globally. Then, we you compile, the compiler
calls will be intercepted and a coverage file will be generated. When the
compilation is done, run the program and the coverage measurements will be
filled.&lt;/p&gt;
&lt;p&gt;The coverage results can then be exported to HTML (or XML) or visualized using
the CoverageBrowser tool:&lt;/p&gt;
&lt;figure class="align-center"&gt;
&lt;img alt="Screenshot of Bullseye main coverage view" src="https://baptiste-wicht.com/images/bullseye_view.png"&gt;
&lt;figcaption&gt;
&lt;p&gt;The main view of the Bullseye tool code coverage results&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;It's a pretty good view of the coverage result. You have a breakdown by folders,
by file, by function and finally by condition. You can view directly the source
code:&lt;/p&gt;
&lt;figure class="align-center"&gt;
&lt;img alt="Screenshot of Bullseye source code coverage view" src="https://baptiste-wicht.com/images/bullseye_source_view.png"&gt;
&lt;figcaption&gt;
&lt;p&gt;The source view of the Bullseye tool code coverage results&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;If you want to exclude some code from your coverage reports, you can use
a pragma:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_cfc7914ef69543e29dc13127cba4fe37-1" name="rest_code_cfc7914ef69543e29dc13127cba4fe37-1" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_cfc7914ef69543e29dc13127cba4fe37-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_cfc7914ef69543e29dc13127cba4fe37-2" name="rest_code_cfc7914ef69543e29dc13127cba4fe37-2" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_cfc7914ef69543e29dc13127cba4fe37-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;one&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_cfc7914ef69543e29dc13127cba4fe37-3" name="rest_code_cfc7914ef69543e29dc13127cba4fe37-3" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_cfc7914ef69543e29dc13127cba4fe37-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;two&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_cfc7914ef69543e29dc13127cba4fe37-4" name="rest_code_cfc7914ef69543e29dc13127cba4fe37-4" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_cfc7914ef69543e29dc13127cba4fe37-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;three&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_cfc7914ef69543e29dc13127cba4fe37-5" name="rest_code_cfc7914ef69543e29dc13127cba4fe37-5" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_cfc7914ef69543e29dc13127cba4fe37-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="cp"&gt;#pragma BullseyeCoverage off&lt;/span&gt;
&lt;a id="rest_code_cfc7914ef69543e29dc13127cba4fe37-6" name="rest_code_cfc7914ef69543e29dc13127cba4fe37-6" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_cfc7914ef69543e29dc13127cba4fe37-6"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;abort&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;a id="rest_code_cfc7914ef69543e29dc13127cba4fe37-7" name="rest_code_cfc7914ef69543e29dc13127cba4fe37-7" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_cfc7914ef69543e29dc13127cba4fe37-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="cp"&gt;#pragma BullseyeCoverage on&lt;/span&gt;
&lt;a id="rest_code_cfc7914ef69543e29dc13127cba4fe37-8" name="rest_code_cfc7914ef69543e29dc13127cba4fe37-8" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_cfc7914ef69543e29dc13127cba4fe37-8"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So that the condition won't be set as uncovered.&lt;/p&gt;
&lt;p&gt;As for the coverage, it's pretty straightforward. For example:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_2dddc87255e343c28cd66e389abb6e12-1" name="rest_code_2dddc87255e343c28cd66e389abb6e12-1" href="https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html#rest_code_2dddc87255e343c28cd66e389abb6e12-1"&gt;&lt;/a&gt;covmerge&lt;span class="w"&gt; &lt;/span&gt;-c&lt;span class="w"&gt; &lt;/span&gt;-ffinal.cov&lt;span class="w"&gt; &lt;/span&gt;sse.cov&lt;span class="w"&gt; &lt;/span&gt;avx.cov
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;and it's really fast. Unfortunately, the merging is only done at the function
level, not at the statement or at the condition level. This is a bit
disappointing, especially from a commercial tool. Nevertheless, it works well.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="conclusion"&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;To conclude, Bullseye seems to be a pretty good tool. It has more features than
standard gcov coverage and all features are well integrated together. I have
only covered the features I was interested in, there are plenty of other things
you can look at on the &lt;a class="reference external" href="http://www.bullseye.com/"&gt;official website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However, if you don't need the extra features such as the visualizer (or use
something like Sonar for this), or the merge or code excluding, it's probably
not worth paying the price for it. In my case, since the merge is not better
than my C++ tool (both do almost the same and my tool does some basic line
coverage merging as well) and I don't need the visualizer, I won't pay the price
for it. Moreover, they don't have student or open source licensing, therefore,
I'll continue with my complicated toolchain :)&lt;/p&gt;
&lt;/section&gt;</description><category>C++</category><category>coverage</category><category>test</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2016/09/short-review-of-bullseye-coverage.html</guid><pubDate>Fri, 16 Sep 2016 11:25:44 GMT</pubDate></item><item><title>Use templight and Templar to debug C++ templates</title><link>https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;C++ has some very good tools to debug, profile and analyze source files and executables. This all works well for standard runtime program. But, when you are using templates, you sometimes want these tools to act at compile-time. And at this point the support is much more scarce.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/mikael-s-persson/templight"&gt;templight&lt;/a&gt; and &lt;a class="reference external" href="https://github.com/schulmar/Templar"&gt;Templar&lt;/a&gt; and two tools that are trying to fix this issue.&lt;/p&gt;
&lt;p&gt;From the templight site:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Templight is a Clang-based tool to profile the time and memory consumption of template instantiations and to perform interactive debugging sessions to gain introspection into the template instantiation process.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and Templar is a visualization tool for the traces generated by templight.&lt;/p&gt;
&lt;section id="installation"&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;Unfortunately, the templight installation is not user-friendly at all. You need to clone the complete LLVM/Clang tree and add templight inside it before compiling the complete clang toolchain. But that is the case for all clang-based tools... You also need to patch clang but that may not be necessary in the future. The complete instructions are available &lt;a class="reference external" href="https://github.com/mikael-s-persson/templight#getting-and-compiling-templight"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The installation of Templar is much more convenient:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_7393559845de4e648818bee6e33e54cc-1" name="rest_code_7393559845de4e648818bee6e33e54cc-1" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_7393559845de4e648818bee6e33e54cc-1"&gt;&lt;/a&gt;git&lt;span class="w"&gt; &lt;/span&gt;clone&lt;span class="w"&gt; &lt;/span&gt;https://github.com/schulmar/Templar.git
&lt;a id="rest_code_7393559845de4e648818bee6e33e54cc-2" name="rest_code_7393559845de4e648818bee6e33e54cc-2" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_7393559845de4e648818bee6e33e54cc-2"&gt;&lt;/a&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Templar
&lt;a id="rest_code_7393559845de4e648818bee6e33e54cc-3" name="rest_code_7393559845de4e648818bee6e33e54cc-3" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_7393559845de4e648818bee6e33e54cc-3"&gt;&lt;/a&gt;git&lt;span class="w"&gt; &lt;/span&gt;checkout&lt;span class="w"&gt; &lt;/span&gt;feature/templight2
&lt;a id="rest_code_7393559845de4e648818bee6e33e54cc-4" name="rest_code_7393559845de4e648818bee6e33e54cc-4" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_7393559845de4e648818bee6e33e54cc-4"&gt;&lt;/a&gt;qmake&lt;span class="w"&gt; &lt;/span&gt;.
&lt;a id="rest_code_7393559845de4e648818bee6e33e54cc-5" name="rest_code_7393559845de4e648818bee6e33e54cc-5" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_7393559845de4e648818bee6e33e54cc-5"&gt;&lt;/a&gt;make
&lt;a id="rest_code_7393559845de4e648818bee6e33e54cc-6" name="rest_code_7393559845de4e648818bee6e33e54cc-6" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_7393559845de4e648818bee6e33e54cc-6"&gt;&lt;/a&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;make&lt;span class="w"&gt; &lt;/span&gt;install
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The branch feature/templight2 has much more features than the master and should support both Qt4 and Qt5, but I have only tested it on Qt4.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="example"&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;p&gt;Let's use the class Fibonacci function as an example:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_5a010346476846479dc44bc485d23588-1" name="rest_code_5a010346476846479dc44bc485d23588-1" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-1"&gt;&lt;/a&gt;&lt;span class="cp"&gt;#include&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-2" name="rest_code_5a010346476846479dc44bc485d23588-2" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-2"&gt;&lt;/a&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-3" name="rest_code_5a010346476846479dc44bc485d23588-3" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-3"&gt;&lt;/a&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-4" name="rest_code_5a010346476846479dc44bc485d23588-4" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-4"&gt;&lt;/a&gt;&lt;span class="k"&gt;struct&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;Fibonacci&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-5" name="rest_code_5a010346476846479dc44bc485d23588-5" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;static&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;constexpr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Fibonacci&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Fibonacci&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="mi"&gt;-2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-6" name="rest_code_5a010346476846479dc44bc485d23588-6" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-6"&gt;&lt;/a&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-7" name="rest_code_5a010346476846479dc44bc485d23588-7" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-7"&gt;&lt;/a&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-8" name="rest_code_5a010346476846479dc44bc485d23588-8" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-8"&gt;&lt;/a&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-9" name="rest_code_5a010346476846479dc44bc485d23588-9" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-9"&gt;&lt;/a&gt;&lt;span class="k"&gt;struct&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;Fibonacci&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-10" name="rest_code_5a010346476846479dc44bc485d23588-10" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-10"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;static&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;constexpr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-11" name="rest_code_5a010346476846479dc44bc485d23588-11" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-11"&gt;&lt;/a&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-12" name="rest_code_5a010346476846479dc44bc485d23588-12" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-12"&gt;&lt;/a&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-13" name="rest_code_5a010346476846479dc44bc485d23588-13" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-13"&gt;&lt;/a&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-14" name="rest_code_5a010346476846479dc44bc485d23588-14" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-14"&gt;&lt;/a&gt;&lt;span class="k"&gt;struct&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;Fibonacci&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-15" name="rest_code_5a010346476846479dc44bc485d23588-15" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-15"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;static&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;constexpr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-16" name="rest_code_5a010346476846479dc44bc485d23588-16" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-16"&gt;&lt;/a&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-17" name="rest_code_5a010346476846479dc44bc485d23588-17" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-17"&gt;&lt;/a&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-18" name="rest_code_5a010346476846479dc44bc485d23588-18" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-18"&gt;&lt;/a&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-19" name="rest_code_5a010346476846479dc44bc485d23588-19" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-19"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"Fibonacci&amp;lt;5&amp;gt;:"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Fibonacci&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a id="rest_code_5a010346476846479dc44bc485d23588-20" name="rest_code_5a010346476846479dc44bc485d23588-20" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_5a010346476846479dc44bc485d23588-20"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Nothing fancy here, we're simply printing the fifth Fibonacci number on the console.&lt;/p&gt;
&lt;p&gt;You can compile it with templight++:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code bash"&gt;&lt;a id="rest_code_8351a145074c45e1bdd559b7ebac30ca-1" name="rest_code_8351a145074c45e1bdd559b7ebac30ca-1" href="https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html#rest_code_8351a145074c45e1bdd559b7ebac30ca-1"&gt;&lt;/a&gt;templight++&lt;span class="w"&gt; &lt;/span&gt;-Xtemplight&lt;span class="w"&gt; &lt;/span&gt;-profiler&lt;span class="w"&gt; &lt;/span&gt;-Xtemplight&lt;span class="w"&gt; &lt;/span&gt;-memory&lt;span class="w"&gt; &lt;/span&gt;-Xtemplight&lt;span class="w"&gt; &lt;/span&gt;-ignore-system&lt;span class="w"&gt; &lt;/span&gt;-std&lt;span class="o"&gt;=&lt;/span&gt;c++14&lt;span class="w"&gt; &lt;/span&gt;main.cpp
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;All the templight options starts with -Xtemplight and then you can use any clang++ options. This will generate a &lt;em&gt;a.memory.trace.pbf&lt;/em&gt; file in the current directory. You can then run Templar. use File &amp;gt; Open Trace to open the trace file. This should open a window of this sort:&lt;/p&gt;
&lt;img alt="/images/templar.png" class="align-center" src="https://baptiste-wicht.com/images/templar.png"&gt;
&lt;p&gt;The top-left panel contains the source code of the application, automatically
refreshed whenever you move in the template tree. In the top right, there is
the template instantiation graph. In the bottom left, you'll see a list of list
of files to be able to filter them and in the bottom right, you'll see the list
of templates events. You can sort the list of template events by duration which
is really convenient. You can then select Fibonacci&amp;lt;5&amp;gt; by double clicking it in
the list (once sorted, it should be near the top). This should give you a tree
looking something like that:&lt;/p&gt;
&lt;img alt="/images/templar_tree.png" class="align-center" src="https://baptiste-wicht.com/images/templar_tree.png"&gt;
&lt;p&gt;The edgy nodes are template instantiations and the round nodes are template
memoization. We can directly see that each instantiation was only done once. I
think this graph view is really helpful if you need to debug computation done
at compile time. You can see that that not all nodes are displayed, this is
because there is a limit on the displayed depth. Simply click on Fibonacci&amp;lt;3&amp;gt;
and the remaining nodes will be shown.&lt;/p&gt;
&lt;p&gt;I have already used this tool to find the most time-consuming templates in ETL
an DLL. This is a great tool to indicate where you should focus on improving
the template compile-time. I have also been able to find some unnecessary
instantiations that could be avoided (either with SFINAE or with refactorings).&lt;/p&gt;
&lt;p&gt;templight also contains a fully-fledged debugger for template programs, but I haven't tested it.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="conclusion"&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In conclusion, I would say that templight and Templar are really helping with
template debugging and profiling. There is a real lack of tools in this domain
and I hope to see more tools of this kind in the future. I hope this will help
you develop template-heavy programs or template metaprograms.&lt;/p&gt;
&lt;/section&gt;</description><category>C++</category><category>templates</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html</guid><pubDate>Mon, 08 Feb 2016 07:11:18 GMT</pubDate></item><item><title>Continuous Performance Management with CPM for C++</title><link>https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;For some time, I have wanted some tool to monitor the performance of some of my projects. There are plenty of tools for Continuous Integration and Sonar is really great for continuous monitoring of code quality, but I haven't found anything satisfying for monitoring performance of C++ code. So I decided to write my own. &lt;a class="reference external" href="https://github.com/wichtounet/cpm"&gt;Continous Performance Monitor (CPM)&lt;/a&gt; is a simple C++ tool that helps you running benchmarks for your C++ programs and generate web reports based on the results. In this article, I will present this tool. CPM is especially made to benchmark several sub parts of libraries, but it perfectly be used to benchmark a whole program as well.&lt;/p&gt;
&lt;p&gt;The idea is to couple it with a Continuous Integration tool (I use Jenkins for instance) and run the benchmarks for every new push in a repository. With that, you can check if you have performance regression for instance or simply see if your changes were really improving the performance as much as you thought.&lt;/p&gt;
&lt;p&gt;It is made of two separate parts:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;&lt;p&gt;A header-only library that you can use to benchmark your program and that will give you the performance results. It will also generate a JSON report of the collected data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A program that will generate a web version of the reports with analysis over time, over different compilers or over different configurations.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;CPM is especially made to benchmark functions that takes input data and which runtime depends on the dimensions of the input data. For each benchmark, CPM will execute it with several different input sizes. There are different ways to define a benchmark:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;two_pass&lt;/em&gt;: The benchmark is made of two part, the initialization part is called once for each input size and then the benchmark part is repeated several times for the measure. This is the most general version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;global&lt;/em&gt;: The benchmark will be run with different input sizes but uses global data that will be randomized before each measure&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;simple&lt;/em&gt;: The benchmark will be run with different input sizes, data will not be randomized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;once&lt;/em&gt;: The benchmark will be run with no input size.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note: The randomization of the data can be disabled.&lt;/p&gt;
&lt;p&gt;You can run independent benchmarks or you can run sections of benchmarks. A section is used to compared different implementations of the same thing. For instance, I use them to compare different implementation of convolution or to see how ETL compete with other Expression Templates library.&lt;/p&gt;
&lt;img alt="/images/cpm_large.png" src="https://baptiste-wicht.com/images/cpm_large.png"&gt;
&lt;section id="examples"&gt;
&lt;h2&gt;Examples&lt;/h2&gt;
&lt;p&gt;I've uploaded three generated reports so that you can have look at some results:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Results of the ETL benchmark (one page per benchmark): &lt;a class="reference external" href="http://baptiste-wicht.com/cpm/etl/"&gt;Site 1&lt;/a&gt; &lt;a class="reference external" href="https://github.com/wichtounet/etl/blob/master/workbench/benchmark.cpp"&gt;Source 1&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Results of simple ETL / Blaze / Eigen3 comparison: &lt;a class="reference external" href="http://baptiste-wicht.com/cpm/etl_blaze_eigen/"&gt;Site 2&lt;/a&gt; &lt;a class="reference external" href="https://github.com/wichtounet/etl_vs_blaze/blob/master/src/simple.cpp"&gt;Source 2&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Results of the CPM dummy examples: &lt;a class="reference external" href="http://baptiste-wicht.com/cpm/examples/"&gt;Site 3&lt;/a&gt; &lt;a class="reference external" href="https://github.com/wichtounet/cpm/blob/master/examples/simple.cpp"&gt;Source 3&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;section id="run-benchmarks"&gt;
&lt;h2&gt;Run benchmarks&lt;/h2&gt;
&lt;p&gt;There are two ways of running CPM. You can directly use the library to run the benchmarks or you can use the macro facilities to make it easier. I recommend to use the second way since it is easier and I'm gonna try to keep it stable while the library can change. If you want an example of using the library directly, you can take a look at &lt;a class="reference external" href="https://github.com/wichtounet/cpm/blob/master/examples/simple.cpp"&gt;this example&lt;/a&gt;. In this chapter, I'm gonna focus on the macro-way.&lt;/p&gt;
&lt;p&gt;The library is available &lt;a class="reference external" href="https://github.com/wichtounet/cpm"&gt;here&lt;/a&gt;, you can either include as a submodule of your projects or install it globally to have access to its headers.&lt;/p&gt;
&lt;p&gt;The first thing to do is to include the CPM header:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_00405d2a2e7b4e5a87fd373026e1f695-1" name="rest_code_00405d2a2e7b4e5a87fd373026e1f695-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_00405d2a2e7b4e5a87fd373026e1f695-1"&gt;&lt;/a&gt;&lt;span class="cp"&gt;#define CPM_BENCHMARK "Example Benchmarks"&lt;/span&gt;
&lt;a id="rest_code_00405d2a2e7b4e5a87fd373026e1f695-2" name="rest_code_00405d2a2e7b4e5a87fd373026e1f695-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_00405d2a2e7b4e5a87fd373026e1f695-2"&gt;&lt;/a&gt;&lt;span class="cp"&gt;#include&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cpf"&gt;"cpm/cpm.hpp"&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You have to name your benchmark. This will automatically creates a main and will run all the declared benchmark.&lt;/p&gt;
&lt;section id="define-benchmarks"&gt;
&lt;h3&gt;Define benchmarks&lt;/h3&gt;
&lt;p&gt;Benchmarks can be defined either in a CPM_BENCH functor or in the global scope with &lt;code&gt;CPM_DIRECT_BENCH&lt;/code&gt;.&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;&lt;p&gt;simple&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_22609c8f694e409481adc4833aba3387-1" name="rest_code_22609c8f694e409481adc4833aba3387-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_22609c8f694e409481adc4833aba3387-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_DIRECT_BENCH_SIMPLE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"bench_name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The first argument is the name of the benchmark and the second argument is the function that will be benchmarked by the system, this function takes the input size as input.&lt;/p&gt;
&lt;ol class="arabic simple" start="2"&gt;
&lt;li&gt;&lt;p&gt;global&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_b2612c2001684f37aee95fc3f9627f26-1" name="rest_code_b2612c2001684f37aee95fc3f9627f26-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_b2612c2001684f37aee95fc3f9627f26-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_BENCH&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_b2612c2001684f37aee95fc3f9627f26-2" name="rest_code_b2612c2001684f37aee95fc3f9627f26-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_b2612c2001684f37aee95fc3f9627f26-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;a id="rest_code_b2612c2001684f37aee95fc3f9627f26-3" name="rest_code_b2612c2001684f37aee95fc3f9627f26-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_b2612c2001684f37aee95fc3f9627f26-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_GLOBAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"bench_name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_b2612c2001684f37aee95fc3f9627f26-4" name="rest_code_b2612c2001684f37aee95fc3f9627f26-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_b2612c2001684f37aee95fc3f9627f26-4"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The first argument is the name of the benchmark, the second is the function being benchmarked and the following arguments must be references to global data that will be randomized by CPM.&lt;/p&gt;
&lt;ol class="arabic simple" start="3"&gt;
&lt;li&gt;&lt;p&gt;two_pass&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_6938745246e34f79ab966599726618f3-1" name="rest_code_6938745246e34f79ab966599726618f3-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_6938745246e34f79ab966599726618f3-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_DIRECT_BENCH_TWO_PASS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"bench_name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_6938745246e34f79ab966599726618f3-2" name="rest_code_6938745246e34f79ab966599726618f3-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_6938745246e34f79ab966599726618f3-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;a id="rest_code_6938745246e34f79ab966599726618f3-3" name="rest_code_6938745246e34f79ab966599726618f3-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_6938745246e34f79ab966599726618f3-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_6938745246e34f79ab966599726618f3-4" name="rest_code_6938745246e34f79ab966599726618f3-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_6938745246e34f79ab966599726618f3-4"&gt;&lt;/a&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Again, the first argument is the name. The second argument is the initialization functor. This functor must returns a tuple with all the information that will be passed (unpacked) to the third argument (the benchmark functor). Everything that is being returned by the initialization functor will be randomized.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="select-the-input-sizes"&gt;
&lt;h3&gt;Select the input sizes&lt;/h3&gt;
&lt;p&gt;By default, CPM will invoke your benchmarks with values from 10 to 1000000, multiplying it by 10 each step. This can be tuned for each benchmark and section independently. Each benchmark macro has a _P suffix that allows you to set the size policy:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_76a9d55df6b34a7db175fa0e28e20226-1" name="rest_code_76a9d55df6b34a7db175fa0e28e20226-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_76a9d55df6b34a7db175fa0e28e20226-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_SIMPLE_P&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;a id="rest_code_76a9d55df6b34a7db175fa0e28e20226-2" name="rest_code_76a9d55df6b34a7db175fa0e28e20226-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_76a9d55df6b34a7db175fa0e28e20226-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;VALUES_POLICY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;a id="rest_code_76a9d55df6b34a7db175fa0e28e20226-3" name="rest_code_76a9d55df6b34a7db175fa0e28e20226-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_76a9d55df6b34a7db175fa0e28e20226-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;"simple_a_n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_76a9d55df6b34a7db175fa0e28e20226-4" name="rest_code_76a9d55df6b34a7db175fa0e28e20226-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_76a9d55df6b34a7db175fa0e28e20226-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can also have several sizes (for multidimensional data structures or algorithms):&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_68802698a222474c95566b297fbff738-1" name="rest_code_68802698a222474c95566b297fbff738-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_68802698a222474c95566b297fbff738-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_DIRECT_BENCH_TWO_PASS_P&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;a id="rest_code_68802698a222474c95566b297fbff738-2" name="rest_code_68802698a222474c95566b297fbff738-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_68802698a222474c95566b297fbff738-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;NARY_POLICY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;VALUES_POLICY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VALUES_POLICY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
&lt;a id="rest_code_68802698a222474c95566b297fbff738-3" name="rest_code_68802698a222474c95566b297fbff738-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_68802698a222474c95566b297fbff738-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;"convmtx2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_68802698a222474c95566b297fbff738-4" name="rest_code_68802698a222474c95566b297fbff738-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_68802698a222474c95566b297fbff738-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dmat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dmat&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;a id="rest_code_68802698a222474c95566b297fbff738-5" name="rest_code_68802698a222474c95566b297fbff738-5" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_68802698a222474c95566b297fbff738-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cm"&gt;/*d1*/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dmat&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dmat&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;etl&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;convmtx2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_68802698a222474c95566b297fbff738-6" name="rest_code_68802698a222474c95566b297fbff738-6" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_68802698a222474c95566b297fbff738-6"&gt;&lt;/a&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="configure-benchmarks"&gt;
&lt;h3&gt;Configure benchmarks&lt;/h3&gt;
&lt;p&gt;By default, each benchmark is run 10 times for warmup and then repeated 50 times, but you can define your own values:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_e901a86cb229477b96364b199488441e-1" name="rest_code_e901a86cb229477b96364b199488441e-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_e901a86cb229477b96364b199488441e-1"&gt;&lt;/a&gt;&lt;span class="cp"&gt;#define CPM_WARMUP 3&lt;/span&gt;
&lt;a id="rest_code_e901a86cb229477b96364b199488441e-2" name="rest_code_e901a86cb229477b96364b199488441e-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_e901a86cb229477b96364b199488441e-2"&gt;&lt;/a&gt;&lt;span class="cp"&gt;#define CPM_REPEAT 10&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This must be done before the inclusion of the header.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="define-sections"&gt;
&lt;h3&gt;Define sections&lt;/h3&gt;
&lt;p&gt;Sections are simply a group of benchmarks, so instead of putting several benchmarks inside a &lt;code&gt;CPM_BENCH&lt;/code&gt;, you can put them inside a &lt;code&gt;CPM_SECTION&lt;/code&gt;. For instance:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-1" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_SECTION&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"mmul"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-2" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_SIMPLE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"std"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-3" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_SIMPLE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"fast"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-4" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_SIMPLE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"common"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-5" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-5" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-5"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-6" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-6" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-6"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_SECTION&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"conv"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-7" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-7" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_TWO_PASS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"std"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-8" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-8" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-8"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-9" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-9" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-9"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-10" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-10" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-10"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-11" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-11" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-11"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_TWO_PASS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"fast"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-12" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-12" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-12"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;make_tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-13" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-13" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-13"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;[](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-14" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-14" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-14"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-15" name="rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-15" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_5ca2b2fedcdc407abd6b4a0edbf25651-15"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can also set different warmup and repeat values for each section by using &lt;code&gt;CPM_SECTION_O&lt;/code&gt;:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_2e9e8ac60d0f4450aad7d65decc06049-1" name="rest_code_2e9e8ac60d0f4450aad7d65decc06049-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2e9e8ac60d0f4450aad7d65decc06049-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_SECTION_O&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"fft"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;51&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;a id="rest_code_2e9e8ac60d0f4450aad7d65decc06049-2" name="rest_code_2e9e8ac60d0f4450aad7d65decc06049-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2e9e8ac60d0f4450aad7d65decc06049-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;a id="rest_code_2e9e8ac60d0f4450aad7d65decc06049-3" name="rest_code_2e9e8ac60d0f4450aad7d65decc06049-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2e9e8ac60d0f4450aad7d65decc06049-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;a id="rest_code_2e9e8ac60d0f4450aad7d65decc06049-4" name="rest_code_2e9e8ac60d0f4450aad7d65decc06049-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2e9e8ac60d0f4450aad7d65decc06049-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_GLOBAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"std"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_2e9e8ac60d0f4450aad7d65decc06049-5" name="rest_code_2e9e8ac60d0f4450aad7d65decc06049-5" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2e9e8ac60d0f4450aad7d65decc06049-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_GLOBAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"mkl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;this_thread&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sleep_for&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;factor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;_ns&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_2e9e8ac60d0f4450aad7d65decc06049-6" name="rest_code_2e9e8ac60d0f4450aad7d65decc06049-6" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2e9e8ac60d0f4450aad7d65decc06049-6"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;will be warmup 11 times and run 51 times.&lt;/p&gt;
&lt;p&gt;The size policy can also be changed for the complete section (cannot be changed independently for benchmarks inside the section):&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code cpp"&gt;&lt;a id="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-1" name="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-1"&gt;&lt;/a&gt;&lt;span class="n"&gt;CPM_SECTION_P&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"mmul"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;a id="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-2" name="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;NARY_POLICY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;STD_STOP_POLICY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VALUES_POLICY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VALUES_POLICY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;a id="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-3" name="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;a id="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-4" name="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;a id="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-5" name="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-5" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-5"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_GLOBAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"std"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d3&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cm"&gt;/* Something */&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-6" name="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-6" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-6"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_GLOBAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"mkl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d3&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cm"&gt;/* Something */&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-7" name="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-7" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-7"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;CPM_GLOBAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"bla"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d3&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cm"&gt;/* Something */&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;a id="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-8" name="rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-8" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_2b5fc9a0008e4c6fa51c9205e4dc4b10-8"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;
&lt;section id="run"&gt;
&lt;h3&gt;Run&lt;/h3&gt;
&lt;p&gt;Once your benchmarks and sections are defined, you can build you program as a normal C++ main and run it. You can pass several options:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-1" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-1"&gt;&lt;/a&gt;./debug/bin/full -h
&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-2" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-2"&gt;&lt;/a&gt;Usage:
&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-3" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-3"&gt;&lt;/a&gt;  ./debug/bin/full [OPTION...]
&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-4" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-4"&gt;&lt;/a&gt;
&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-5" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-5" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-5"&gt;&lt;/a&gt;  -n, --name arg           Benchmark name
&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-6" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-6" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-6"&gt;&lt;/a&gt;  -t, --tag arg            Tag name
&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-7" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-7" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-7"&gt;&lt;/a&gt;  -c, --configuration arg  Configuration
&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-8" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-8" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-8"&gt;&lt;/a&gt;  -o, --output arg         Output folder
&lt;a id="rest_code_eb7adc02df184c2ab791b0763a29fbfc-9" name="rest_code_eb7adc02df184c2ab791b0763a29fbfc-9" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_eb7adc02df184c2ab791b0763a29fbfc-9"&gt;&lt;/a&gt;  -h, --help               Print help
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The tag is used to distinguish between runs, I recommend that you use a SCM identifier for the tag. If you want to run your program with different configurations (compiler options for instance), you'll have to set the configuration with the --configuration option.&lt;/p&gt;
&lt;p&gt;Here is a possible output:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-1" name="rest_code_de49d88a831d4292b4eae8910e25bf69-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-1"&gt;&lt;/a&gt; Start CPM benchmarks
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-2" name="rest_code_de49d88a831d4292b4eae8910e25bf69-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-2"&gt;&lt;/a&gt;    Results will be automatically saved in /home/wichtounet/dev/cpm/results/10.cpm
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-3" name="rest_code_de49d88a831d4292b4eae8910e25bf69-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-3"&gt;&lt;/a&gt;    Each test is warmed-up 10 times
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-4" name="rest_code_de49d88a831d4292b4eae8910e25bf69-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-4"&gt;&lt;/a&gt;    Each test is repeated 50 times
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-5" name="rest_code_de49d88a831d4292b4eae8910e25bf69-5" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-5"&gt;&lt;/a&gt;    Time Sun Jun 14 15:33:51 2015
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-6" name="rest_code_de49d88a831d4292b4eae8910e25bf69-6" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-6"&gt;&lt;/a&gt;
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-7" name="rest_code_de49d88a831d4292b4eae8910e25bf69-7" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-7"&gt;&lt;/a&gt;    Tag: 10
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-8" name="rest_code_de49d88a831d4292b4eae8910e25bf69-8" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-8"&gt;&lt;/a&gt;    Configuration:
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-9" name="rest_code_de49d88a831d4292b4eae8910e25bf69-9" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-9"&gt;&lt;/a&gt;    Compiler: clang-3.5.0
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-10" name="rest_code_de49d88a831d4292b4eae8910e25bf69-10" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-10"&gt;&lt;/a&gt;    Operating System: Linux x86_64 3.16.5-gentoo
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-11" name="rest_code_de49d88a831d4292b4eae8910e25bf69-11" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-11"&gt;&lt;/a&gt;
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-12" name="rest_code_de49d88a831d4292b4eae8910e25bf69-12" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-12"&gt;&lt;/a&gt;
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-13" name="rest_code_de49d88a831d4292b4eae8910e25bf69-13" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-13"&gt;&lt;/a&gt; simple_a(10) : mean: 52.5us (52.3us,52.7us) stddev: 675ns min: 48.5us max: 53.3us througput: 190KEs
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-14" name="rest_code_de49d88a831d4292b4eae8910e25bf69-14" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-14"&gt;&lt;/a&gt; simple_a(100) : mean: 50.1us (48us,52.2us) stddev: 7.53us min: 7.61us max: 52.3us througput: 2MEs
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-15" name="rest_code_de49d88a831d4292b4eae8910e25bf69-15" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-15"&gt;&lt;/a&gt; simple_a(1000) : mean: 52.7us (52.7us,52.7us) stddev: 48.7ns min: 52.7us max: 53us througput: 19MEs
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-16" name="rest_code_de49d88a831d4292b4eae8910e25bf69-16" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-16"&gt;&lt;/a&gt; simple_a(10000) : mean: 62.6us (62.6us,62.7us) stddev: 124ns min: 62.6us max: 63.5us througput: 160MEs
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-17" name="rest_code_de49d88a831d4292b4eae8910e25bf69-17" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-17"&gt;&lt;/a&gt; simple_a(100000) : mean: 161us (159us,162us) stddev: 5.41us min: 132us max: 163us througput: 622MEs
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-18" name="rest_code_de49d88a831d4292b4eae8910e25bf69-18" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-18"&gt;&lt;/a&gt; simple_a(1000000) : mean: 1.16ms (1.16ms,1.17ms) stddev: 7.66us min: 1.15ms max: 1.18ms througput: 859MEs
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-19" name="rest_code_de49d88a831d4292b4eae8910e25bf69-19" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-19"&gt;&lt;/a&gt;
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-20" name="rest_code_de49d88a831d4292b4eae8910e25bf69-20" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-20"&gt;&lt;/a&gt;-----------------------------------------
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-21" name="rest_code_de49d88a831d4292b4eae8910e25bf69-21" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-21"&gt;&lt;/a&gt;|            gemm |       std |     mkl |
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-22" name="rest_code_de49d88a831d4292b4eae8910e25bf69-22" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-22"&gt;&lt;/a&gt;-----------------------------------------
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-23" name="rest_code_de49d88a831d4292b4eae8910e25bf69-23" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-23"&gt;&lt;/a&gt;|           10x10 | 51.7189us | 64.64ns |
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-24" name="rest_code_de49d88a831d4292b4eae8910e25bf69-24" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-24"&gt;&lt;/a&gt;|         100x100 | 52.4336us | 63.42ns |
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-25" name="rest_code_de49d88a831d4292b4eae8910e25bf69-25" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-25"&gt;&lt;/a&gt;|       1000x1000 | 56.0097us |  63.2ns |
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-26" name="rest_code_de49d88a831d4292b4eae8910e25bf69-26" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-26"&gt;&lt;/a&gt;|     10000x10000 | 95.6123us | 63.52ns |
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-27" name="rest_code_de49d88a831d4292b4eae8910e25bf69-27" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-27"&gt;&lt;/a&gt;|   100000x100000 | 493.795us | 63.48ns |
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-28" name="rest_code_de49d88a831d4292b4eae8910e25bf69-28" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-28"&gt;&lt;/a&gt;| 1000000x1000000 | 4.46646ms |  63.8ns |
&lt;a id="rest_code_de49d88a831d4292b4eae8910e25bf69-29" name="rest_code_de49d88a831d4292b4eae8910e25bf69-29" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_de49d88a831d4292b4eae8910e25bf69-29"&gt;&lt;/a&gt;-----------------------------------------
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The program will give you for each benchmark, the mean duration (with confidence interval), the standard deviation of the samples, the min and max duration and an estimated throughput. The throughput is simply using the size and the mean duration. Each section is directly compared with an array-like output. Once the benchmark is run, a JSON report will be generated inside the output folder.&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section id="continuous-monitoring"&gt;
&lt;h2&gt;Continuous Monitoring&lt;/h2&gt;
&lt;p&gt;Once you have run the benchmark, you can use the CPM program to generate the web reports. It will generate:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;1 performance graph for each benchmark and section&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;1 graph comparing the performances over time of your benchmark sections if you have run the benchmark several time&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;1 graph comparing different compiler if you have compiled your program with different compiler&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;1 graph comparing different configuration if you have run the benchmark with different configuration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;1 table summary for each benchmark / section&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;First you have to build and install the CPM program (you can have a look at the &lt;a class="reference external" href="https://github.com/wichtounet/cpm/blob/master/README.rst"&gt;Readme&lt;/a&gt; for more informations.&lt;/p&gt;
&lt;p&gt;Several options are available:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-1" name="rest_code_37912592a18149dca76480e06fccfc85-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-1"&gt;&lt;/a&gt;Usage:
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-2" name="rest_code_37912592a18149dca76480e06fccfc85-2" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-2"&gt;&lt;/a&gt;  cpm [OPTION...]  results_folder
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-3" name="rest_code_37912592a18149dca76480e06fccfc85-3" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-3"&gt;&lt;/a&gt;
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-4" name="rest_code_37912592a18149dca76480e06fccfc85-4" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-4"&gt;&lt;/a&gt;      --time-sizes             Display multiple sizes in the time graphs
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-5" name="rest_code_37912592a18149dca76480e06fccfc85-5" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-5"&gt;&lt;/a&gt;  -t, --theme arg              Theme name [raw,bootstrap,boostrap-tabs] (default:bootstrap)
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-6" name="rest_code_37912592a18149dca76480e06fccfc85-6" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-6"&gt;&lt;/a&gt;  -c, --hctheme theme_name     Highcharts Theme name [std,dark_unica] (default:dark_unica)
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-7" name="rest_code_37912592a18149dca76480e06fccfc85-7" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-7"&gt;&lt;/a&gt;  -o, --output output_folder   Output folder (default:reports)
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-8" name="rest_code_37912592a18149dca76480e06fccfc85-8" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-8"&gt;&lt;/a&gt;      --input arg              Input results
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-9" name="rest_code_37912592a18149dca76480e06fccfc85-9" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-9"&gt;&lt;/a&gt;  -s, --sort-by-tag            Sort by tag instaed of time
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-10" name="rest_code_37912592a18149dca76480e06fccfc85-10" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-10"&gt;&lt;/a&gt;  -p, --pages                  General several HTML pages (one per bench/section)
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-11" name="rest_code_37912592a18149dca76480e06fccfc85-11" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-11"&gt;&lt;/a&gt;  -d, --disable-time           Disable time graphs
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-12" name="rest_code_37912592a18149dca76480e06fccfc85-12" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-12"&gt;&lt;/a&gt;      --disable-compiler       Disable compiler graphs
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-13" name="rest_code_37912592a18149dca76480e06fccfc85-13" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-13"&gt;&lt;/a&gt;      --disable-configuration  Disable configuration graphs
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-14" name="rest_code_37912592a18149dca76480e06fccfc85-14" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-14"&gt;&lt;/a&gt;      --disable-summary        Disable summary table
&lt;a id="rest_code_37912592a18149dca76480e06fccfc85-15" name="rest_code_37912592a18149dca76480e06fccfc85-15" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_37912592a18149dca76480e06fccfc85-15"&gt;&lt;/a&gt;  -h, --help                   Print help
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There are 3 themes:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;bootstrap&lt;/em&gt;: The default theme, using Bootstrap to make a responsive interface.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;bootstrap-tabs&lt;/em&gt;: Similar to the &lt;em&gt;bootstrap&lt;/em&gt; theme except that only is displayed at the same time for each benchmark, with tabs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;raw&lt;/em&gt; : A very basic theme, only using Highcharts library for graphs. It is very minimalistic&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For instance, here are how the reports are generated for the ETL benchmark:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code text"&gt;&lt;a id="rest_code_60e509c34bc2466cb2e554bb7bc44441-1" name="rest_code_60e509c34bc2466cb2e554bb7bc44441-1" href="https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html#rest_code_60e509c34bc2466cb2e554bb7bc44441-1"&gt;&lt;/a&gt;cpm -p -s -t bootstrap -c dark_unica -o reports results
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here is the graph generated for the "R = A + B + C" benchmark and different compilers:&lt;/p&gt;
&lt;img alt="/images/cpm_etl_compiler.png" src="https://baptiste-wicht.com/images/cpm_etl_compiler.png"&gt;
&lt;p&gt;and its summary:&lt;/p&gt;
&lt;img alt="/images/cpm_etl_summary.png" src="https://baptiste-wicht.com/images/cpm_etl_summary.png"&gt;
&lt;p&gt;Here is the graph for a 2D convolution with ETL:&lt;/p&gt;
&lt;img alt="/images/cpm_etl_section.png" src="https://baptiste-wicht.com/images/cpm_etl_section.png"&gt;
&lt;p&gt;And the graph for different configurations of ETL and the dense matrix matrix multiplication:&lt;/p&gt;
&lt;img alt="/images/cpm_etl_configuration.png" src="https://baptiste-wicht.com/images/cpm_etl_configuration.png"&gt;
&lt;/section&gt;
&lt;section id="conclusion-and-future-work"&gt;
&lt;h2&gt;Conclusion and Future Work&lt;/h2&gt;
&lt;p&gt;Although CPM is already working, there are several things that could be done to improve it further:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;The generated web report could benefit from a global summary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The throughput evaluation should be evaluated more carefully.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The tool should automatically evaluate the number of times that each tests should be run to have a good result instead of global warmup and repeat constants.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A better bootstrapping procedure should be used to determine the quality of the results and compute the confidence intervals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The performances of the website with lots of graphs should be improved.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make CPM more general-purpose to support larger needs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here it is, I have summed most of the features of the CPM Continuous Performance Analysis tool. I hope that it will be helpful to some of you as well.&lt;/p&gt;
&lt;p&gt;If you have other ideas or want to contribute something to the project, you can directly open an issue or a pull request on &lt;a class="reference external" href="https://github.com/wichtounet/cpm"&gt;Github&lt;/a&gt;. Or contact me via this site or Github.&lt;/p&gt;
&lt;/section&gt;</description><category>Benchmarks</category><category>C++</category><category>Performances</category><category>Sonar</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2015/06/continuous-performance-management-with-cpm-for-cpp.html</guid><pubDate>Sun, 14 Jun 2015 12:02:57 GMT</pubDate></item><item><title>Sonar C++ Community Plugin Review</title><link>https://baptiste-wicht.com/posts/2015/05/sonar-cpp-community-plugin-review.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;It's been a long time since I have written on this blog. I have had quite a lot of work between my Ph.D and my teaching. I have several projects going on, I'll try to write updates on them later on.&lt;/p&gt;
&lt;p&gt;Some time ago, I wrote an article &lt;cite&gt;about the official C++ plugin for Sonar &amp;lt;http://baptiste-wicht.com/posts/2014/10/sonarqube-inspections-for-cpp-projects.html&amp;gt;&lt;/cite&gt;. I was quite disappointed by the quality of a plugin. I was expecting more from an expensive official plugin.&lt;/p&gt;
&lt;p&gt;There is an open-source alternative to the commercial plugin: &lt;cite&gt;sonar-cxx-plugin &amp;lt;https://github.com/wenns/sonar-cxx&amp;gt;&lt;/cite&gt;. I already tested it quite some time ago (a development version of the 0.9.1 version) and the results were quite bad. I'm using C++11 and C++14 in almost all of my projects and the support was quite bad at that time. Happily, this support has now gotten much better :) In this article, I'll talk about the version 0.9.2.&lt;/p&gt;
&lt;section id="usage"&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;The usage of this plugin is very easy, you don't need any complicated build wrapping techniques for it. You simply need to complete a &lt;em&gt;sonar-project.properties&lt;/em&gt; file:&lt;/p&gt;
&lt;pre class="literal-block"&gt;sonar.projectKey=etl
sonar.projectName=etl
sonar.projectVersion=1.0

sonar.sourceEncoding=UTF-8
sonar.sources=include,test,workbench
sonar.language=c++&lt;/pre&gt;
&lt;p&gt;After that, you simply have to use &lt;em&gt;sonar-runner&lt;/em&gt; as for any other Sonar project:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sonar-runner&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And the analysis will be run.&lt;/p&gt;
&lt;p&gt;I haven't had any issues with the analysis. However, the plugin is not yet completely C++11/C++14 compatible, therefore I'm encountering a lot of parser errors during the analysis. When an error is encountered by the parser, the line is skipped and the parser goes to the next line. This means that the analysis of the line is incomplete, which may lead to false positives or to missing issues. This comes from that sonar-cxx uses its own parser, which is to on par with clang-compatible parsers for instance.&lt;/p&gt;
&lt;p&gt;Here is the Sonar summary of my ETL project:&lt;/p&gt;
&lt;img alt="/images/sonar_summary.png" src="https://baptiste-wicht.com/images/sonar_summary.png"&gt;
&lt;/section&gt;
&lt;section id="inspections"&gt;
&lt;h2&gt;Inspections&lt;/h2&gt;
&lt;p&gt;This plugin supports some inspections on itself. Nevertheless, you have to enable since it seems that most of them are disable by default. Code duplication is also automatically generated during the analysis:&lt;/p&gt;
&lt;img alt="/images/sonar_duplicated.png" src="https://baptiste-wicht.com/images/sonar_duplicated.png"&gt;
&lt;p&gt;The philosophy of this project is not to develop all inspections, but to integrate with other tools. For instance, cppcheck is already supported and the integration works perfectly. Here are the tools that sonar-cxx supports for quality analysis:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;cppcheck&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;valgrind&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vera++&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RATS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PC-Lint&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have only tested cppcheck for now. I plan to use valgrind running on my tests in the future. I don't plan to use the others.&lt;/p&gt;
&lt;p&gt;It should also be noted that the plugin supports compiler warnings coming from G++ and Visual Studio. I don't use this since I compile all my projects with -Werror.&lt;/p&gt;
&lt;p&gt;The biggest absent here is Clang, there is no support for its warnings, its static-analyzer or its advanced clang-tidy tool. If clang-tidy support does not come in the near future, I'm planning to try to add it myself, provided I find some time.&lt;/p&gt;
&lt;p&gt;You can have to some inspections on one of my project:&lt;/p&gt;
&lt;img alt="/images/sonar_inspections.png" src="https://baptiste-wicht.com/images/sonar_inspections.png"&gt;
&lt;p&gt;As with any Sonar projects, you have access to the Hotsposts view:&lt;/p&gt;
&lt;img alt="/images/sonar_hotspots.png" src="https://baptiste-wicht.com/images/sonar_hotspots.png"&gt;
&lt;/section&gt;
&lt;section id="unit-tests-integration"&gt;
&lt;h2&gt;Unit Tests Integration&lt;/h2&gt;
&lt;p&gt;I have been able to integrate my unit tests results inside Sonar. The plugin expects JUnit compatible format. Several of C++ unit test libraries already generates compatible format. In my case, I used Catch and it worked very well.&lt;/p&gt;
&lt;p&gt;What is even more interesting is the support for code coverage. You have to run your coverage-enabled executable and then use gcovr to generate an XML file that the plugin can read.&lt;/p&gt;
&lt;p&gt;This support works quite well. The only thing I haven't been able to make work is the execution time computation of the unit tests, but that is not something I really care about.&lt;/p&gt;
&lt;p&gt;Here are the coverage results for one of my files:&lt;/p&gt;
&lt;img alt="/images/sonar_coverage.png" src="https://baptiste-wicht.com/images/sonar_coverage.png"&gt;
&lt;/section&gt;
&lt;section id="conclusion"&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Support of a lot of external tools&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Very easy to use&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Duplicated code analysis&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Very good code coverage analysis integration&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Too few integrated inspections&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Limited parsing of C++&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not fully compatible with C++11/C++14&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;False positives&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not enough love for clang (compiler warnings, clang-tidy, tooling, static-analyzer, ...)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The provided metrics are really good, the usage is quite simple and this plugin supports some external tools adding interesting inspections. Even if this plugin is not perfect, it is a very good way to do Continuous Quality Analysis of your C++ projects. I personally find it superior to the official plugin. The usage is more simple (no build-wrapper that does not work), it supports more external tools and supports JUnit reports. On the other hand, it has much less integrated inspections and rely more on external tools. Both have problems with modern C++ features.&lt;/p&gt;
&lt;p&gt;What I would really like in this plugin is the support of the clang-tidy analyzer (and other Clang analysis tools) and also complete C++11/C++14 support. I honestly think that the only way to fix the latter is to switch to Clang parsing with libtooling rather than developing an in-house parser, but that is not up to me.&lt;/p&gt;
&lt;p&gt;I will definitely continue to use this plugin to generate metrics for my C++ projects. I use it with Jenkins which launch the analysis every time I push to one my git repositories. This plugin definitely shows promises.&lt;/p&gt;
&lt;/section&gt;</description><category>C++</category><category>Review</category><category>Sonar</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2015/05/sonar-cpp-community-plugin-review.html</guid><pubDate>Thu, 14 May 2015 15:09:59 GMT</pubDate></item><item><title>SonarQube inspections for C++ projects</title><link>https://baptiste-wicht.com/posts/2014/10/sonarqube-inspections-for-cpp-projects.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;Back in the days, when I used to develop in Java (I hadn't discovered the
wonders of C++ :) ), I used Sonar a lot for my projects. Sonar is a great tool
for quality inspections of a project. Sonar has been made for Java and is mostly
free and opensource (some plugins are commercial) to inspect Java projects.
Unfortunately, this is not the case for C++ inspection. Indeed, the C++ plugin
cost 7000 euros (more than 8500$). As I mostly work on C++ for opensource and
school projects, I'm definitely not able to buy it. I wanted for a long time to
test the commercial C++ plugin. For this article, sonarsource provided me with a
short (very short) time license for the C++ plugin.&lt;/p&gt;
&lt;p&gt;There is also another option for C++ which is the C++ community plugin:
&lt;a class="reference external" href="https://github.com/wenns/sonar-cxx"&gt;https://github.com/wenns/sonar-cxx&lt;/a&gt;. I have tested it some time ago, but I was
not satisfied with it, I had several errors and had to use a dev version to make
it work a bit. Moreover, the C++11 support is inexistant and management of
parsing error is not really satisfying. But maybe it is good for you. This
article will only focus on the commercial plugin.&lt;/p&gt;
&lt;section id="usage"&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;p&gt;For each project that you want to analyze with Sonar, you have to create a
sonar-project.properties files describing some basic information about your
project.&lt;/p&gt;
&lt;p&gt;Then, there are two ways to inspect a C++ project. The first one and recommended
one is to use the &lt;em&gt;build-wrapper&lt;/em&gt; executable. It is a sub project that you have
to download and install alongside Sonar. It works by wrapping the commands to
your build systems:&lt;/p&gt;
&lt;pre class="literal-block"&gt;build-wrapper make all&lt;/pre&gt;
&lt;p&gt;and this should generate enough informations for not having to fill each field
in the project configuration. The, you have to use the &lt;em&gt;sonar-runner&lt;/em&gt; program to
upload to Sonar.&lt;/p&gt;
&lt;p&gt;I tried it on several projects and there seems to be a problem with the
includes. It didn't include the header files in the Sonar inspections.&lt;/p&gt;
&lt;p&gt;I finally ended up using manual configuration of the Sonar project and the
header files were included correctly. However, you normally have to include many
information in the configuration including all macros for instance. For now, I
haven't bothered generating them and it doesn't seem to impact too much the
results.&lt;/p&gt;
&lt;p&gt;When I look in the log, it seems that there are still a lot of parsing errors.
They seem mostly related to some compiler macro, especially the __has_feature__
macro of clang. This is the same problem with the build-wrapper. When I don't
use the build-wrapper I also have other problems with macros for unit testing.&lt;/p&gt;
&lt;p&gt;I also have other errors coming during the inspection, for instance:&lt;/p&gt;
&lt;pre class="literal-block"&gt;error directive: This file requires compiler and library support for the ISO C++
2011 standard. This support is currently experimental, and must be enabled with
the -std=c++11 or -std=gnu++11 compiler options&lt;/pre&gt;
&lt;p&gt;I think it comes from the fact that I compile with std=c++1y and that Sonar
does not support C++14.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="inspections"&gt;
&lt;h2&gt;Inspections&lt;/h2&gt;
&lt;p&gt;Here is the results of inspection on my ETL project:&lt;/p&gt;
&lt;img alt="/images/etl_dashboard.png" src="https://baptiste-wicht.com/images/etl_dashboard.png"&gt;
&lt;p&gt;I really like the web interface of Sonar, it really sums well all the
information and the various plugins play quite nice with each other. Moreover,
when you check issues, you can see directly the source code very clearly. I
really think this is the strong point of Sonar.&lt;/p&gt;
&lt;p&gt;Here is the Hotspots view for instance:&lt;/p&gt;
&lt;img alt="/images/etl_dashboard.png" src="https://baptiste-wicht.com/images/etl_dashboard.png"&gt;
&lt;p&gt;Or the Time Machine view:&lt;/p&gt;
&lt;img alt="/images/etl_dashboard.png" src="https://baptiste-wicht.com/images/etl_dashboard.png"&gt;
&lt;p&gt;The issues that are reported by Sonar are quite good. On this project there is a
lot of them related to naming conventions because I don't follow the conventions
configured by default. However, you can easily configure the inspections to give
your own naming regex or simple enable/disable some inspections.&lt;/p&gt;
&lt;p&gt;There are some good inspections:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Some missing explicit keyword&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some commented block of code that can be removed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An if-elseif construct that should have had a else&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Files with too high complexity&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, there are also some important false positives. For instance:&lt;/p&gt;
&lt;img alt="/images/etl_false_positive_1.png" src="https://baptiste-wicht.com/images/etl_false_positive_1.png"&gt;
&lt;p&gt;In here, there are no reasons to output this issue since the operator is
deleted. It proves that the C++11 support is rather incomplete. I have other
false positives of the same kind for &lt;em&gt;= default&lt;/em&gt; operators and constructors.
Here is another example:&lt;/p&gt;
&lt;img alt="/images/etl_false_positive_2.png" src="https://baptiste-wicht.com/images/etl_false_positive_2.png"&gt;
&lt;p&gt;In this case, the varadic template support is mixed with the old ellipsis
notation, making it again a lack of C++11 support. There are also other false
positives for instance because of lambdas, but all of them were related to
C++11.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="various"&gt;
&lt;h2&gt;Various&lt;/h2&gt;
&lt;p&gt;If you don't think you have enough quality rules, you can also include the one
from cppcheck simply by givin the path to cppcheck in sonar-project.properties.
I think this is great, since it works all by itself. You can also create your
own rule, but you'll have to use XPath for path.&lt;/p&gt;
&lt;p&gt;If you want, you can also include unit test reports inside Sonar. I haven't
tested this support since they only support cppunit test reports and I use only
Catch for my unit tests. It would have been great if JUnit format would have
been supported since many tool support it.&lt;/p&gt;
&lt;p&gt;The last option that is supported by this plugin is the support of GCOV reports
for code coverage information. I haven't been able to make it work, I had errors
indicating that the source files were not found. I didn't figure this out. It
may come from the fact that I used llvm and clang to generate the GCOV reports
and not G++.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="conclusion"&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;First, here are some pros and cons for the C++ support in SonarQube.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Good default inspections&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Great web interface.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;cppcheck very well integrated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Issues are easily configurable&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;C++11 support is incomplete and no C++14 support&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;build-wrapper support seems instable. It should be integrated directly into
sonar.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unit tests support is limited to cppunit&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Haven't been able to make Code Coverage work&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Macro support not flexible enough&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Too expensive&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Quite complicated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No support for other static analyzer than cppcheck&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The general web interface feeling is quite good, everything looks great and the
report are really useful. However, the usage of the tool does not feel very
professional. I had a lot more problems than I expected to use it. I was also
really disappointed by the C++11. The syntax seems to be supported but not the
language feature in the inspections, making the C++11 support completely
useless. This is weird since they cite C+11 as supported. Moreover, there not
yet any C++14 support, but this is less dramatic. It is also a bit sad that they
limit the import to cppcheck and no other static analyzers and the same stands
for cppunit.&lt;/p&gt;
&lt;p&gt;In my opinion, it is really an inferior product compared to the Java support.
I was expecting more from a 8500 dollars product.&lt;/p&gt;
&lt;p&gt;For now, I won't probably use it anymore on my projects since all of them use at
least C++11, but I will probably retry Sonar for C++ in the future hoping that
it will become as the Sonar Java support.&lt;/p&gt;
&lt;/section&gt;</description><category>C++</category><category>Review</category><category>Sonar</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2014/10/sonarqube-inspections-for-cpp-projects.html</guid><pubDate>Sun, 05 Oct 2014 12:55:46 GMT</pubDate></item><item><title>Software Reliability Presentation</title><link>https://baptiste-wicht.com/posts/2014/06/software-reliability-presentation.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;section id="software-reliability"&gt;
&lt;h2&gt;Software Reliability&lt;/h2&gt;
&lt;p&gt;In behalf of my school (College of Engineering and Architecture of Fribourg), I
presented a shoft presentation about Software Reliability. In this presentation,
I outline the main issues about the subject and propose some solutions:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;Software Validation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Defensive Programming&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Software Analysis Tools&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the Software Analysis Tools, I present three tools: cppcheck, Valgrind and
the Clang Static analyzer. Several examples are presented for each tools as well
as some recommendations for using them. A short presentation of SonarQube is
also performed.&lt;/p&gt;
&lt;p&gt;I thought that it could be of some interest to some of the readers, so here it
is:&lt;/p&gt;
&lt;div style="text-align:center;"&gt;&lt;iframe src="http://www.slideshare.net/slideshow/embed_code/35576524" width="597" height="486" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px; max-width: 100%;" allowfullscreen&gt; &lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Don't hesitate if you have any comments or questions about the presentation ;)&lt;/p&gt;
&lt;p&gt;The source code for the examples is available &lt;a class="reference external" href="https://github.com/wichtounet/analysis-examples"&gt;on Github&lt;/a&gt;.&lt;/p&gt;
&lt;/section&gt;</description><category>clang</category><category>Gentoo</category><category>Linux</category><category>Programming</category><category>Reliability</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2014/06/software-reliability-presentation.html</guid><pubDate>Sat, 07 Jun 2014 14:45:33 GMT</pubDate></item><item><title>Install and Use CLang Static Analyzer on a CMake project</title><link>https://baptiste-wicht.com/posts/2014/04/install-use-clang-static-analyzer-cmake.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;I recently started a bit of work on my compiler (eddic) again. I started by adapting it to build on CLang with libc++. There was some minor adaptions to make it compile, but nothing really fancy. It now compiles and runs fine on LLVM/Clang 3.4 with the last version of libc++. I'm gonna use some features of C++14 in it and I plan to refactor some parts to make it more &lt;em&gt;STL-correct&lt;/em&gt;. I also plan to use only CLang on eddic right now, since C++14 support of GCC is not released right now. &lt;/p&gt;
&lt;p&gt;I decided it was a good time to try again the CLang static analyzer. &lt;/p&gt;
&lt;h3&gt;Installation&lt;/h3&gt;
&lt;p&gt;If, like me, you're using Gentoo, the static analyzer is directly installed with the &lt;em&gt;sys-devel/clang&lt;/em&gt; package, unless you disabled the &lt;em&gt;static-analyzer&lt;/em&gt; USE flag. &lt;/p&gt;
&lt;p&gt;If your distribution does not ship the static analyzer directly with CLang, you'll have to install it manually. To install it from sources, I advise you to follow the &lt;a href="http://clang-analyzer.llvm.org/installation.html"&gt;Official Installations instruction&lt;/a&gt;. &lt;/p&gt;
&lt;h3&gt;Usage&lt;/h3&gt;
&lt;p&gt;The usage of CLang static analyzer can be a bit disturbing at first. Most static analysis tools generally takes the sources directly and do their stuff. But that is not how Clang Static Analyzer works. It works as a kind of monitor in top of building the program, using &lt;em&gt;scan-build&lt;/em&gt;. When you are analyzing a program, you are also building the program. &lt;/p&gt;
&lt;p&gt;For instance, if you are compiling a source file like that: &lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;clang [clang-options] source_file.cpp
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;you can perform static analysis like that: &lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;scan-build [scan-build-options] clang [clang-options] source_file.cpp
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;scan-build works by replacing calls to the compiler by calls to &lt;em&gt;ccc-analyzer &lt;/em&gt;. This works generally well, but there are some cases where that things get a bit more complicated. That is the case of CMake where the paths to the compiler are hardcoded in the generated makefiles. &lt;/p&gt;
&lt;p&gt;For that, you have to run &lt;em&gt;cmake&lt;/em&gt; and &lt;em&gt;make&lt;/em&gt; with &lt;em&gt;scan-build&lt;/em&gt;: &lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;CCC_CC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;clang&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;CCC_CXX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;clang&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;
&lt;span class="n"&gt;scan&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cmake&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;clang&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;clang&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;scan&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;make&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This can take a very long time. On eddic, it is about three times slower than a normal compilation. An important point to note about performance, is that you can run compilations in parallel (-j option of make) and that it is supported by scan-build quite well. &lt;/p&gt;
&lt;p&gt;Once analysis is performed, the found bugs are put into an HTML report. By default, the HTML report is created in &lt;em&gt;/tmp/&lt;/em&gt;, but you can specificy the folder with -o option of scan-build. &lt;/p&gt;
&lt;p&gt;You can enable or disable checker with the -enable-checker and -disable-checker options of scan-build. &lt;/p&gt;
&lt;h3&gt;Results on eddic&lt;/h3&gt;
&lt;p&gt;Several versions of Clang ago, I tried the static analyzer on eddic, but it failed on several source files without producing any results. Moreover, at this time, I don't think there was any nice HTML report at this time. &lt;/p&gt;
&lt;p&gt;I ran it again on eddic with the last versions. Here is a picture of the generated report: &lt;/p&gt;
&lt;p&gt;&lt;img alt="CLang Static Analyzer eddic results" src="https://baptiste-wicht.com/images/eddic_results.png"&gt;&lt;/p&gt;
&lt;p&gt;As you can see, 14 bugs have been found. Unfortunately, none of them is a real bug on my code, but they are not all false positives neither. For instance, here is some unreachable code report: &lt;/p&gt;
&lt;p&gt;&lt;img alt="CLang Static Analyzer eddic bug" src="https://baptiste-wicht.com/images/eddic_results_bug.png"&gt;&lt;/p&gt;
&lt;p&gt;It is indeed an unreachable statement, but it is expected, since it is an assert to ensure that the code is unreachable. But that proves that the analysis works ;) &lt;/p&gt;
&lt;p&gt;Even if it didn't found anything, this time it worked much better than the last time I checked and the HTML results are just really good. &lt;/p&gt;
&lt;p&gt;I hope you found this article interesting. If you happen to have interesting results on your codebase with the CLang static analyzer, I'd be glad to hear about them ;)&lt;/p&gt;</description><category>C++</category><category>C++11</category><category>C++14</category><category>clang</category><category>eddic</category><category>llvm</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2014/04/install-use-clang-static-analyzer-cmake.html</guid><pubDate>Wed, 09 Apr 2014 14:39:11 GMT</pubDate></item><item><title>budgetwarrior 0.2.1 - Minor changes and Gentoo ebuild</title><link>https://baptiste-wicht.com/posts/2014/01/budgetwarrior-0-2-1-minor-changes-gentoo-ebuild.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;I've released a new version of budgetwarrior, the release 0.2.1. budgetwarrior is a simple command line application to manage a personal budget.&lt;/p&gt;
&lt;p&gt;The version 0.2.1 contains several bug fixes about archived accounts and bug fixes for budget across several years.&lt;/p&gt;
&lt;p&gt;The application as well as the source code is available online: &lt;a href="https://github.com/wichtounet/budgetwarrior"&gt;https://github.com/wichtounet/budgetwarrior&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I've created Gentoo ebuilds for this application. They are available on my Portage overlay: &lt;a href="https://github.com/wichtounet/portage-overlay"&gt;https://github.com/wichtounet/portage-overlay&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Gentoo Installation&lt;/h4&gt;

&lt;ul&gt;
    &lt;li&gt;Edit overlays section of /etc/layman/layman.cfg. Here's an example:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;overlays: http://www.gentoo.org/proj/en/overlays/repositories.xml
           http://github.com/wichtounet/portage-overlay/raw/master/repository.xml&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Sync layman&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;layman -S&lt;/pre&gt;

&lt;ul&gt;
    &lt;li&gt;Add the overlay:&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;layman -a wichtounet&lt;/pre&gt;

&lt;ul&gt;
    &lt;li&gt;Install budgetwarrior&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;emerge budgetwarrior&lt;/pre&gt;

&lt;h4&gt;Conclusion&lt;/h4&gt;

&lt;p&gt;If you find any issues with the tool, don't hesitate to post an issue on Github. If you have comments about it, you can post a comment on this post or contact me by email.&lt;/p&gt;</description><category>budgetwarrior</category><category>Gentoo</category><category>Linux</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2014/01/budgetwarrior-0-2-1-minor-changes-gentoo-ebuild.html</guid><pubDate>Thu, 16 Jan 2014 11:41:00 GMT</pubDate></item><item><title>CMake Testing - Rerun the last failed tests with CTest</title><link>https://baptiste-wicht.com/posts/2012/12/cmake-rerun-last-failed-tests-ctest.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;Some time ago, we saw &lt;a href="http://www.baptiste-wicht.com/2012/10/run-boost-test-parallel-cmake/" title="Run your Boost Tests in parallel with CMake"&gt;how to use CMake to run Boost Tests in paralel&lt;/a&gt;, now it is time for another tip. &lt;/p&gt;
&lt;p&gt;A feature that I think is lacking in CMake/CTest is a way to launch only the last failed tests. As it is not possible to do that directly, I posted &lt;a href="http://stackoverflow.com/q/13547175/802362" title="How to rerun the failed tests with ctest?"&gt;the question on StackOverflow&lt;/a&gt; and got a great answer from &lt;a href="http://stackoverflow.com/users/424459/fraser" title="Fraser"&gt;Fraser&lt;/a&gt;. I wanted to share its answer. &lt;/p&gt;
&lt;p&gt;CTest has -I option to select a list of tests to run. The idea here is to convert the log of CTest in format readable by CTest. What I think is great in its answer is that the solution is a CMake script: &lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;FailedFileName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;FailedTests.log&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;EXISTS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Testing/Temporary/LastTestsFailed.log"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;STRINGS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Testing/Temporary/LastTestsFailed.log"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;FailedTests&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;REGEX&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;REPLACE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"([0-9]+):[^;]*"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"\\1"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;FailedTests&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${FailedTests}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;SORT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;FailedTests&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;GET&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;FailedTests&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;FirstTest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;FailedTests&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${FirstTest};${FirstTest};;${FailedTests};"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;REPLACE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;";"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;","&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;FailedTests&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${FailedTests}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;WRITE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;FailedFileName&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;FailedTests&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;else&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;WRITE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;FailedFileName&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;endif&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This test just transforms one file into another. &lt;/p&gt;
&lt;p&gt;You can then run the last failing tests using: &lt;/p&gt;
&lt;pre&gt;cmake -P &lt;the script&gt;
ctest -I FailedTests.log&lt;/the&gt;&lt;/pre&gt;

&lt;p&gt;Very easy, isn't it ? &lt;/p&gt;
&lt;p&gt;There is a limitation to this solution. It won't work when CTest is running in dashboard mode, but it wouldn't take too long to adapt it for that. &lt;/p&gt;
&lt;p&gt;Hope you found that tip useful.&lt;/p&gt;</description><category>C++</category><category>cmake</category><category>Tests</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2012/12/cmake-rerun-last-failed-tests-ctest.html</guid><pubDate>Thu, 06 Dec 2012 07:47:12 GMT</pubDate></item><item><title>Use CMake to easily compiles Latex documents into PDF</title><link>https://baptiste-wicht.com/posts/2012/09/cmake-compile-latex-documents.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;Everyone who compiles Latex documents by hand knows that it is not a panacea. You have to compile the file several times to handle the references. Moreover, if you have a glossary or an index, you have to run others commands between Latex commands so that everything is correctly resolved. The better way to handle Latex compilation is to write a MakeFile compiling each part. However, writing a Latex MakeFile by hand is not easy and especially not interesting. &lt;/p&gt;
&lt;p&gt;Using CMake for most of my development projects, I tried to find a CMake script to generates a MakeFile easily. I did found a good script for that, but I wanted to add some features and change some things, so I forked it to Github: &lt;a href="https://github.com/wichtounet/CMakeLatex" title="CMakeLatex Github repository"&gt;The CMakeLatex repository&lt;/a&gt;. &lt;/p&gt;
&lt;h3&gt;Usage&lt;/h3&gt;

&lt;p&gt;Here is an example using all the features of the script for one of my Latex documents. &lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="nb"&gt;PROJECT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;master_project&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;NONE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;cmake_minimum_required&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;VERSION&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;2.8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;SET&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;LATEX_OUTPUT_PATH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;build&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;INCLUDE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;UseLATEX.cmake&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;GLOB_RECURSE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;contents_files&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;RELATIVE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CMAKE_SOURCE_DIR&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;contents/*.tex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;ADD_LATEX_DOCUMENT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;master.tex&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;INPUTS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;contents_files&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;IMAGE_DIRS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;images&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;BIBFILES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;bibliography.bib&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;USE_INDEX&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;USE_GLOSSARY&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;FILTER_OUTPUT&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To use it, you have to download the files of the repository and put them aside your Latex files (or just make symlinks to the files in a clone of the repository for easy update). Then, the &lt;em&gt;UseLATEX.cmake&lt;/em&gt; file has to be included in your CMakeLists.txt file. &lt;/p&gt;
&lt;p&gt;I think that it is a good practice to generates the Latex files in another directory. This directory can be set using the &lt;em&gt;LATEX_OUTPUT_PATH&lt;/em&gt; variable. &lt;/p&gt;
&lt;p&gt;Then, to add a latex document, you can use the &lt;em&gt;ADD_LATEX_DOCUMENT&lt;/em&gt; function. The first parameter is the name of the main Latex file. After that, you have to give several parameters: &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;INPUTS: It needs the list of Latex files that are included in master file. I use the GLOB_RECURSE function to find all of them in a contents subfolder. &lt;/li&gt;
    &lt;li&gt;IMAGE_DIRS: The directory where the image are stored. They will be copied to the build folder and automatically converted if necessary. &lt;/li&gt;
    &lt;li&gt;BIBFILES: If you have a bibliography, you just have to list all the .bib files of your project. &lt;/li&gt;
    &lt;li&gt;USE_INDEX: Necessary only if your document use an index. &lt;/li&gt;
    &lt;li&gt;USE_GLOSSARY: Necessary only if your document use a glossary. &lt;/li&gt;
    &lt;li&gt;FILTER_OUTPUT: This option activates the filtering of pdflatex output to the console. For now, the option is quite limited, but it allows you to have a smoother output. It has to be taken into account that this option hides the overflow and underflow warnings. &lt;/li&gt;
    &lt;li&gt;CONFIGURE: You can use the CMake configuration feature on some of your files if you want CMake variables to be replaced in the documents. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once your Latex document is configured, you can just run cmake on your project. After that, you can use targets to generate pdf: &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;make pdf: This will generate the Latex file using several passes and running all the necessary commands. &lt;/li&gt;
    &lt;li&gt;make fast: This will generate a pdf in only one pass. This can be useful if you want to see a rough draft of your document quickly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I already use this script for several of my documents. I hope that it will be useful for some of you. If you want any problem in the script or in the generate make file or if you have an idea for improvement, don't hesitate to let a command or to publish an Issue or a Pull Request in &lt;a href="https://github.com/wichtounet/CMakeLatex" title="CMakeLatex Github repository"&gt;the CMakeLatex repository&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;This script only support pdflatex and can only generates pdf directly. If you want latex support with dvi/ps/pdf generation, you should take a look at the original project:  &lt;a href="http://public.kitware.com/Wiki/CMakeUserUseLATEX" title="CMakeUserUseLATEX"&gt;CMakeUserUseLATEX&lt;/a&gt;&lt;/p&gt;</description><category>cmake</category><category>Latex</category><category>Others</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2012/09/cmake-compile-latex-documents.html</guid><pubDate>Mon, 24 Sep 2012 07:07:33 GMT</pubDate></item><item><title>Architexa is available for free - Understand your code base</title><link>https://baptiste-wicht.com/posts/2012/08/architexa-free-understand-code-base.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;&lt;strong&gt;Architexa&lt;/strong&gt; is a tool suite that helps a team to document collaboratively a large Java code base. The tool is made for a whole team to understand a code base. The tool is available as an Eclipse plugin.&lt;/p&gt;
&lt;p&gt;When several developers are working on a large application, it is not always simple to have a whole view of the application. Even with some documentation of the application code. It is even harder for a new developer that joins the project to know what the code base is about. In all these cases, Architexa will help your team. It can also be useful when you inherit an application.&lt;/p&gt;
&lt;p&gt;Starting from today, &lt;strong&gt;Architexa is available for free&lt;/strong&gt; &lt;strong&gt;for individuals and for teams of up to three developers&lt;/strong&gt;. You can read the official announce at the end of the article.&lt;/p&gt;
&lt;h4&gt;My Review of Architexa&lt;/h4&gt;

&lt;p&gt;I tried Architexa on several of my current Java Projects, but never in team. So perhaps my point of view is not very accurate regarding to general users of the tool. I made my tests using Eclipse Juno.&lt;/p&gt;
&lt;p&gt;However, even when working alone on a project, I think that this tool is very useful.&lt;/p&gt;
&lt;p&gt;The installation is very straightforward, you just have to use the update site directly in Eclipse. Then, you have several new options in the EDI to use Architexa features.&lt;/p&gt;
&lt;p&gt;Three diagrams are available in the Architexa tool suite:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Class Diagram&lt;/strong&gt; : This diagram can be automatically generated for a package, or several packages.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Sequence Diagram&lt;/strong&gt; : You can create Sequence Diagrams for some of your program actions.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Layered Diagram&lt;/strong&gt; : This diagram allows you to represent the architecture of your application. The system allows you to represent several levels of details.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can easily have several diagrams of each type in your project. You can store them as local files, in a server or in the community server to make them available for everyone.&lt;/p&gt;
&lt;p&gt;You can add comment in each diagram. In each diagram you can also access the Javadoc of each class. Of course, you can also access any piece of code from your diagrams.&lt;/p&gt;
&lt;h4&gt;Advantages&lt;/h4&gt;

&lt;ul&gt;
    &lt;li&gt;Architexa is very simple to use. The tool have access to very good guides directly inside the IDE.&lt;/li&gt;
    &lt;li&gt;The Real-Time Code analysis is awesome. Once something is in a diagram, it is always kept up to date.&lt;/li&gt;
    &lt;li&gt;The sharing features are also great.&lt;/li&gt;
    &lt;li&gt;Even if there are fews diagrams, I think that there are largely enough to have a very good understanding of a code base.&lt;/li&gt;
    &lt;li&gt;All the graphs looks very nice, there are very readable&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Drawbacks&lt;/h4&gt;

&lt;ul&gt;
    &lt;li&gt;No support for generics and enums.&lt;/li&gt;
    &lt;li&gt;The tool is only available as an Eclipse plugin. I'm especially using IntelliJ Idea and NetBeans.&lt;/li&gt;
    &lt;li&gt;The tool is only available for Java. There is a prototype for C/C++ that is available on demand, but I didn't tried it at the current time.&lt;/li&gt;
    &lt;li&gt;Sometimes, the creation of a very simple diagram takes a bit long time for my feeling. Creating a diagram with three elements can take several seconds. Perhaps, it is better with larger diagrams. I haven't had the occasion to test it with large code .&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Conclusion&lt;/h4&gt;

&lt;p&gt;To conclude, Architexa is a great tool suite. It is useful for any Java developers that works in a large application. It allows them to have better understanding of its code base.&lt;/p&gt;
&lt;p&gt;The official announce: &lt;a title="Architexa Toolsuite is Now Available for Free" href="http://www.architexa.com/blog/architexa-toolsuite-is-now-available-for-free/"&gt;Architexa Tool suite is Now Available for Free&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;More information on the official site: &lt;a href="http://www.architexa.com/"&gt;http://www.architexa.com/&lt;/a&gt;&lt;/p&gt;</description><category>Conception</category><category>Java</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2012/08/architexa-free-understand-code-base.html</guid><pubDate>Wed, 22 Aug 2012 03:00:37 GMT</pubDate></item><item><title>taskwarrior-php 0.1 : A simple PHP Frontend for Taskwarrior</title><link>https://baptiste-wicht.com/posts/2012/07/taskwarrior-php-frontend-0-1.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;I released the version 0.1 of &lt;strong&gt;taskwarrior-php&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This project is a simple PHP Frontend for Taskwarrior. For now, the frontend is quite basic. All the tasks are displayed and sorted by projects. The completion of each project is also computed.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.baptiste-wicht.com/?attachment_id=2035" rel="attachment wp-att-2035"&gt;&lt;img class="size-medium wp-image-2035" title="taskwarrior-php Screenshot" src="https://baptiste-wicht.com/wp-content/uploads/2012/07/taskwarrior-php-1-300x271.png" alt="taskwarrior-php Screenshot" width="300" height="271"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can also insert a new task. For now, only the project and the description of the task can be modified.&lt;/p&gt;
&lt;h3&gt;Download&lt;/h3&gt;

&lt;p&gt;The application is available on the Git repository : &lt;a href="https://github.com/wichtounet/taskwarrior-php"&gt;https://github.com/wichtounet/taskwarrior-php&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The installation is simple, you just have to put all the files in a folder of a PHP server. Then, you have to edit the config.php to set the location of your Taskwarrior files.&lt;/p&gt;
&lt;p&gt;It is necessary that the Taskwarrior files are on the PHP server as well. For that, you can use the FTP pull and push commands of Taskwarrior.&lt;/p&gt;
&lt;p&gt;Don't hesitate to contact me if you have some ideas for this project or if you find some bugs.&lt;/p&gt;</description><category>Linux</category><category>Releases</category><category>Tools</category><category>Web</category><guid>https://baptiste-wicht.com/posts/2012/07/taskwarrior-php-frontend-0-1.html</guid><pubDate>Mon, 09 Jul 2012 07:21:14 GMT</pubDate></item><item><title>Install Valgrind on Gentoo Linux </title><link>https://baptiste-wicht.com/posts/2012/04/install-valgrind-on-gentoo-linux.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;&lt;strong&gt;Valgrind&lt;/strong&gt; is very powerful suite of software for dynamic analysis of binary programs. Valgrind is available in an ebuild on the Gentoo portage tree, but if you want to install valgrind on your Gentoo distribution, there is a problem with the build with the standard library. On Gentoo, the standard C library (glibc) is stripped and Valgrind needs the debug symbols to work. If you try to launch valgrind without the debug symbols, you will get the following error: &lt;/p&gt;
&lt;pre&gt;valgrind:  Fatal error at startup: a function redirection
valgrind:  which is mandatory for this platform-tool combination
valgrind:  cannot be set up.  Details of the redirection are:
valgrind:  
valgrind:  A must-be-redirected function
valgrind:  whose name matches the pattern:      strlen
valgrind:  in an object with soname matching:   ld-linux-x86-64.so.2
valgrind:  was not found whilst processing
valgrind:  symbols from the object with soname: ld-linux-x86-64.so.2
valgrind:  
valgrind:  Possible fixes: (1, short term): install glibc's debuginfo
valgrind:  package on this machine.  (2, longer term): ask the packagers
valgrind:  for your Linux distribution to please in future ship a non-
valgrind:  stripped ld.so (or whatever the dynamic linker .so is called)
valgrind:  that exports the above-named function using the standard
valgrind:  calling conventions for this platform.
valgrind:  
valgrind:  Cannot continue -- exiting now.  Sorry.&lt;/pre&gt;

&lt;p&gt;So first, you have to activate the debug symbols for the libraries in your &lt;em&gt;/etc/make.conf&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;FEATURES="splitdebug"&lt;/pre&gt;

&lt;p&gt;Then, you can emerge again the glibc: &lt;/p&gt;
&lt;pre&gt;sudo emerge glibc&lt;/pre&gt;

&lt;p&gt;If you already had emerged valgrind, there is no need to emerge it again, it should work now. &lt;/p&gt;
&lt;p&gt;And finally, you can emerge valgrind: &lt;/p&gt;
&lt;pre&gt;sudo emerge valgrind&lt;/pre&gt;

&lt;p&gt;And everything will work fine.&lt;/p&gt;</description><category>Gentoo</category><category>Linux</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2012/04/install-valgrind-on-gentoo-linux.html</guid><pubDate>Fri, 13 Apr 2012 06:57:38 GMT</pubDate></item><item><title>Install the Insight Debugger on Linux Mint (works for Ubuntu too)</title><link>https://baptiste-wicht.com/posts/2012/01/install-insight-debugger-linux-mint-ubuntu.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;Insight is a very good debugger based on gdb. I prefer it over ddd or kdbg as I find it clearer and easier to use. Moreover, this debugger is also the one used in the book &lt;strong&gt;Assembly language Step by Step, for Linux&lt;/strong&gt;. However, Insight has been removed from Debian packages already more than a year ago. &lt;/p&gt;
&lt;p&gt;But, thanks to SevenMachines, a PPA repository is available to install it on Linux Mint (works also on Ubuntu and Ubuntu-based Linux distributions). &lt;/p&gt;
&lt;p&gt;To add the repository to your apt sources, add the following lines to the /etc/apt/sources.list file:&lt;/p&gt;
&lt;pre&gt;deb http://ppa.launchpad.net/sevenmachines/dev/ubuntu natty main 
deb-src http://ppa.launchpad.net/sevenmachines/dev/ubuntu natty main &lt;/pre&gt;

&lt;p&gt;and update your apt sources: &lt;/p&gt;
&lt;pre&gt;sudo apt-get update&lt;/pre&gt;

&lt;p&gt;Then you can install insight: &lt;/p&gt;
&lt;pre&gt;sudo apt-get install insight&lt;/pre&gt;

&lt;p&gt;And now you are ready to use Insight as your debugger. &lt;/p&gt;
&lt;p&gt;If you don't trust this PPA repository, you can also try it to install it from the sources (http://sources.redhat.com/insight/), but doesn't seem to very simple to install it. I wasn't able to build it on my Linux Mint 12.&lt;/p&gt;</description><category>Assembly</category><category>C++</category><category>gcc</category><category>Linux</category><category>Mint</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2012/01/install-insight-debugger-linux-mint-ubuntu.html</guid><pubDate>Thu, 26 Jan 2012 08:28:41 GMT</pubDate></item><item><title>Google+ is now open to all</title><link>https://baptiste-wicht.com/posts/2011/09/google-is-open-to-all.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;After about 90 days of trial on invitation-only mode, &lt;a href="http://plus.google.com" title="Google+"&gt;Google+&lt;/a&gt; is now open to everybody. &lt;/p&gt;
&lt;p&gt;For those who don't know, Google+ is the social network platform of Google, with several interesting features like Circles, Hangouts, ...&lt;/p&gt;
&lt;p&gt;For example, you can &lt;a href="https://plus.google.com/103113673902796202116/" title="My Page on Google+"&gt;see my page on Google+&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Personally, I find this social network very interesting, but there are not enough people on it to concurrence really Facebook and the others networks. Don't hesitate to give it a try, it's worth it!&lt;/p&gt;</description><category>Google</category><category>Tools</category><category>Web</category><guid>https://baptiste-wicht.com/posts/2011/09/google-is-open-to-all.html</guid><pubDate>Thu, 22 Sep 2011 12:50:53 GMT</pubDate></item><item><title>How to profile C++ application with Callgrind / KCacheGrind</title><link>https://baptiste-wicht.com/posts/2011/09/profile-c-application-with-callgrind-kcachegrind.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;div&gt;&lt;p&gt;I have shown before how to &lt;a title="Profile a C++ application with the Linux perf tools" href="http://www.baptiste-wicht.com/2011/07/profile-applications-linux-perf-tools/"&gt;profile a C++ application using the Linux perf tools&lt;/a&gt;.  In this post, we will see how to profile the same kind of application using Callgrind. Callgrind is a tool in part of the Valgrind toolchain. It is running in Valgrind framework. The principle is not the same. When you use Callgrind to profile an application, your application is transformed in an intermediate language and then ran in a virtual processor emulated by valgrind. This has a huge run-time overhead, but the precision is really good and your profiling data is complete. An application running in Callgrind can be 10 to 50 times slower than normally.&lt;/p&gt;
&lt;p&gt;The output of Callgrind is flat cal graph that is not really usable directly. In this post, we will use KCachegrind to display the informations about the profiling of the analyzed application.&lt;/p&gt;
&lt;p class="more"&gt;&lt;a href="https://baptiste-wicht.com/posts/2011/09/profile-c-application-with-callgrind-kcachegrind.html"&gt;Read more…&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><category>C++</category><category>Linux</category><category>Performances</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2011/09/profile-c-application-with-callgrind-kcachegrind.html</guid><pubDate>Thu, 01 Sep 2011 06:25:10 GMT</pubDate></item><item><title>How to compute metrics of C++ project using CCCC</title><link>https://baptiste-wicht.com/posts/2011/08/compute-metrics-of-c-project-using-cccc.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;div&gt;&lt;p&gt;CCCC (C and C++ Code Counter) is a little command-line tool that generates metrics from the source code of a C or C++ project. The output of the tool is a simple HTML website with information about all your sources.&lt;/p&gt;
&lt;p&gt;CCCC generates not only information about the number of lines of codes for each of your modules, but also complexity metrics like the McCabe Cyclomatic Complexity level of your modules and functions, design metrics like the coupling between the modules or object oriented metrics like the depth of inheritance tree for each of your classes, ...&lt;/p&gt;
&lt;p class="more"&gt;&lt;a href="https://baptiste-wicht.com/posts/2011/08/compute-metrics-of-c-project-using-cccc.html"&gt;Read more…&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><category>C++</category><category>Linux</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2011/08/compute-metrics-of-c-project-using-cccc.html</guid><pubDate>Tue, 02 Aug 2011 07:18:53 GMT</pubDate></item><item><title>How to profile your applications using the Linux perf tools</title><link>https://baptiste-wicht.com/posts/2011/07/profile-applications-linux-perf-tools.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;div&gt;&lt;p&gt;When an application encounters some performance issues, we have to find the code that causes the problem to optimize only what really matters. &lt;/p&gt;
&lt;p&gt;To find the code we have to optimize, the profilers are really useful. In this post, we'll use the Linux perf tools to profile a simple C++ application. &lt;/p&gt;
&lt;p&gt;The perf tools are integrated in the Linux kernel since the 2.6 version. The perf tools are based on the perf events subsystem. The perf profiler uses hardware counters to profile the application. The result of this profiler are really precise and because it is not doing instrumentation  of the code, it is really fast. &lt;/p&gt;
&lt;p class="more"&gt;&lt;a href="https://baptiste-wicht.com/posts/2011/07/profile-applications-linux-perf-tools.html"&gt;Read more…&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><category>C++</category><category>Linux</category><category>Performances</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2011/07/profile-applications-linux-perf-tools.html</guid><pubDate>Mon, 18 Jul 2011 07:30:45 GMT</pubDate></item><item><title>IntelliJ Idea 10 Early Acces Program is here</title><link>https://baptiste-wicht.com/posts/2010/07/intellij-idea-10-eap-is-here.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;p&gt;Today, the &lt;strong&gt;Early Access Program&lt;/strong&gt; (EAP) has been opened for &lt;strong&gt;IntelliJ Idea 10&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;There is a lot of changes, here are some of them (the most interesting in my point of view) :&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Faster indexing speed&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Java - &lt;strong&gt;Faster method usage search&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Spring Web Services support&lt;/li&gt;
    &lt;li&gt;Spring testing support&lt;/li&gt;
    &lt;li&gt;New Spring live templates (patterns and frameworks)&lt;/li&gt;
    &lt;li&gt;intelligent resources support (smart completion and warnings for resource types)&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Maven Refactorings&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Maven pom.xml editor new features&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Maven Dependencies Diagram&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Discover &amp;amp; download libraries from maven repositories even in plain java projects&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;XML editing improvements&lt;/strong&gt; in IntelliJ IDEA X&lt;/li&gt;
    &lt;li&gt;Git support improvements, including &lt;strong&gt;'Git Log' view&lt;/strong&gt;.&lt;/li&gt;
    &lt;li&gt;Mercurial support&lt;/li&gt;
    &lt;li&gt;Hibernate Criteria API supported&lt;/li&gt;
    &lt;li&gt;JDBC Console UI revised&lt;/li&gt;
    &lt;li&gt;Initial support for AspectJ and Spring Roo frameworks&lt;/li&gt;
    &lt;li&gt;A lot of other interesting features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To consult the full list of new features, read &lt;a href="http://confluence.jetbrains.net/display/IDEADEV/IDEA+X+First+EAP+Release+Notes" target="_blank"&gt;the release notes&lt;/a&gt;. And if you want to test this version, &lt;a href="http://confluence.jetbrains.net/display/IDEADEV/IDEA+X+EAP" target="_blank"&gt;download it here&lt;/a&gt;.&lt;/p&gt;</description><category>IntelliJ Idea</category><category>Java</category><category>Releases</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2010/07/intellij-idea-10-eap-is-here.html</guid><pubDate>Wed, 28 Jul 2010 15:59:40 GMT</pubDate></item><item><title>Discover Java VisualVM 1.3</title><link>https://baptiste-wicht.com/posts/2010/07/discover-java-visualvm-1-3.html</link><dc:creator>Baptiste Wicht</dc:creator><description>&lt;div&gt;&lt;p&gt;2 days ago, &lt;strong&gt;Java VisualVM 1.3&lt;/strong&gt; has been released. We'll see what's new with this release. &lt;/p&gt;
&lt;p&gt;At this time, there is no package for Ubuntu, so we'll install it manually : &lt;/p&gt;
&lt;pre&gt;wget https://visualvm.dev.java.net/files/documents/7163/151728/visualvm_13.zip
unzip visualvm_13.zip&lt;/pre&gt;

&lt;p&gt;And then we can directly launch it : &lt;/p&gt;
&lt;pre&gt;cd visualvm_13/bin
sh visualvm&lt;/pre&gt;

&lt;p&gt;You'll be asked for the license agreement and after that the tool is launched : &lt;/p&gt;
&lt;p&gt;&lt;a href="https://baptiste-wicht.com/wp-content/uploads/2010/07/VisualVM-1.3-Startup.png"&gt;&lt;img src="https://baptiste-wicht.com/wp-content/uploads/2010/07/VisualVM-1.3-Startup-300x159.png" alt="VisualVM 1.3 Startup" title="VisualVM 1.3 Startup" width="300" height="159" class="size-medium wp-image-848"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class="more"&gt;&lt;a href="https://baptiste-wicht.com/posts/2010/07/discover-java-visualvm-1-3.html"&gt;Read more…&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><category>Java</category><category>Performances</category><category>Releases</category><category>Tools</category><guid>https://baptiste-wicht.com/posts/2010/07/discover-java-visualvm-1-3.html</guid><pubDate>Wed, 28 Jul 2010 05:10:31 GMT</pubDate></item></channel></rss>