Subject: Re: [Boost-build] how to build Boost 1.37 on OpenSolaris with SunStudio12 & Apache stdcxx
From: Agyaras (wdn456_at_[hidden])
Date: 2009-01-18 11:21:36
In article <4968D9DD.5050908_at_[hidden]>,
Steven Watanabe <watanabesj_at_[hidden]> wrote:
> There is no built-in support for this. When you initialize the
> toolset in user-config.jam, you can add the appropriate command
> line arguments. e.g.
> using sun : 5.10 : : <cxxflags>... <linkflags>... ;
Indeed. With some patience, it works. Here is what I did, in some detail.
First compile Apache StdCxx as follows:-
1) modify etc/config/sunpro.config by setting the following macros to:
CXXFLAGS = -library=no%Cstd
LDFLAGS = -library=no%Cstd
then compile (this is a 64-bit, multithreaded example, read the StdCxx
documentation for a detailed description of what is what here):
gmake BUILDDIR=/tmp/stdcxx BUILDMODE=optimized,threads,wide,shared
sudo gmake install PREFIX=/opt/stdcxx64
Note that if you run the tests, one of them will fail, the StdCxx
developers are aware of it, they reckon it's a minor problem and will be
fixed in V4.2.2.
Now to Boost:
here is my "user-config.jam", following Steven's suggestion:-
# Compiler configuration
import toolset : using ;
using sun : 5.10 : /opt/SunStudioExpress/bin/CC :
<cxxflags>"-library=no%Cstd -I/opt/stdcxx64/include -m64"
<linkflags>"-library=no%Cstd -L/opt/stdcxx64/lib -lstd" ;
# Python configuration
using python : 2.4 : /usr ;
Note that the <cxxflags> and <linkflags> require their options being
enclosed in quotes, and that spaces around ':' and ';' do matter! :-)
The compilation command then was:-
bjam toolset=sun --user-config=user-config.jam address-model=64 stage
after that, I just copied the stage/lib manually to a convenient
location (I already had the include's in place).
Unfortunately I do not have the time to learn Jam and modify the Boost
installation process to accommodate this combination, but perhaps some
good soul will do it one day...
Bonus info: How to build a C++ program with SunStudio 12 in OpenSolaris
that depends on Boost and StdCxx?
Compile your source files with commands as follows (note that the
-D_REENTRANT macro is required by StdCxx if you use the multithreaded
version of the library):
CC <otherflags> -mt -D_REENTRANT -library=no%Cstd
-I/path/to/stdcxx/include -I/path/to/boost/include -c source.cc -o
then link them:
CC -library=no%Cstd -L/path/to/boost>/lib -l<boost_whatever...>
-L/path/to/stdcxx/lib -lstd source1.o source2.o ... -o prog
thanks a lot, Inoshishi
-- "Non est volentis, neque currentis, sed miserentis Dei"
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk