Product News

New optimizations for X86 in upcoming GCC 5.0 -- Evgeny Stupachenko

Fresh on the Intel Developer Zone blog:

New optimizations for X86 in upcoming GCC 5.0

by Evgeny Stupachenko

From the article:

Part 1. Vectorization of loads/stores group.

GCC 5.0 significantly improves vector code quality for load groups and store groups. By loads/stores group I mean iterated consecutive sequence of loads/stores. For example:

x = a[i], y = a[i + 1], z = a[i + 2] iterated by “i” is loads group of size 3

...

The most frequent case where loads/stores groups are applicable is array of structures.
  1. Image conversion (RGB structure to some other) ...
  2. N-dimentional coordinates. (Normalize array of XYZ points) ...
  3. Multiplication of vectors by constant matrix: ...

... GCC 5.0:

  1. Introduces vectorization of load/store groups of size 3
  2. Improves load groups vectorization for all supported sizes
  3. Maximizes load/store groups performance by generating code that is more optimal for particular x86 CPU...

 

Facebook Flint: Public domain C++ lint

Some months ago Facebook brought their C/C++ Facebook-Lint (Flint) analyzer into public domain and made it available on github.com/facebook/flint. Flint provides a lint framework and a number of C++11/14 style rules that we have found useful in our company.

This static code analyzer is not based on a C++ parser, but works with a tokenizer, completely written in D. (The previous C++ version of the program is still part of the repository.) 

Andrei Alexandescu gives detailed information in his blog entry:

Under the Hood: Building and open-sourcing flint

by Andrei Alexandrescu

... Writing a C++ linter in particular is not for the faint of heart because of C++'s high barrier to entry for parsing. That said, there are now dozens of C++ lint programs with a variety of features, some open sourced. So the natural question is why we chose to write our own instead of using a pre-existing one.

When we started this project, the lint programs we tried were too slow and most didn't support the C++11 features that our codebase had already started to use. Clang, which today would be logical starting point for a C++ analysis tool, offered too little support back then...

The distributed makefile is designed to work on Mac OS and Linux. But it is pretty easy to build a working flint.exe for Windows with Visual Studio and an installed D compiler and the corresponding plugin.

We prefer in our company either pairing or code reviews to ensure a high code quality. But we decided to use Flint as an additional safety-net and since the speed of the analyzer is so amazingly high, we were able to integrate it into the pre-commit hook of our Mercurial repository without any noticable performance drawbacks. So all to be committed C++ files are checked against a subset of all rules, that Flint supports.

(We disabled some Flint rules in the source code, because of missing C++11 capabilities of Visual Studio 2012/2013 and certain checks that does not make sence in our context.)

Consider automatically applying a lint tool in your project build. Whether you pick this or another one, it's worth checking out.

Poco C++ Library release version 1.4.7p1

POCO Development Release 1.4.7p1 Available

This release fixes a few issues in 1.4.7 and earlier releases. Most important, the Visual C++ project files for Visual C++ 2010 and later have optimization enabled in release builds. Previous builds had optimization disabled due to a bug in Visual Studio when upgrading 2008 project files with custom optimization settings.

There’s a new feature as well – HTTPClientSession now supports a global proxy setting, which will be used by all instances of HTTP(S)ClientSession, including HTTP(S)StreamOpener.

Detailed information is available in the CHANGELOG.

Free CppCat for Students

CppCat is a static code analyzer integrating into the Visual Studio 2010-2013 environment. The analyzer is designed for regular use and allows detecting a large number of various errors and typos in programs written in C and C++. For the purpose of popularizing it, we've decided to launch a student-support program granting free licenses to every higher school student who will contact and ask us about that. You just need to send us a photo of your student card or transcript.

A few words about static code analysis

Static code analysis tools draw the programmer's attention to those fragments which are very likely to contain errors. Here's a simple example:

double var_z;

....

var_z = ( var_z - 16 / 116 ) / 7.787;

This code is correct from the viewpoint of the language and compiler. It's just a regular situation when division of the integer number 16 by integer number 116 results in 0. Expressions like that are necessary sometimes. However, the analyzer takes a wider perspective of the code and detects an error pattern: if the result of such an integer division is then used together with the double type, it may signal something is wrong.

The analyzer will draw your attention to this suspicious division with the following warning: V636 The '16 / 116' expression was implicitly casted from 'int' type to 'double' type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) / Y;. color.c 125

The code was most likely meant to look as follows:

var_z = ( var_z - 16.0 / 116.0 ) / 7.787;

The division now results in 0,137931 instead of 0.

Static analysis tools can be treated as an extension to compiler warnings. Unlike the compiler, analyzers deal with higher-level constructs and rely on empirical methods trying to guess if the code works the way the programmer wanted it to.

A few words about the CppCat analyzer

CppCat is a static code analyzer which is easy to set and use. It is an excellent tool to get started with the static analysis methodology. It is not as powerful as its big brother PVS-Studio (see their comparison), but it is more than sufficient for most tasks. In any case, CppCat's functionality is surely quite enough for students and single developers.

The analyzer can integrate into Visual Studio 2010, 2012, 2013. Unfortunately, it can't integrate into Express editions and we can't help it as Visual Studio Express editions don't support plugins.

