C++ Frontend Tales

All | Boost | General | Loki
« Previous page | Main

20060301 Wednesday March 01, 2006

Test results by category

Here you can find more detailed BOOST test results. The main difference between Studio 10 and Studio 11 results is in the MPL library. Failed Serialization and Variant tests are two known bugs. I almost ready to integrate a fix for one of them.
Permalink Comments [1]

20060226 Sunday February 26, 2006

Two small steps

Sorry, small improvements only.

  Studio 11 Studio 10
Pass 697 726
Warn 154 155
Fail 98 68

Now users of Sun Studio C++ is able to define template friend function in the class body.

% cat test.cc
template 
struct S
{
    typedef T type;

    template 
    friend
    void foo(U p1, S & p2)
    {
        // compiler could not find S and T
        typename S::type v;
        T p;
    }
};

And use dependent template types with nested template arguments (see example below).

struct S
{
    template < class SigArgs >
    struct sig
    {
        typedef typename SigArgs :: head_type type;
    };
};

template 
struct cons
{
    typedef Z head_type;
};

// compiler could not deduce return type
template 
typename T1 :: template sig < cons  > :: type
foo(T1, T2);

void test()
{
    S v;
    int i = foo( v, 1 );
}

Permalink Comments [2]

20060210 Friday February 10, 2006

Yes, I did it again...

Actually I don't like that kind of music. But it's not the main today news topic. I reduced amount of failed tests again. Good job, isn't it? Link on the right side of this page goes to the updated patch for Boost 1.32.0. And it looks like we start to prepare new patch for Studio 10 and Studio 11. I will keep you informed.

  Studio 11 Studio 10
Pass 688 717
Warn 153 154
Fail 108 78

Permalink Comments [0]

20060206 Monday February 06, 2006

Boost patches, C++ patches etc

There are no good news related to Boost regression test results. So to keep blog alive I want to answer some questions.

I build Studio 10 and Studio 11 compiler from the latest source code run Boost regression test and post results. Therefore external users right now can not obtain the same results. All fixes of C++ compiler's bug go to the next official patch. I don't have resources to run Boost tests with latest released patches regularly. But I plan to post a note here when new C++ patch is released, run Boost tests and post results. So we can compare our results.

Boost regression tests log is about 3Mb and I have 3Mb of disk space for this blog. I would be happy to post log files here but it's impossible.

In my previous post I mentioned Boost contains features which will be (or would be) included in the upcoming C++ standard. Actually, if we take a look at C++ standard proposal and Boost source code, Boost almost doesn't use any non-standard extensions to C++ itself. Some Boost libraries are candidate to include in the std namespace. So the main problem is in our compiler not Boost source code, though Boost source code need to be fixed too (__SUNPRO_CC usually point to place of fixes).

Why don't I post my patches to Boost community? Nothing important. Just time limit. Some of my fixes (small part) have been included in the Boost source code. Now I concentrate on bug fixing and work with Boost 1.32.0 mainly. When failed test rate drops under the 40-50 I switch to Boost 1.33.1 and post my fixes to Boost again. Why Boost 1.32.0? Because I think users prefer to have the most stable (not the latest) Boost release. Though my work is attempt to make the latest Boost release the most stable one. When I say 'stable' I mean the most compatible with Sun Studio C++.

Fell free to ask me more.
Permalink Comments [1]

20060202 Thursday February 02, 2006

Boost serialization

Almost all serialization tests are failed now. Some tests can't be linked and the other ones linked successfully but produce incorrect results. Link errors related to stlport. It looks like stlport should be linked as static library for this tests. I will check it. More complicated error breaks other tests. Test case below shows this bug:

% cat test.cc
struct S
{
    template 
    void operator+(T & t)
    {
        const_cast(t);
    }
};

void foo()
{
    int array[] = {777};
    S s;
    s + array;
}

% CC -c test.cc
"test.cc", line 14: Error: The operation "S + int*" is illegal.

Permalink Comments [1]
It's time to explain something

You know, Sun Studio C++ is a good compiler: excellent backend, OMP support etc. But it does not work with a very popular open source library - BOOST. There are a lot of open source libraries. Why support of BOOST is so important? I think BOOST is one of the most useful libraries for C++ development (I used it intensively when I worked here) and even more - it contains some features which will be included in the upcoming version of C++ standard.

I think it's time to include Sun Studio C++ in the list of compiler fully compatible with BOOST. A lot of work has been done already but there are some bugs still need to be fixed. I will post notes in this blog to inform community about course of events. Also I will post patches for BOOST. Sure I plan to send BOOST patches to developers and they will be included in the official BOOST release.

Somebody ask me about patches for Sun Studio C++. Sorry, I can not do that here. You can take patch from official site. Please keep in mind the test results posted on this blog obtained with latest version of compilers. Corresponded fixes will be included in the next patch for Sun Studio C++. I've just start to discuss with my manager and colleagues how to change schedule of patch releases. In other word I suggest to release patch for Sun Studio C++ regularly. For example once a month. If this idea is accepted moment of patch release with necessary fixes will be more predictable.

