Re: [ROOT] 2.25.03: STL vector broken for class pointers

From: Matthew D. Langston (langston@SLAC.stanford.edu)
Date: Tue Nov 21 2000 - 22:50:52 MET


Hi Philippe,

I'm using ROOT 2.25.03 on RedHat Linux 6.1 Intel, but I used gcc 2.95.2 to
compile ROOT instead of egcs 1.1.2.

I built ROOT from source using the following configure line:

export CERNLIB= /usr/local/cern/2000/lib
export TTF_FONTDIR=/usr/local/root/2.25.03/gcc-c++-2.95.2/ttf/fonts
./configure
linuxegcs --with-cern-libdir="$CERNLIB" --with-ttf-fontdir="$TTF_FONTDIR"

I also used a personal MyConfig.mk file with the following single line:
EXTRA_LDFLAGS = -Wl,-rpath,$(ROOTSYS)/lib

I also made two personal bugfixes to my installation of gcc-2.95.2 which
make my compiler different than a "vanilla" build of gcc-2.95.2 under Linux.
I changed the bitset header (/usr/local/include/g++-3/bitset on my system)
since bitsets were broken.  I also removed the "#define __STL_NO_NAMESPACES"
from the stl_config.h header (/usr/local/include/g++-3/stl_config.h on my
system) to enable namespace std.  I have included two patches of my
gcc-2.95.2 source tree against a "vanilla" gcc-2.95.2 source tree so that
you can see exactly what changes I made.

The "STL vector + class pointer" problem is easily reproducible on my
system.  If there is any other information I can give you , please let me
know.

Thanks for your help Philippe.

Regards, Matt

----- Original Message -----
From: "Philippe Canal" <pcanal@popgtw.fnal.gov>
To: "Matthew D. Langston" <langston@SLAC.Stanford.EDU>
Cc: "roottalk" <roottalk@pcroot.cern.ch>
Sent: Tuesday, November 21, 2000 12:02 PM
Subject: RE: [ROOT] 2.25.03: STL vector broken for class pointers


> Hi Matthew,
>
> I am unable to reproduce your problem and Linux and SGI with gcc 2.95.2.
>
> Can you be more specific on your platform (and any custom built)?
>
> Thanks,
>
> Philippe.
>
> > -----Original Message-----
> > From: owner-roottalk@pcroot.cern.ch
> > [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Matthew D. Langston
> > Sent: Monday, November 20, 2000 11:32 AM
> > To: Masaharu Goto
> > Cc: roottalk
> > Subject: [ROOT] 2.25.03: STL vector broken for class pointers
> >
> >
> > Hi Masa and ROOT Team,
> >
> > It appears that std::vector<T> is broken when T is a pointer to a
> > non-builtin type.  Here is the output from ROOT 2.25.03 which
demonstrates
> > the problem:
> >
> > root [0] #include <vector>
> > root [1] vector< const int* > int_cp_list
> > root [2] cout << int_cp_list.size();
> > root [3] #include <TKey.h>
> > root [4] vector< const TKey* > key_cp_list
> > root [5] cout << key_cp_list.size();
> > Error: Can't call vector<const TKey*,__malloc_alloc_template<0>
> > >::size() in
> > current scope FILE:/tmp/filewcdgda_cint LINE:1
> > Possible candidates are...
> > filename       line:size busy function type and name  (in vector<const
> > TKey*,__malloc_alloc_template<0> >)
> > Error: No symbol key_cp_list in current scope  FILE:/tmp/filewcdgda_cint
> > LINE:1
> > Error: Failed to evaluate key_cp_list.size() FILE:/tmp/filewcdgda_cint
> > LINE:1
> > Possible candidates are...
> > filename       line:size busy function type and name
> > 00*** Interpreter error recovered ***
> > root [6]
> >
> > Regards, Matt
> >
> > --
> > Matthew D. Langston
> > SLD, Stanford Linear Accelerator Center
> > langston@SLAC.Stanford.EDU
> >
> >
> >
>






This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:37 MET