Re: [ROOT] Bug in rootcint behaviour?

From: Christian Holm Christensen (cholm@alf.nbi.dk)
Date: Thu Sep 12 2002 - 18:31:19 MEST


Hi Ole, 

From: Ole Streicher <ole@ifh.de>
Subject: [ROOT] Bug in rootcint behaviour?
Date: Thu, 12 Sep 2002 16:55:10 +0200

> Hi!
> 
> I am not sure if this is a bug or a feature or if I just didn't read
> the manual carefully enough:
> 
> When I have dictionaries to be generated in different dierectories,
> their file name mus be different. When one has something like
> 
> cd event
> rootcint -f RootDict.cpp -c file1.h LinkDef.h
> cd ../raw
> rootcint -f RootDict.cpp -c file2.h LinkDef.h
> 
> then every RootDict.cpp file contains some Symbols that seem to be
> built from the file name, like
> 
> extern void G__cpp_setup_tagtableRootDict();
> 
> and when linked together in a program (or within Root), only the first
> is loaded. This causes that Root complains about missing class
> definitions for all except the first loaded file.
> 
> Is this a correct behaviour of rootcint or a bug?

I had a similar problem some time ago - it's the intended behaviour as
far as I understood Masa's comments back then.  The solution is to
make the output files have different names: 

  # Makefile in foo 
  # 
  include $(top_srcdir)/config/config.mk
 
  lib_LTLIBRARIES     = libFoo.la 
  libFoo_la_SOURCES   = Foo.cxx FooCint.cxx 
  pkginclude_HEADERS  = Foo.h 
  noinst_HEADERS      = FooInclude.h FooLinkDef.h
  #
  # EOF
 

  # Makefile in bar 
  # 
  include $(top_srcdir)/config/config.mk

  lib_LTLIBRARIES     = libBar.la 
  libBar_la_SOURCES   = Bar.cxx BarCint.cxx 
  pkginclude_HEADERS  = Bar.h 
  noinst_HEADERS      = BarInclude.h BarLinkDef.h
  #
  # EOF
  
  # $(top_srcdir)/config/config.mk 
  #
  %Dict.cxx %Dict.h:%Include.h %LinkDef.h  
         @ROOTCINT@ -f %Dict.cxx -c $(AM_CPPFLAGS) $(INCLUDES) $^
  #
  # EOF
  

BTW, this also works in you have one-Makefile builds (need newer
Autotools): 


  # $(top_srcdir)/Makefile 
  #
  lib_LTLIBRARIES    = 
  pkginclude_HEADERS = 
  noinst_HEADERS     = 

  include foo/Makefile 
  include bar/Makefile 
  
  %Dict.cxx %Dict.h:%Include.h %LinkDef.h  
         @ROOTCINT@ -f %Dict.cxx -c $(AM_CPPFLAGS) $(INCLUDES) $^	 
  #
  # EOF

  # foo/Makefile 
  #
  lib_LTLIBRARIES    += libFoo.la 
  libFoo_la_SOURCES  =  foo/Foo.cxx  FooDict.cxx  
  pkginclude_HEADERS += foo/Foo.h 
  noinst_HEADERS     += foo/FooInclude.h foo/FooLinkDef.h 
  #
  # EOF

  # bar/Makefile 
  #
  lib_LTLIBRARIES    += libBar.la 
  libBar_la_SOURCES  =  bar/Bar.cxx  BarDict.cxx  
  pkginclude_HEADERS += bar/Bar.h 
  noinst_HEADERS     += bar/BarInclude.h bar/BarLinkDef.h 
  #
  # EOF

The reason, as far as I know, for the use of the output file name in
the encoding of the functions, is that CINT can call these functions
safely without worrying about multiply defined symbols. 

Yours, 

 ____ |  Christian Holm Christensen 
  |_| |	 -------------------------------------------------------------
    | |	 Address: Sankt Hansgade 23, 1. th.  Phone:  (+45) 35 35 96 91
     _|	          DK-2200 Copenhagen N       Cell:   (+45) 24 61 85 91
    _|	          Denmark                    Office: (+45) 353  25 305
 ____|	 Email:   cholm@nbi.dk               Web:    www.nbi.dk/~cholm
 | |



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:09 MET