como adventures with boost/cstdint.hpp

While compiling a program that uses boost/cstdint.hpp from Boost Integer Library:

#include <iostream>
#include <boost/cstdint.hpp>
int main()
{
    boost::int64_t i64 = -2;
    boost::uint64_t ui64 = 2;
    boost::uint64_t d = ui64 - i64;
    std::cout << d << std::endl;
    return 0;
}

front-end of Comeau C/C++ 4.3.10.1 compiler complains:

boost/cstdint.hpp", line 111: error: the
          global scope has no "int64_t"
    using ::int64_t;
            ^

However, if I reorder include directives:

#include <boost/cstdint.hpp>
#include <iostream>

then the program compiles well.

I believe that the order of header files should not be relevant here, but seems it is. I’ve submitted a ticket #3548 to Boost.Integer and I’m curious awaiting the diagnosis.

After this issue is fixed, I’m looking forward building the Generic Geometry Library using Comeau C/C++ compiler. This should help us to maintain high quality of standard and yet more portable C++ code.

mloskot @ boost regression tests

I run Boost C++ Libraries regression tests for the first time today. The test driver is brilliant. It’s a single python script run.py that takes care of all aspects of regression tests run: gets build system, builds bjam (a clever make equivalent) if not available, grabs Boost source tree, builds Boost libraries, runs tests, combines tests reports to single XML files and uploads it to server in secret location. All this by single command:

python run.py --tag="trunk" --runner="mloskot-x86_64" \
   --toolsets="gcc" --bjam-toolset="gcc" --bjam-options="-j4"

Then, a scheduled magic on the server crunches all uploaded reports and builds detailed summary of regression tests. My builder is called mloskot-x86_64.

That is really a user friendly infrastructure of running regression tests and it allows an average Boost user to contribute in testing.

Testing libLAS with CMake

libLAS - ASPRS LiDAR data translation toolset As a part of CMake configuration for libLAS, I’ve enabled support CTest. It is CMake test driver program that can be used to run automated tests and perform continuous integration. I also registered libLAS at CDash testing server.

CDash aggregates, analyzes and displays the results of software testing processes submitted from clients located around the world

Check libLAS dedicated quality dashboard registration is required it is public project and available for anonymous visitors to browse the dashboard (thanks to Julien from Kitware for quick fix).

Anyone who is would like to build libLAS using CMake and run tests can find details on the CMake article on the Wiki. I would also encourage interested users to issue make Continuous to submit test results to the dashboard.

Feedback kindly wanted!

osgeo.codepad.org

Online compilers are another generation of collaborative debugging tools delivered to Open Source communities. The overall idea is great. Actually, I can not imagine online discussions on IRC channel without being able to paste code snippets or compilation logs.

The codepad.org provides feature called private and project pastes. Some time ago I proposed private general purpose paste service dedicated to OSGeo communities. it is hosted at osgeo.pastebin.com and people has found it useful, as I can see. Today, I registered osgeo.codepad.org – a programmers-oriented paste service. Perhaps, people will find it useful too..

Users of the World’s second best programming editor, Vim (first place taken by Emacs), can install codepad.vim plug-in and send Vim buffers as pastes directly to the codepad.org service. Kudos to Nicolas Weber for the plug-in!

I’ve taken the liberty and modified the plug-in to use the private service at osgeo.codepad.org – here is custom codepad.vim plug-in.

Compile-time unit tests

Boost Build V2 includes testing module that provides nice features for running unit tests. A unit test run means a test builds and can be executed performing checks in run-time, however, a unit test can be also based on compilation or even linking result. Yet more surprisingly, sometimes a test is expected to not to compile and such failure is considered as success. It performs compile-time checking in design by contract.

In Generic Geometry Library, some tests use that feature of testing compilation result. For example, this way it’s possible to test the concepts in practice and to ensure that various constructs are not accepted by the library as expected by design.

For example, custom_linestring.cpp source file can be used to perform compile-time and run-time testing. If TEST_FAIL_APPEND is defined, unacceptable constructs are compiled and the compilation is expected to fail. If compiled without TEST_FAIL_APPEND defined, only acceptable code is enabled and regular run-time test performed.

Configuration of such thing is very easy with Boost Build V2. Here is Jamfile.v2 that performs the test for geometries in Generic Geometry Library using compile-fail rule:

test-suite ggl-geometries
    :
    [ compile-fail custom_linestring.cpp
        : # requirements
        <define>TEST_FAIL_APPEND
        : # target name
        custom_linestring_test_fail_append
    ]
    [ run custom_linestring.cpp ]

There are among others also rules like compile, link-fail and link.

The unit tests execution is simple:

mloskot@dog:~/dev/ggl/_svn/trunk/libs/ggl/test/geometries$ bjam | grep passed
**passed** bin/custom_linestring_test_fail_append.test/gcc-4.4.1/debug/custom_linestring_test_fail_append.test
**passed** bin/custom_linestring.test/gcc-4.4.1/debug/custom_linestring.test

Windows 7 in da House

windows7-inside-linuxThanks to the genuine deal Microsoft offered to students of developing countries – where else*** students really need cheap software than in UK and US – I purchased legal copy of Windows 7. Windows 7 Professional. Windows 7 Professional 64-bit!

Computer says no!

I like the new Windows 7 as much as a Unix-devoted user can like Windows way of use of OS. However, no joy without annoy and along with delivering modern operating system Microsoft definitely and absolutely has earned Darwin Award by providing users with easy and friendly purchase & setup process.

To make the long story short, basically you complete clean installation of Windows 7 without giving the Product Key (don’t even waste time on trying, Microsoft will reject it as invalid), next you carry out upgrading the newly installed Windows 7 to…Windows 7 and then you are able to successfully register and activate your legal copy of the system.

Ah, and don’t forget to feel the lovely pain in the arse while preparing bootable ISO. That fun is so worth those thirty quid I paid for the Windows 7, hehe.

Microsoft says yes!

On the Microsoft Answers:

Hello Everyone,

I wanted to let everyone know we are aware of this issue and we are actively working with Digital River for a resolution.

We will post back when we have a solution.
Michael
Microsoft Answers Support Engineer

Oh, gosh, I need to be quick with e-mailing Wendy with my proposal of Microsoft nomination.

After quite long and silly battle, I finally installed Windows 7 Professional 64-bit on my computer. Actually, on Virtual Machine running under control of VirtualBox (Sun, I love you!) inside Linux.

Dear Microsoft, I’m impressed. I like Windows 7.

Update 2009-10-27T22:07:44: Also ZDNet UK posted that Windows 7 upgrade poses problem for students and linked to article with statement from Microsoft.

*** Poland is a rich country. Polish are rich people. Microsoft knows that and asks ~25-30% more for their software. Not like in developing countries, UK or US, where they try to make their software affordable to help people to in studying or running small businesses. So, if you live in Poland and you don’t want to overpay for Microsoft software, buy it in US. Ask your aunt (every Polish has auntie in US) to buy a box for you and ship it to Poland. It is legal. I called Microsoft Poland and confirmed it is legal to buy their software in US, bring it to Poland and use it in Poland. Sweet.