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.

Microsoft Announces SQL Server ODBC Driver for Linux!

Thanks to my, hopefully, open minded attitude, I sometimes let myself to dive into unknown with honest hope to find unexpected.

Today at lunchtime I let myself loose across Twitter archives and I came across an interesting account, or I rather should say: I fell into evil ways. It is @OpenAtMicrosoft. Hmm, another marketing specialist at Microsoft buzz’ing about the NKTOB ™, means new keyword on the block. Or, it is just Microsoft twitting daily menu from their newly opened cafeteria. But now, they presumably say what they mean:

source for info on Microsoft and interoperability, open source and open standards

By the way, it is a foothold of Interoperability @ Microsoft. (For those who may have problems with interpreting the @ sign, like my grandfather for example, it means the same as English word “at” as in Kids at the House.)

In spite of that my eyes nearly dried out of the openness, I went for it and skimmed and voil?: Microsoft Announces SQL Server ODBC Driver for Linux!. It will soon be widely available to customers. Yay!

Yes, you read that right

It’s an evil good news of the day and I’m keen in trying it out as soon as I polish the ODBC backend in SOCI. I hope to stop worrying about which one to use, unixODBC or iODBC, for SQL Server at least. Life may become easier for OGR SQL Server driver users too.

I also hope, Microsoft will consider to offer the fastest development environment for C/C++ programmers for Linux. Namely, Visual Studio.

Yes, I am radically open minded. I can take on the most incredible of challenges, even surfing an inflatable crocodile.

Interface Versioning in C++ Video

Friends from Skills Matter has put video with lecture about Interface Versioning in C++ given by Steve Love last Thursday. The lecture was organised by London chapater of ACCU.

Generally, Steve addressed problems of the DLL Hell and ABI compatibility proposing a not-so-simple, but applicable and usable solution for number of most common problems. Along the video, slides are also available, so it should be easy to grasp the idea.

I’ve received copy of Steve’s code and I’m preparing a few more tests which I hope to describe in details and post here soon.

parallel_sort crashes on Ubuntu 9.10

I’ve started to experiment with the Intel Threading Building Blocks and hit a wall trying to run a very simple example:


#include <tbb/parallel_sort.h>
#include <cmath>
#include <vector>
using namespace tbb;
int main()
{
    const int n = 100000;
    std::vector<double> a(n);
    for (int i = 0; i< n; i++)
    {
        a[i] = std::sin(double(i));
    }
    parallel_sort(a.begin(), a.end());
}
$ g++ -O0 -g -DTBB_USE_DEBUG  -o sort_vector sort_vector.cpp -ltbb
$ gdb ./sort_vector

(gdb) run
Starting program: /home/mloskot/workshop/tbb/parallel_sort/sort_vector
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
tbb::task_group_context::init (this=0x7ffffff9c4e0) at ../../src/tbb/task.cpp:3124
3124    ../../src/tbb/task.cpp: No such file or directory.
in ../../src/tbb/task.cpp
(gdb) bt
#0  tbb::task_group_context::init (this=0x7ffffff9c4e0) at ../../src/tbb/task.cpp:3124
#1  0x00000000004013ff in task_group_context (this=0x7ffffff9c4e0, relation_with_parent=tbb::task_group_context::bound)
at /usr/include/tbb/task.h:284
#2  0x0000000000401be4 in tbb::internal::parallel_quick_sort > (begin=0x7ffffff9c6a0,
end=0x7fffffffe120, comp=...) at /usr/include/tbb/parallel_sort.h:155
#3  0x0000000000401b23 in tbb::parallel_sort > (begin=0x7ffffff9c6a0, end=0x7fffffffe120,
comp=...) at /usr/include/tbb/parallel_sort.h:203
#4  0x0000000000401ab3 in tbb::parallel_sort (begin=0x7ffffff9c6a0, end=0x7fffffffe120)
at /usr/include/tbb/parallel_sort.h:219
#5  0x0000000000401363 in main () at sort_vector.cpp:12

It seems like a failure during initialization of worker threads pool or close to it.

I’m using fairly recent version of TBB 2.1 installed from Ubuntu 9.10 packages, but I’m suspicious this may be a problem with this particular binary version. Let’s see what Intel folks will judge parallel_sort example throws segmentation fault. Pity Microsoft PPL does not provide parallel_sort algorithm.

Update: see parallel_sort problem fixed

Firefox-based attacks on irc.freenode.net

Activity of the OSGeo Community quite heavily relies on the Freenode IRC network, so this may be an interesting news:

hackers are exploiting a weakness in the Mozilla Firefox browser to wreak havoc on Freenode and other networks that cater to users of internet relay chat.

Here is the whole story Firefox-based attack wreaks havoc on IRC users posted to The Register

hacker emblemMr Dan Goodin, I would wish you don’t cultivate the mainstream media alignment regarding the use of word hacker. Don’t call a hacker someone who has unlawful intentions, please.