Re: Boost libraries and ROOT

From: Antonio Augusto Alves Junior <aalvesju_at_cern.ch>
Date: Wed, 16 Apr 2008 13:16:00 -0300


For example, when I try compile the code

    #include <TROOT.h>
    #include <stdlib.h>
    #include <boost/tuple/tuple.hpp>
    #include <boost/tuple/tuple_comparison.hpp>
    #include <boost/tuple/tuple_io.hpp>

    class OptimalCuts{     
       
       
    public :
        boost::tuples::tuple<int, double>T;
       

    };

I get the folowing errors from ROOT:

    root [2] .L boost_test.h++
    Info in <TUnixSystem::ACLiC>: creating shared library     /media/usbdisk/Analysis/B_2_X_b_Dst/script/./boost_test_h.so     Error: Illegal array dimension (Ignore subsequent errors)     /usr/include/boost/tuple/tuple_io.hpp:66:     Error: Too many initializers, exceeded length of array for     'stream_index' /usr/include/boost/tuple/tuple_io.hpp:66:     Error: no such template
    detail::map_tuple_to_cons<int,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>     /usr/include/boost/tuple/detail/tuple_basic.hpp:527:     Error: no such template
    detail::map_tuple_to_cons<int,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>     /usr/include/boost/tuple/detail/tuple_basic.hpp:530:     Error: no such template
    detail::map_tuple_to_cons<int,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>     /usr/include/boost/tuple/detail/tuple_basic.hpp:530:     Error: class,struct,union or type inherited::head_type not defined     /usr/include/boost/tuple/detail/tuple_basic.hpp:531:     Error: class,struct,union or type inherited::tail_type not defined     /usr/include/boost/tuple/detail/tuple_basic.hpp:532:     Error: template argument for N missing     /usr/include/boost/tuple/detail/tuple_basic.hpp:36:     Error: Symbol N is not defined in current scope     /usr/include/boost/type_traits/remove_cv.hpp:36:     Error: template argument for N missing     /usr/include/boost/tuple/detail/tuple_basic.hpp:36:     Error: Symbol N is not defined in current scope     /usr/include/boost/type_traits/remove_cv.hpp:36:     Error: template argument for N missing     /usr/include/boost/tuple/detail/tuple_basic.hpp:36:     Error: Symbol N is not defined in current scope     /usr/include/boost/type_traits/remove_cv.hpp:36:     Warning: Error occurred during reading source files     Warning: Error occurred during dictionary source generation     !!!Removing
    /media/usbdisk/Analysis/B_2_X_b_Dst/script/./fileeXkWvm.cxx     /media/usbdisk/Analysis/B_2_X_b_Dst/script/./fileeXkWvm.h !!!     Error: rootcint: error loading headers...     Error in <ACLiC>: Dictionary generation failed!     Info in <ACLiC>: Invoking compiler to check macro's validity     Info in <ACLiC>: The compiler has not found any problem with your macro.

            Probably your macro uses something rootcint can't parse.
            Check http://root.cern.ch/root/Cint.phtml?limitations for
    Cint's limitations.
    root [3]

Does someone know what is happen?

Regards
Augusto

Kevin Lynch escreveu:
> Antonio Augusto Alves Junior wrote:

>> Hello all,
>>
>> Please, can someone to give some example of usage of the Boost 
>> Libraries with ROOT?
>>
>> regards
>> Augusto
>>
>

> It's not clear what you are asking for. If you want to use Boost
> libraries and the Root libraries in compiled code, you won't have any
> issues. I do this all the time ... mostly I use stuff that ended up
> in TR1 (smart_ptr, tuple, bind, function, etc), but I've also been
> known to use multi_index, numeric_cast, random, and a few others. It
> all works just fine.
>

> If you want to use some specific Boost library as interpreted code,
> then you will likely be in for a long, tough slog to get it working.
> Boost makes EXTREMELY heavy use of advanced template features, as well
> as lots of config headers and #ifdef'd workarounds for various
> compilers and STL implementations. You could modify all the headers
> and source files for the Boost libraries you want to use to include
> the relevant CINT magic (ClassDef/ClassImp and LinkDef.h files) and
> generate all the dictionaries, and then load them up. You'll have to
> do all this work if you want to persist Boost objects to
> TTrees/TFiles, since you need the dictionary in this case.
>

> Personally, I've never bothered with all that ... if the project is
> complicated enough that I need Boost, I'm going the compiled route
> anyway. And I just accept that I'm too lazy to put any Boost objects
> in TTrees or TFiles :-)
>

> Finally, a few years back, someone posted a message to roottalk about
> efforts to Rootify the Boost smart pointers .... I think it was called
> "ROOST". I haven't heard anything more since then, but perhaps
> there's been some more progress.

>
-- 

"O mais corrente neste mundo, nestes tempos em que às cegas vamos tropeçando, é esbarrarmos, ao virar a esquina mais próxima, com homens e mulheres na maturidade da existência e da prosperidade, que, tendo sido aos dezoito anos briosos revolucionários decididos a arrasar o sistema dos pais e pôr no seu lugar o paraíso, enfim, da fraternidade, se encontram agora, com firmeza pelo menos igual, repoltreados em convicções e práticas que, depois de haverem passado por qualquer das muitas versões do conservadorismo moderado, acabaram por desembocar no mais desbocado e reaccionário egoísmo. Em palavras não tão cerimoniosas, estes homens e estas mulheres, diante do espelho da sua vida, cospem todos os dias na cara do que foram o escarro do que são."

José Saramago, em Ensaio sobre a lucidez

=============================================

A. Augusto Alves Jr.

CBPF - Centro Brasileiro de Pesquisas Físicas
Rua Dr. Xavier Sigaud 150 – URCA
CEP 22290-180
Rio de Janeiro, RJ, Brazil.

Tel: (55)(21) 2141-7329
Fax: (55)(21) 2141-7556
Received on Wed Apr 16 2008 - 18:16:23 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 16 2008 - 23:50:01 CEST