Wednesday Jan 30, 2008

Boost and Sun Studio 12

The latest released version of Boost 1.34.1 can be compiled under 32-bit mode by Sun Studio 12 from scratch without necessity to apply any additional patches.

If you want to use Boost 1.34.1 under 64-bit mode you still have to apply a small fix to Boost build script.

Upcoming Boost 1.35 can be compiled by Sun Studio 12 under both 32/64-bit mode without any patches.

bjam toolset=sun stdlib=sun-stlport stage # 32-bit mode
bjam toolset=sun stdlib=sun-stlport address-model=64 stage # 64-bit mode

As for advantages over Studio 11 and/or gcc:

  • Sun Studio 12 has a better back-end than Sun Studio 11 and g++ so customers gain performance improvement.
  • Sun Studio 12 better conforms to C++ standard than Sun Studio 11.

Tuesday Aug 14, 2007

How to build Boost 1.34 by Sun C++

Here is the summary of comments to my previous post and results of my experiments.

First of all to build Boost you need bjam. If you work on Linux take pre-compiled binaries of bjam here. If you target OS is Solaris look at my instruction how to build bjam.

If you need to build Boost for 32-bit architecture just untar Boost archive, go to boost_1_34_1 directories and type bjam toolset=sun stdlib=sun-stlport stage. That is all you need.

If you want to build Boost for 64-bit architecture the life became is a bit more complicated. You have to fix tools/build/v2/tools/sun.jam. Add following lines to this file just before comment line # Declare generators.

flags sun OPTIONS <architecture>/<address-model>32 : -m32 ;
flags sun OPTIONS <architecture>/<address-model>64 : -m64 ;
flags sun OPTIONS <link>shared : -Kpic ;

After that you can type bjam toolset=sun stdlib=sun-stlport address-model=64 stage to build Boost. Unfortunately Python Boost library shows an error during compilation. The error comes from python2.5/pyport.h so maybe the reason of this error my own broken Python configuration.

I do not have a time to fix configuration error in the Boost library so if somebody file a bug or/and a patch to Boost bug track it would be really nice.

And the last point. I recommend to read Boost Getting Started article. It has been rewritten since Boost 1.33.

Friday Apr 06, 2007

How to compile Boost 1.34 with stlport

Upcoming Boost 1.34 still has not been released. But it is in a very good shape and compatible with Sun C++ without any annoying patches. If you do not want to get it by CVS you can take its CVS snapshot here. Unfortunately there is one, at least one :-) problem with this version. By default it uses libCstd.2.1.1. This leads to enormous number of errors. Are there any workaround? Sure!

  1. Download and unpack tarball. Let's suppose the created directory name is 'boost'.
  2. cd boost
  3. Create in this directory file 'user-config.jam' with following content (spaces are important):
    import toolset : using ;
    using sun :  : <path to your Sun C++ compier>/bin/CC : <cxxflags>-library=stlport4 <linkflags>-library=stlport4 ;
  4. Build 'bjam' utility as described here. And put it on your $PATH.
  5. Run bjam --v2 -sBOOST_BUILD_PATH=`pwd` --toolset=sun stage
That's all.

Thursday Oct 05, 2006

Why BOOST_HAS_THREADS is not defined

I've got a question on Sun C++ forum why BOOST_HAS_THREADS is not defined explicitly in the sunpro_cc.hpp. The answer can be found just by grep on Boost source code but I decide to put explanation here.

Let's look at the piece of boost/config/suffix.hpp:

#if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \\
    || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)

When you compile multithread application you should use -mt command line option. This option implicitly defines _REENTRANT so Boost defines BOOST_HAS_THREADS automatically. You can check it by hand:

% cat
#include <boost/thread.hpp>

#error BOOST_HAS_THREADS is defined

% CC -mt -I$HOME/storage/boost_1_32_0 -c
"", line 4: Error: #error BOOST_HAS_THREADS is defined.

Friday Sep 29, 2006

Patch for boost::filesystem under Solaris

Lars Fürstenberg share his patch for operations_posix_windows.cpp. This patch fixes the problem with usage of dirent structure in the boost::filesystem library under Solaris.

Thanks again Lars!

Tuesday Sep 26, 2006

Boost and 64-bit mode again

Here is the quote from comments I received from Lars Fuerstenberg:

I used your patch to build Boost 1.32 in 64-bit mode with the latest
Sun compiler patches. With the comandline:
bjam "-sBUILD=<threading>multi <runtime-link>dynamic <instruction-set>v9" \\
     "-sTOOLS=sunpro" -sSUNPRO_CXX="CC -xtarget=native64 -xarch=v9 -xcode=abs64 -I\\"../../../\\" "
