$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Sun C++ 5.10 and BGL adjacency_list (solved)
From: Nicholas Brealey (nick_at_[hidden])
Date: 2010-02-13 13:14:00
Jeremiah Willcock wrote:
> On Sun, 7 Feb 2010, Nicholas Brealey wrote:
> 
>> I am trying to use the Boost Graph Library from Boost 1.42.0 with Sun 
>> Studio 12 update 1 but the adjacency_list.cpp example from the 
>> libs/graph/example directory does not compile.
>>
(trimmed)
> 
> The Sun compiler has many issues with compiling BGL; the regression 
> tests show many failures.  In particular, bundled properties are 
> problematic. I believe the issue was partial specialization on 
> pointer-to-member types, but I am not sure about that.  The code should 
> work if you use old-style properties; look at the documentation, book, 
> or other examples and test cases for that style.
> 
> -- Jeremiah Willcock
I finally managed to figure out what was going wrong.
Using BOOST_ASSERT_CONFIG gives an error:
"/home/nick/boost_1_42_0/boost/config/compiler/sunpro_cc.hpp", line 128: 
Error: #error "Unknown compiler version - please run the configure tests 
and report the results".
Sun CC 5.10 defines __SUNPRO_CC as 0x5100 and sunpro_cc.hpp says:
// last known and checked version is 0x590:
#if (__SUNPRO_CC > 0x590)
#  if defined(BOOST_ASSERT_CONFIG)
#     error "Unknown compiler version - please run the configure tests 
and report the results"
#  endif
#endif
So I ran the configure program and produced a config file (see below).
Then I ran:
$ CC -I /home/nick/boost_1_42_0 -D 
BOOST_SITE_CONFIG=/home/nick/boost_test2/suncc510.hpp -D 
BOOST_DETECT_OUTDATED_WORKAROUNDS -o adjacency_list adjacency_list.cpp
"/home/nick/boost_1_42_0/boost/type_traits/config.hpp", line 37: Error: 
The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/detail/allocator_utilities.hpp", line 
194: Error: The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/iterator/detail/config_def.hpp", line 53: 
Error: The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/mpl/aux_/nested_type_wknd.hpp", line 22: 
Error: The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/utility/addressof.hpp", line 64: Error: 
The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/iterator/detail/config_def.hpp", line 53: 
Error: The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/iterator/detail/config_def.hpp", line 53: 
Error: The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/iterator/detail/config_def.hpp", line 53: 
Error: The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/iterator/detail/config_def.hpp", line 53: 
Error: The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/iterator/detail/config_def.hpp", line 53: 
Error: The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/graph/properties.hpp", line 373: Error: 
The divisor of a remainder must be greater than zero.
"/home/nick/boost_1_42_0/boost/multi_index/detail/access_specifier.hpp", 
line 49: Error: The divisor of a remainder must be greater than zero.
12 Error(s) detected.
The final error is:
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) && !defined 
(BOOST_GRAPH_NO_BUNDLED_PROPERTIES)
// This compiler cannot define a partial specialization based on a
// pointer-to-member type, as seen in boost/graph/subgraph.hpp line 985 
(as of
// trunk r53912)
#  define BOOST_GRAPH_NO_BUNDLED_PROPERTIES
#endif
which is the root cause of the problem.
So I ran:
$ CC -O -I /home/nick/boost_1_42_0 -D 
BOOST_SITE_CONFIG=/home/nick/boost_test2/suncc510.hpp -D 
BOOST_STRICT_CONFIG -o adjacency_list adjacency_list.cpp
which compiled without errors and WHEN RUN gives the same output as the 
g++ version.
Regards
Nick
Config file for Sun CC 5.10 (__SUNPRO_CC as 0x5100).
bash-3.00$ CC -V
CC: Sun C++ 5.10 SunOS_i386 128229-04 2009/11/25
Usage: CC [ options ] files.  Use 'CC -flags' for details
bash-3.00$
//  (C) Copyright Boost.org 2001.
//  Do not check in modified versions of this file,
//  This file may be customised by the end user, but not by boost.
//
//  Use this file to define a site and compiler specific
//  configuration policy, this version was auto-generated by
//  configure on Sat Feb 13 15:47:40 GMT 2010
//  With the following options:
//    CXX      = CC
//    CXXFLAGS = -I./../.. -I./../../libs/config/test -library=stlport4 
-DBOOST_NO_CONFIG
//    LDFLAGS  = -library=stlport4
//    LIBS     = -lrt -lm -lpthread
//
// define this to disable all config options,
// excluding the user config.  Use if your
// setup is fully ISO complient, and has no
// useful extentions, or for autoconf generated
// setups:
#ifndef BOOST_NO_CONFIG
#  define BOOST_NO_CONFIG
#endif
// define if you want to disable threading support, even
// when available:
// #define BOOST_DISABLE_THREADS
// define if you want the regex library to use the C locale
// even on Win32:
// #define BOOST_REGEX_USE_C_LOCALE
// define this is you want the regex library to use the C++
// locale:
// #define BOOST_REGEX_USE_CPP_LOCALE
//
// options added by configure:
//
#define BOOST_MSVC6_MEMBER_TEMPLATES
#define BOOST_HAS_UNISTD_H
#define BOOST_HAS_STDINT_H
#define BOOST_HAS_SLIST
#define BOOST_HAS_SIGACTION
#define BOOST_HAS_SCHED_YIELD
#define BOOST_HAS_PTHREADS
#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
#define BOOST_HAS_PARTIAL_STD_ALLOCATOR
#define BOOST_HAS_NL_TYPES_H
#define BOOST_HAS_NANOSLEEP
#define BOOST_HAS_LONG_LONG
#define BOOST_HAS_LOG1P
#define BOOST_HAS_HASH
#define BOOST_HAS_GETTIMEOFDAY
#define BOOST_HAS_EXPM1
#define BOOST_HAS_DIRENT_H
#define BOOST_HAS_CLOCK_GETTIME
#define BOOST_NO_VARIADIC_TEMPLATES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_STD_UNORDERED
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_NULLPTR
#define BOOST_NO_LAMBDAS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_MS_INT64_NUMERIC_LIMITS
#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DECLTYPE
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_CONCEPTS
#define BOOST_NO_CHAR32_T
#define BOOST_NO_CHAR16_T
#define BOOST_NO_0X_HDR_UNORDERED_SET
#define BOOST_NO_0X_HDR_UNORDERED_MAP
#define BOOST_NO_0X_HDR_TYPE_TRAITS
#define BOOST_NO_0X_HDR_TUPLE
#define BOOST_NO_0X_HDR_THREAD
#define BOOST_NO_0X_HDR_SYSTEM_ERROR
#define BOOST_NO_0X_HDR_REGEX
#define BOOST_NO_0X_HDR_RATIO
#define BOOST_NO_0X_HDR_RANDOM
#define BOOST_NO_0X_HDR_MUTEX
#define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
#define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
#define BOOST_NO_0X_HDR_INITIALIZER_LIST
#define BOOST_NO_0X_HDR_FUTURE
#define BOOST_NO_0X_HDR_FORWARD_LIST
#define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
#define BOOST_NO_0X_HDR_CONDITION_VARIABLE
#define BOOST_NO_0X_HDR_CONCEPTS
#define BOOST_NO_0X_HDR_CODECVT
#define BOOST_NO_0X_HDR_CHRONO
#define BOOST_NO_0X_HDR_ARRAY