Boost compilation problem
I'm using the Boost 1.32.0 library, patched and built as instructed, with the
August Studio Express compiler. In that environment, I'm having problems
building some code that uses the multi_index package. It compiles just fine
using g++, but fails under Studio Express. I've cut it down to a small test
program that still triggers the bug. Could someone at Sun track down
the problem? The error messages are huge strings of gobbledegook,
too long to repeat here.
% cat job_status_db_access.cc
#include <string>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/key_extractors.hpp>
using namespace ::boost;
using namespace ::boost::multi_index;
struct Job_Node
{
std::string JobID;
std::string NodeName;
Job_Node (std::string jobid, std::string nodename) :
JobID (jobid), NodeName (nodename) { }
};
typedef multi_index_container <
Job_Node,
indexed_by <
ordered_unique <
composite_key <
Job_Node,
member<Job_Node, std::string, &Job_Node::JobID>,
member<Job_Node, std::string, &Job_Node::NodeName>
>
>
>
> Job_Node_set;
Job_Node_set Pending_Job_Node_set;
int read_full_job_nodes_table ()
{
charJobID_buffer[1];
charNodeName_buffer [1];
Job_Node *job_node = new Job_Node (JobID_buffer, NodeName_buffer);
Pending_Job_Node_set.insert (*job_node);
return (0);
}
% make
CC -O -xlang=c99 -mt -library=stlport4 \
-features=tmplife -features=tmplrefstatic \
-errtags=yes -D_POSIX_THREAD_SEMANTICS -D__EXTENSIONS__ \
-I/build/thirdparty/include \
-c -o job_status_db_access.o job_status_db_access.cc
(/build/thirdparty/include/boost/... is where I've installed the Boost stuff.)
[2002 byte] By [
herteg] at [2007-11-26 10:37:19]

# 4
Indeed, the fix described there makes the compiler error messages go away.
I haven't tried running the resultant program to see if it works at that level,
as this code is still in development. Hopefully Sun will notice this posting
and fold the fix into their Boost patch files. Sun, please let us know when
you do so, so we can know it's time to download fresh copies of the patches.
Thanks a bunch for your advice!
Now, as for patching the official Boost source code, it involves adding a
condition to a #if:
... ||\
BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x580))
I presume the "0x580" is supposed to represent the CC compiler version.
Sun doesn't claim to support the Boost library in Sun Studio 11 (compiler
version 5.8), so I'm mostly using the Studio Express compiler, which
advertises itself as version 5.9. However, the exact value plugged into
your macro has no effect whatsoever -- 0x580, 0x590, and 0x0 all work
exactly the same for both 5.8 and 5.9 compilers. I don't know if you
intended the macro to mean the condition should only apply to the
specifically-noted release, but that's not what it's doing.
Also, for what it's worth, there's no way to know whether Sun will fix the
underlying compiler problem before the 5.9 compiler stops being beta,
so I don't know how that should figure into the setting of this parameter.
# 5
> Hopefully Sun will notice this posting and fold the fix into their Boost patch files. Sun,
> please let us know when you do so, so we can know it's time to download fresh
> copies of the patches.
Do you mean this fix http://lists.boost.org/boost-users/2006/09/22407.php?
If so - I have not put this fix into my patch yet. When I update my patch I always drop a note on the blog.
> Now, as for patching the official Boost source code, it involves adding a
> condition to a #if:
>
>... ||\
> BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x580))
>
> However, the exact value plugged into
> your macro has no effect whatsoever -- 0x580, 0x590,
> and 0x0 all work exactly the same for both 5.8 and 5.9 compilers. I
> don't know if you intended the macro to mean the condition should only
> apply to the specifically-noted release, but that's not what it's doing.
Please read documentation on BOOST_WORKAROUND and BOOST_TESTED_AT somewhere on the Boost site.
# 8
I've got a question: why are you maintaining these patches instead
of trying to get them into the Boost CVS? There's currently a regression
engine running Sun Studio 11 (does it have the correct compiler
patch level?)
http://tinyurl.com/gmgpg
which is usually a prerequisite for accepting patches in, but
other than that I don't see why this valuable effort has to be kept
separate from the mainstream Boost version.
Best,
Joaqu韓 M L髉ez Mu駉z
Telef髇ica, Investigaci髇 y Desarrollo