Visual Studio 11 visualizers for Boost.Geometry

Some time ago Barend Gehrels blogged about Visual Studio 2010 debugger visualizers for Boost.Geometry. Barend’s templates added to autoexp.dat file are of great help while working with the Boost.Geometry library in Visual Studio.

Recently, I’ve started using Visual Studio 11 Developer Preview and discovered the new style debugger visualizers this new edition introduces. I decided to port Barend’s work to the new XML-based format in .natvis files.

vs11-visualizers-boost-geometry

All my visualizers, not only for Boost.Geometry but also for other libraries, are available in visualstudio11 Git repository on my GitHub. The .natvis files are not overly complicated and the installation is dead easy, see README file attached.

Comments, suggestions and fixes are welcome.

File version is not supported by the launcher

UPDATE: This bug (see below) has been fixed a few days ago. The fix is available in CMake git repo and should be release in the upcoming CMake 2.8.7 release.

What is the difference between these two Visual Studio solution (.sln) files?

vs11-cmake-sln-version-compare

They both have been generated using CMake 2.8.6. However, having Visual Studio 11 Developer Preview installed, every time I try to launch the Hello2011.sln I’m getting mysterious error message: File version is not supported by the launcher.

Quick look at what CMake actually outputs in to .sln confirms there is a bug. CMake generates .sln file signature which does not match release version/name of the Visual Studio 11. In Hello2011.sln CMake generated:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2011

but correct version of the output, fixed in Hello11.sln, is this:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 11

Bug report submitted to CMake developers.

By the way, I have to admit different icons displayed for correct and incorrect .sln file are quite useful.

FindBoost.cmake patched for Visual Studio 11

My patch updating CMake module FindBoost.cmake for Boost C++ Libraries lookup has been accepted and committed to the CMake Git repository. Thanks to Brad King for quick review.

The patch adds most recent versions of Boost 1.47 and 1.48 to the lookup table and uses correct toolset tag vc110 (see Library Naming) when checking for libraries built using Visual Studio 11.

Building Boost with Visual Studio 11 Developer Preview

Yesterday, I installed Visual Studio 11 Developer Preview. The new release is available for free and is usable for free until June 2012, so it’s a great opportunity to try and learn what Microsoft has to offer for C++ programmers. And, it looks it offers a lot, including SCARY features.

The first test I usually do when it comes to test a new C++ toolset is to build Boost C++ Libraries using mainstream development sources.

The Boost simply builds well. I have even configured build of Boost.Python using Python version 3.2.

There are no hacks required to make the build happen. Simply, follow Boost Getting Started on Windows, section 5.3. Or, Build Binaries From Source. Once the Boost.Build tools bootstrapped, I issued the following command:

b2 --toolset=msvc variant=debug runtime-link=shared threading=multi define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE stage

Fifteen minutes later, the Boost build was ready and staged.

By the way, some time ago Christian Henning posted a quick cheat sheet of bjam commands for Visual Studio. It’s very handy.

Update on SqlGeometry and POINT EMPTY in WKB

Long time ago I discussed about how SqlGeometry handles POINT EMPTY in WKB format. The SqlGeometry states the definition of OGC GEOMETRY type for Microsoft SQL Server. Shortly, the message was that SqlGeometry implicitly casts POINT EMPTY to MULTIPOINT EMPTY geometry when generating WKB output. PostGIS casts as well, but does it in a consistent way, in my opinion, outputting GEOMETRYCOLLECTION.

Following those findings, I assumed it is not quite correct, or I didn’t like the inconsistency, and I had reported it to Microsoft Connect as a bug: SqlGeometry reports invalid type of WKB of POINT EMPTY.

Recently, I have received a couple of comments from Microsoft to my report. The comments are attached to the report linked above, but I paste them below for completeness and archive:

Our development team for the spatial data types tells me that it is not possible to use a single value for the WKB format of any spatial data type. For the POINT EMPTY, the WKB format does not allow empty points, so we are outputting a MULTIPOINT with zero elements.
In a MULTIPOINT EMPTY, we are stripping out empty points.

The reasoning is technically correct. It’s just Microsoft does it differently. However, as second comment suggests, the current behaviour may change in future:

But we might consider changing it to get consistent behavior.

Preparing for Subversion to Git migration

GEOS is slowly moving to Git, so I decided to clear the Subversion specific settings, namely the svn:keywords. The procedure is quick and based on the commands I used to perform bulk svn:keywords property update.

First, svn:keywords property is removed:

find . -path '*/.svn' -prune -o -type f -print  | xargs svn propdel -q svn:keywords

Next, line consisting of $Id$ keyword is stripped from every plain text file using a tiny script coded in Python:


#! /usr/bin/env python
import fileinput
import re
import sys

def strip_line(filename, rx):
    sys.stderr.write(filename + '\n')
    for line in fileinput.input(filename, inplace=1):
        m = re.match(rx, line)
        if m is None:
            sys.stdout.write(line)
        else:
            sys.stderr.write(line)

if len(sys.argv) < 2:
    sys.exit("Missing filename")

pattern = '^.*\$Id.*$'
rx = re.compile(pattern, re.DOTALL)
strip_line(sys.argv[1], rx)

The script is executed for every file, excluding the working copy admin area in .svn:

for f in `find . -path '*/.svn' -prune -o -type f -print`; do ~/bin/strip_line_regex.py $f; done;

Voila!

Update: Torvalds answers Does GIT has vc keywords like CVS/Subversion?

Boost.GIL IO and Toolbox extensions accepted into Boost

I have just announced results of the formal review of IO and Toolbox extensions for Boost Generic Image Library (GIL). Shortly, formally, the review concluded with 1 NO and 7 YES votes what means both extensions have been accepted into Boost C++ Libraries.

The task has been finished, but the mission is still ongoing. Lubomir Bourdev (Adobe) – Boost.GIL lead developer summarised it quite well:

The problem with I/O is that you can never declare success.
All we can hope for is push the boundary as much as we can, and leave the rest for the next update.

Christian Henning has done great job developing the extensions and reviewers confirmed it. It was pleasure for me to manage the review process.