The analyzer supports the following languages: C, C++, C++/CLI, C++/CX.

An important feature of the analyzer is an automated analysis of freshly modified code. After compilation of modified files is finished, CppCat starts analyzing the code in background and displays a warning whenever anything suspicious is found. This feature allows programmers to detect errors at the very early development stage and thus save time on bug search and fixes.

You can download CppCat from the product's website: http://www.cppcat.com

How to get a CppCat license

Using CppCat will help you in acquiring skills of working with static analysis tools and improving your qualification. Static analyzers are growing more and more popular nowadays, so it'll be just good if you can specify in your résumé that you know how to use these tools.

To get a license you just need to send to our email team@cppcat.com a photo or scan of your student card, transcript or other document confirming that you are a higher school student. Please specify your first and second name and the name of your university as it might be very difficult to make out this information from the photo. These data will be used to generate your personal registration key.

The license will be valid through 1 year. If you wish to be able to use CppCat after that, you will have to send us a new photo of your student card.

Cevelop Updated for the Eclipse Luna Service Release 1 -- Mirko Stocker

News about Cevelop, a C++ IDE for professional developers from the Institute for Software at HSR Hochschule für Technik:

Cevelop Updated for the Eclipse Luna Service Release 1

by Mirko Stocker

From the announcement:

We have rebased Cevelop on top of the latest Eclipse Luna Service Release SR1. The Eclipse CDT team used the chance to include some new features. For example, code completion can now show default arguments and gives you more information on template parameters... See the CDT 8.5 changelog for a comprehensive list of changes.

Visual Studio 2015 Preview announced, includes Clang/LLVM support for Android, iOS

This morning, Microsoft announced Visual Studio 2015 Preview. It contains continued C++11/14 conformance improvements in the traditional Visual C++ compiler, and also adds direct support for the Clang/LLVM compiler toolchain to build C++ code for Android now and iOS in the near future.

Cross-Platform Mobile Development with Visual C++

by Ankit Asthana

From the announcement:

Modern application customers are demanding applications be available for multiple device platforms (such as Windows, Android and iOS).... C++ is unique as it provides the ability to write efficient, fast and feature rich cross-platform mobile code once which can then be shared across these different device platforms.

Visual Studio 2015 Preview introduces support for developers to be able to build cross-platform mobile native (C/C++) binaries targeting Windows platforms (through the Visual C++ toolchain C1xx/C2) and the Android platform (through Clang/llvm)...

Introducing Proxygen, Facebook's C++ HTTP framework -- Daniel Sommermann and Alan Frindell

proxygen.PNGFresh from Facebook's coding blog:

Introducing Proxygen, Facebook's C++ HTTP framework

by Daniel Sommermann and Alan Frindell

From the announcement:

We are excited to announce the release of Proxygen, a collection of C++ HTTP libraries, including an easy-to-use HTTP server. In addition to HTTP/1.1, Proxygen (rhymes with "oxygen") supports SPDY/3 and SPDY/3.1. We are also iterating and developing support for HTTP/2. ...

Proxygen began as a project to write a customizable, high-performance HTTP(S) reverse-proxy load balancer nearly four years ago. We initially planned for Proxygen to be a software library for generating proxies, hence the name. But Proxygen has evolved considerably since the early days of the project. While there were a variety of software stacks that provided similar functionality to Proxygen at the time (Apache, nginx, HAProxy, Varnish, etc), we opted go in a different direction...

spdlog: Fast C++ logging library

Just announced:

spdlog: Super fast C++ logging library [GitHub]

The description is really "in a nut":

Very fast, header only, C++ logging library.

Install: Just copy the files to your build tree and use a C++11 compiler

Features:

  • Very fast -- performance is the primary goal (see becnhmarks below)
  • Headers only
  • No dependencies
  • Cross platform - Linux / Windows on 32/64 bits
  • Mult/Single threaded loggers
  • Rotating log files
  • Daily log files
  • Console logging
  • Optional async logging
  • Logging levels
  • Custom formatting with user defined patterns

Boost 1.57.0 has been released

Some welcome news from Boost.org...

Boost 1.57.0 has been released

These open-source libraries work well with the C++ Standard Library, and are usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use.

This release contains one new library and numerous enhancements and bug fixes for existing libraries.

Read the full announcement for all the details, and for download links.

HPX version 0.9.9 released -- STE||AR Group

The STE||AR Group has released V0.9.9 of HPX -- A general purpose parallel C++ runtime system for applications of any scale.

HPX V0.9.9 Released

The newest version of HPX (V0.9.9) is now available for download! Please see here for the release notes.

HPX now exposes an API fully conforming to the concurrency related parts of the C++11 and C++14 standards, extended and applied to distributed computing.

From the announcement:

  • We completed the refactoring of hpx::future to be properly C++11 standards conforming.
  • We overhauled our build system to support newer CMake features to make it more robust and more portable.
  • We implemented a large part of the parallel algorithms and other parallel facilities proposed by C++ Technical Specifications N4104, N4088, and N4107.
  • We added many examples such as the 1D Stencil and the Matrix Transpose series.
  • We significantly improved the performance of the library and the existing documentation