Hi,
James found this (and a big thanks for that!) Here is his
explanation from the code:
// James Peachey 2003/03/10 for ISDC, made the following
// change from the original Root 3.04.02 distribution to allow
// compilation with Solaris Workshop 7. A compiler bug prevents
// the original version from compiling due to the (LEGAL!) use of
// STL objects inside a function with C linkage. The function body
// of the original function:
// extern "C" const char* G__saveconststring(const char* s)
// was moved into a static function with C++ linkage, and the
// original function simply calls this new function.
// New static function with C++ linkage:
// extern "C" const char* G__saveconststring(const char* s)
static const char* static_G__saveconststring(const char* s)
{
static set<string> conststring;
string str(s);
conststring.insert(string(str));
set<string>::iterator p = conststring.lower_bound(str);
return((*p).c_str());
}
// New behavior: call static function above.
extern "C" const char* G__saveconststring(const char* s)
{ return static_G__saveconststring(s); }
// End of change made on behalf of ISDC.
I'm sure that James can fill you in more. Once this is done Sun
Workshop 7 builds and runs root just fine (as far as I have tried).
cheers
bruce
Aksel Hallin writes:
> I have the identical problem with CC on sun solaris and sun CC 5.3
>
> The compiler version is
> CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-12 2002/12/16
>
> CC -O -KPIC -DG__REGEXP1 -DG__UNIX -DG__OSFDLL -Iinclude -DG__SHAREDLIB
> -DG__ROOT -DG__REDIRECTIO -ptr/home/hpc1089/root3/root -o
> cint/src/Api.o -c cint/src/Api.cxx
> "/opt/SUNWspro/WS6U2/include/CC/Cstd/./functional", line 162: Error: The
> base "std::binary_function<std::T, std::T, bool>" must be a previously
> defined class or struct.
> "/opt/SUNWspro/WS6U2/include/CC/Cstd/./set", line 82: Where: While
> specializing "std::less<std::T>".
> "/opt/SUNWspro/WS6U2/include/CC/Cstd/./set", line 82: Where:
> Specialized in non-template code.
> 1 Error(s) detected.
>
> I was trying to install root 3.05.02; however, this problem occurred
> when the compiler was "upgraded"; before that root installed without
> problems.
>
> The fix of
> #include <functional>
> seems to have no effect.
>
> Are there any other suggestions?
>
> Thanks,
> Aksel Hallin
> Queen's/SNO
>
>
> > -----Original Message-----
> > From: owner-roottalk@pcroot.cern.ch
> [mailto:owner-roottalk@pcroot.cern.ch] On Behalf Of Philippe
> > Canal
> > Sent: Thursday, March 06, 2003 9:24 AM
> > To: bruce.oneel@obs.unige.ch; roottalk@pcroot.cern.ch
> > Subject: RE: [ROOT] Root with Sun Workshop 7
> >
> > Hi,
> >
> > In Api.cxx you could try to add the line:
> > #include <functional>
> > before the line
> > #include <set>
> >
> > Cheers,
> > Philippe.
> >
> > -----Original Message-----
> > From: owner-roottalk@pcroot.cern.ch
> > [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Bruce O'Neel
> > Sent: Thursday, March 06, 2003 6:41 AM
> > To: roottalk@pcroot.cern.ch
> > Subject: [ROOT] Root with Sun Workshop 7
> >
> >
> > Hi,
> >
> > Since we're getting close to a software release we're trying to get
> > away from 3+ year old compilers. Ergo we just upgraded to Sun
> > Workshop 7 (or what ever it is they call it this week).
> >
> > This comes with Sun C++ 5.4 which seems not to build trying to
> > compile:
> >
> > CC -O -KPIC -DG__REGEXP1 -DG__UNIX -DG__OSFDLL -Iinclude
> -DG__EXCEPTION -DG
> > __ST
> > D_EXCEPTION -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO
> -ptr/home/isdc/oneel/pc
> > 7-sc
> > ratch/src/sparc-sun-solaris2.8 -o cint/src/Api.o -c cint/src/Api.cxx
> > "/isdc/sw/compilers/WS/7/SUNWspro/prod/include/CC/Cstd/./functional",
> line
> > 162:
> > Error: The base "std::binary_function<std::T, std::T, bool>" must be a
> > previousl
> > y defined class or struct.
> > "/isdc/sw/compilers/WS/7/SUNWspro/prod/include/CC/Cstd/./set", line
> 82:
> > Wher
> > e: While specializing "std::less<std::T>".
> > "/isdc/sw/compilers/WS/7/SUNWspro/prod/include/CC/Cstd/./set", line
> 82:
> > Wher
> > e: Specialized in non-template code.
> > 1 Error(s) detected.
> >
> >
> > Am I just banging my head against the wall or is this solvable?
> >
> > Thanks!
> >
> > cheers
> >
> > bruce "who's just about to learn much more about templates then he
> > knew before"
> >
> > --
> > Reality is 80m polygons - Alvy Ray Smith
> >
> > Bruce O'Neel phone: +41 22 950 91 57
> > INTEGRAL Science Data Centre +41 22 950 91 00 (switchb.)
> > Chemin d'Ecogia 16 fax: +41 22 950 91 35
> > CH-1290 VERSOIX e-mail: Bruce.Oneel@obs.unige.ch
> > Switzerland WWW: http://isdc.unige.ch/
>
--
Reality is 80m polygons - Alvy Ray Smith
Bruce O'Neel phone: +41 22 950 91 57
INTEGRAL Science Data Centre +41 22 950 91 00 (switchb.)
Chemin d'Ecogia 16 fax: +41 22 950 91 35
CH-1290 VERSOIX e-mail: Bruce.Oneel@obs.unige.ch
Switzerland WWW: http://isdc.unige.ch/
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET