Boost logo

Boost Users :

From: paul.floyd (paul.floyd_at_[hidden])
Date: 2006-04-04 11:02:59


Hi all

I've almost managed to get Boost 1.33.1 to build on Solaris
with Sun Studio 11. I'm not quite up to speed yet with all of
the Boost MACROS (in particular the WORKAROUND one).

Here's what I've done so far:
a) Apply all of the latest patches to Sun Studio 11

b) Apply all of the patches at
http://blogs.sun.com/roller/page/sga?catname=%2FBoost

c) I had a compile problem with readdir_r not being seen. To
fix this I changed my bjam command line to add
-sSUNPRO_CXX="CC -D_XOPEN_SOURCE=500"
(on Solaris 10 you may prefer -D_XOPEN_SOURCE=600)

d) In boost/test/impl/unit_test_suite.ipp, the code makes use
of std::random_shuffle. AFAICS this uses rand48(), and
rand48() is in <stdlib.h> but not in <cstdlib> and std::. To
fix this I added
#if defined(__SUNPRO_CC)
    #include <stdlib.h>
#endif
at line 42.
(this looks like a compiler/std lib issue to me)

e) I had some errors with size_t not being in the global scope
(Sun Studio is the pickiest compiler I know of for this). This
comes from boost/config/posix_features.hpp including unistd.h
My fix for this was to add
#include <cstdlib>
using std::size_t;
at line 17 of
boost/config/platform/solaris.hpp

f) I had two problems with
libs/iostreams/src/bzip2.cpp
  f.1) bzlib.h uses FILE as if it were in the global scope,
but as per point e), with Sun Studio, when including <cstdio>,
it is in std::, so just before including "bzip2.h" (line 18) I
added
#include <boost/iostreams/filter/bzip2.hpp>
#if defined(__SUNPRO_CC)
using std::FILE;
#endif
  f.2) Solaris 8 ships with a version of libbz2 that is too
old to be compatible with the Boost.Iostreams code. Iostreams
doesn't seem to do any checking of the libbz2 version (if any
version is available to check). To fix this I downloaded
libbz2 from
http://www.bzip.org/downloads.html,
untarred it to a '3rdparty' directory, built it (make CC=cc
CFLAGS=-xO5) and then changed my bjam command line to use
-sSUNPRO_CXX="CC -D_XOPEN_SOURCE=500
-I/home/paulf/scratch/boost_1_33_1/3rdparty/bzip2-1.0.3"

This leaves me with (for the moment) one compile error:
boost/spirit/core/non_terminal/impl/grammar.ipp, line 279
the compiler complains about

Error: Initializing
definition_t &def = get_definition<DerivedT, ContextT,
ScannerT>(self);
requires an lvalue

At first I thought this might be related to Sun Studio having
an issue with name mangling typedefs, but this doesn't seem to
be the case.

A+
Paul


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net