BTW any feedback from you is very helpful and necessary for me.

U-u-f, sorry for my English.
Permalink Comments [2]

20060201 Wednesday February 01, 2006

Updated Boost Regression Test Result

Congratulate me! I've just integrated my latest fix and got Boost 1.32 test results. Sun Studio C++ 10 breaks 169 tests only. Sun Studio C++ 11 is very close to 200 boundary.

  Studio 11 Studio 10
Pass 627 658
Warn 113 114
Fail 201 169

Permalink Comments [2]

20060130 Monday January 30, 2006

Boost 1.33.1

I've just made an attempt to build Boost 1.33.1 by Sun Studio 11. This patch reduces number of failed target to 28. There are two type of errors: "Initializing <variable name skipped> requires an lvalue" and "Redefining <type name skipped>". The first one can be reduced to following testcase:

struct S
{
    template <typename T>
    struct D
    {
    };
};

template <typename T1, typename T2>
typename T1 :: template D<T2> & foo();

void f()
{
    S::D<int> & v = foo<S, int>();
}

So now I'm working on this bug.
Permalink Comments [1]

20060126 Thursday January 26, 2006

Boost 1.32.0 Mini HOWTO Boost 1.32.0 Mini HOWTO

1 Boost Version

This HOWTO describes Boost - 1.32.0. This version with applied patch is supported by Sun Studio C++ compiler so I recommend to use it now. I do not plan to make a patch for Boost 1.33.1 because upcoming Boost 1.34 works with Sun C++ well out of the box. Please note, Sun Microsystems does not support Boost library, i.e. we do not and we will not fix bugs in it. Please ask Boost developers.

2 Patch Boost

This file contains all necessary fixes to Boost 1.32.0. You should use gnu patch.

     tar xfj boost_1_32_0.tar.bz2
     cd boost_1_32_0
     gpatch -p1 < ../boost_1_32_0.patch

3 Build Bjam

The Boost build system uses BJam, an extension of the Perforce Jam portable make replacement. Unfortunately there is no prebuilded binary version of bjam for Solaris. But we are professionals, aren't we? So let's build bjam. Suppose BOOST is the Boost's root folder. If you gonna use a compiler, which isn't in the /opt/SUNWspro folder you have to point to it by setting BOOST_JAM_TOOLSET_ROOT. It should point to the directory that contains folders like bin, lib, prod. For example for Studio Express export BOOST_JAM_TOOLSET_ROOT=/opt/SPROexpress/opt/SUNWspro/. Note trailing slash is important. All preparations are done. Let's make the rest few steps:

     cd $BOOST/tools/jam/src
     ./build.sh sunpro
     ln -s bin.solaris bin # to run regression tests later

4 Build Boost

Have you builded the bjam? Let's continue. Now you are almost ready to build the Boost. Suppose BOOST is the Boost's root folder and jam is on your path. You can start building the Boost.

If your compiler is installed in the standard folder just run:

     cd $BOOST
     bjam -sTOOLS=sunpro stage

If you need to setup compiler options, point to non-standard compiler installation folder run the following extended version of build command:

     cd $BOOST
     bjam -sTOOLS=sunpro \
          -sSUNPRO_ROOT_DIRECTORY="/opt/SPROexpress/opt/SUNWspro/" \
          -sSUNPRO_CXX="CC <options>" \
          -j8 -d2 stage
SUNPRO_ROOT_DIRECTORY
The directory where Sun C++ is installed.
SUNPRO_CXX
The name by which CC is invoked with options. See below for the list of options.
-jn
This option allows bjam use up to `n' processors.
-d2
Set this option if you want to see running command parameters during building.
stage
Build target. Also You can use `clean' and `install'.

5 Test Boost

Boost uses bjam to build and run tests and two additional programs to parse log and produce html formatted results. Let's run tests. As usually suppose BOOST is the Boost's root folder and bjam is on your path. Note if you want to produce html formatted log you cannot use -jn.

     cd $BOOST/status
     bjam -sTOOLS=sunpro --dump-tests &> test_log

If you want to work with html formatted results instead of raw data from test_log you need to build two additional utilities and run them.

     cd $BOOST/tools/regression/build
     bjam -sTOOLS=sunpro -sBUILD=release run

You've got two utilites process_jam_log and compiler_status in the $BOOST/tools/regression/build/run. To produce formatted log run them one by one. Important note: $BOOST should start with a domain name.

     cd $BOOST/status
     cat test_log | process_jam_log
     compiler_status $BOOST log.html log-links.html

Test results are in the log.html and log-links.html. That's all.

6 Work with Boost

When you work with Boost you should use the following command line options: -library=stlport4 -features=tmplife -features=tmplrefstatic. Also you may use -Qoption ccfe -complextmplexp. But C++ compiler from Sun Studio 11 does not fully support complex expression in template arguments so this option sometimes might lead to incorrect mangling names. Full support of complex template expression has been implemented in the development version of Sun C++.
Permalink Comments [6]