Wednesday January 30, 2008 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:
Tuesday August 14, 2007 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.
Permalink
Comments [5]
Friday April 06, 2007
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!
import toolset : using ; using sun : : <path to your Sun C++ compier>/bin/CC : <cxxflags>-library=stlport4 <linkflags>-library=stlport4 ;
Monday November 06, 2006 Upcoming SunStudio Express 3 will include one more c++ language extension. Recently I have implemented explicit template definition aka forward declaration of explicit instantiations. Now this extension is available under -Qoption ccfe -features=gcc command line option.
In the code below compiler will not instantiate (explicitly and implicitly) any members of class S<int>. So it will not waste a time on code generation and optimization. The only source code file should contain explicit template instantiation to successfully link the program.
% cat test.h
template <typename T>
struct S
{
void foo();
};
template <typename T>
void S<T>::foo()
{
// a lot of code here
}
extern template struct S<int>;
% cat inst.cc #include "test.h" template struct S<int>;
% cat main.cc
#include "test.h"
int main()
{
S<int> s;
s.foo();
}
Tuesday October 31, 2006 Now Sun Studio C++ accepts g++ extension - operator __typeof__ (as well as __typeof and typeof). Keyword typeof is available under -features=gcc command line option. So you can write:
int * x; __typeof__(*x) n;
Operator __alignof__ now accepts expression:
unsigned v = 0; unsigned a = __alignof__(v);
Thursday October 05, 2006
New Google project - Search public source code. And if you use Firefox you can install search plugin.
Permalink
Comments [0]
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)
# define BOOST_HAS_THREADS
#endif
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 test.cc #include <boost/thread.hpp> #ifdef BOOST_HAS_THREADS #error BOOST_HAS_THREADS is defined #endif % CC -mt -I$HOME/storage/boost_1_32_0 -c test.cc "test.cc", line 4: Error: #error BOOST_HAS_THREADS is defined.
Friday September 29, 2006 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!
Permalink
Comments [0]
Tuesday September 26, 2006 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!
Permalink
Comments [3]
Tuesday September 12, 2006
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.
Permalink
Comments [2]
Saturday August 12, 2006
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.
Permalink
Comments [1]
Tuesday July 25, 2006
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.
Permalink
Comments [0]
Thursday July 20, 2006 If you take a look at the Links block you will see Loki-0.1.5 Patch. Yes, I have fixed some bugs in the compiler and created a patch for Loki source code. Unfortunately at this moment these fixes are in the development branch only. But you can try to play with Studio Express. Studio Express is a preview of the next release, updated every few months. We plan to release new build in the near future.
And the second piece of news. Third patch for Sun Stusio 11 C++ is almost ready. I hope in a week or so it will be released.
Permalink
Comments [0]
Monday June 26, 2006 I've moved from C++ sustaining to C++ development team. So I will be able to dedicate all my time to C++ compiler. Boost has still been on my focus but now I can work on some other important tasks related to Sun C++ compiler.
My colleagues from sustaining team made a present for me. It's the best professional award I have got ever before (link is on my russian blog but photos do not need translation).
Permalink
Comments [0]
Monday June 19, 2006
Take a look at Vijay post. Now even if you do not have a service contract you are able to file a bug realted to Sun C++.
Permalink
Comments [0]