I was able to compile filesystem, program_options and iostreams
(these are all Boost libraries that we need for our product).
Our applications run without problems using these libraries.

Thanks Lars!

Tuesday Sep 12, 2006

Boost and 64-bit mode

Although my patch for Boost 1.32 contains settings to build Boost at 64-bit mode I have not tested it. Upcoming Boost 1.34 uses new build scheme so I do not plan to spent significant time to allow 64-bit at Boost 1.32.

Saturday Aug 12, 2006

New patches for Sun Studio 11

We've just released 121017-03 (sparc) and 121018-03 (intel) patches for Sun Studio 11 C++. You can find them here. Sorry for a long delay.

Tuesday Jul 25, 2006

-KPIC on amd

Markus Bernhardt pointed to the error in the sunpro-tools.jam. The -KPIC was absent for the amd64 platform. Bug and patch have been fixed. Thanks Markus.

Wednesday May 24, 2006

Command line options

Now I work on bug related to support friend template declaration. It's a quite complicated fix so unfortunately I have no progress on Boost regression test results.

Thanks a lot for comments on my previous post. List of libraries is very useful for me.

It looks like I missed one important thing related to Boost compilation. When you work with Boost you should use 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++.

Thursday May 11, 2006

Patch for Sun Studio 11

Patches for Sun Studio 11 (121017-02/121018-02) have been released.

As I mentioned early I plan to fix all bugs in the C++ compiler frontend related to Boost 1.32.0. Some of changes in Boost source code have been integrated in the current library source tree already. Next I will switch to the latest Boost version. My primary goal is to fix as many as possible bugs in the compiler so I prefer remove Sun C++ related workarounds from Boost source code, get the error, fix it etc. I will send my changes of Boost source code to the Boost developers community on more regular basis than now.

Boost is a nice library but it is not the only useful C++ library. I'm interested to make a list of C++ libraries and/or applications which are incompatible with Sun C++ compiler now but necessary to Sun C++ community. So any links, suggestions or anything else will be very appreciated.

And as usually fresh Boost tests results.

  Studio 11 Studio 10
Pass 776 766
Warn 159 164
Fail 6 11

Friday Apr 28, 2006

The Last Tens

Patches for Sun Studio 10 (117830-07/117831-07) have been released. Patches for Studio 11 (121017-02/121018-02) are almost ready.

Meanwhile number of failed Boost tests was reduced again. Please look at summary page - all optional, range, serialization, type_traits and utility tests are passed now. The still failed tests are known bugs and I continue to work on them.

Recently in the comments I found the question about downloaded version of Boost for Sun Studio. We don't plan to put Boost binaries on my blog or any other Sun related site because there is no binaries even on official Boost site. And the reason is quite clear - the biggest part of Boost code is templates.

And as usually fresh Boost tests results.

  Studio 11 Studio 10
Pass 772 762
Warn 159 164
Fail 10 15

Monday Apr 10, 2006

All regex tests are passed

New patch for Studio 11 (121017-02/121018-02) is delayed. I think we will be able to release it in a couple of week. Patch for Sun Studio 10 is almost ready and we wait customer's feedback to release it.

Meanwhile number of failed Boost tests was reduced again. Please look at summary page - all regex tests are passed now.

Someone asked me about the only 'filesystem' failures. Actually it is not a bug. The failed tests just checks OS support large files (>4Gb). By default Boost is compiled in 32-bit mode. So that test is failed. But you can turn on 64-bit mode easily. Just pass -sBUILD="<instruction-set>v9" or -sBUILD="<instruction-set>athlon64" options to the bjam.

And as usually fresh Boost tests results.

  Studio 11 Studio 10
Pass 757 751
Warn 158 159
Fail 26 31

Tuesday Mar 28, 2006

Patch for Sun Studio 11 is almost ready

New patch for Studio 11 (121017-02/121018-02) will be ready approximately in a week. You will be able to find it here. At the last moment I included some additional fix into this patch. So I expect when you install it and apply patch to Boost (see link in the right column) you will get 45 failed Boost test only.

And as usually fresh Boost tests results.

  Studio 11 Studio 10
Pass 761 755
Warn 155 156
Fail 33 38

Thursday Mar 16, 2006

Now Studio 11 is better than Studio 10

I have fixed regression in Studio 11 code and now Studio 11 is better than Studio 10.

  Studio 11 Studio 10
Pass 749 743
Warn 155 156
Fail 45 50

New patches for Studio 11 (121017-02/121018-02) and Studio 10 (117830-07/117831-07) are on the road. Unfortunately I fix regression after Studio 11 patch was started. But we plan to start new patches for Studio 11 (121017-03/121018-03) soon.

Also we get significant progress with Boost 1.33.1. I post more detailed info later.




« July 2016