Cling error when opening output file

Issue #199 resolved
Laurie Nevay created an issue

Since the recent changes to the cmake for cling dictionary generation, we see the following error / warning when opening a file:

BDSOutputROOTEvent::Initialise> Setting up new file: t2_event.root
    Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
       Missing FileEntry for parser/optionsBase.h
       requested to autoload type GMAD::OptionsBase

I'm not sure how this affects the output itself yet.

Comments (13)

  1. Laurie Nevay reporter

    Stewart says: Install parser headers in include/bdsim/parser and that bug will disappear.

  2. Jochem Snuverink

    I feel it shouldn't be necessary to install in order to run a program. Also if I do make install the parser headers are installed in include/bdsim (which may not be the right thing).

  3. Stewart Boogert

    In the headers used with root optionsBase.h appear in parser. Now I have not found how to tell root to strip parser from parser/optionsBase.h when getting the headers.

    Now I agree, install should not be required but I think the header directory layout should match that of what we have in the source. Incidentally it will fix that bug when the code is installed.

  4. Jochem Snuverink

    There seems to be no real consequences if there is no subsequent crash. One workaround / fix is to append ROOT_INCLUDE_PATH with /path/to/bdsim

  5. Laurie Nevay reporter

    So, in commit #d677102 @stewartboogert wrote in the commit message:

    Remove paths need to 
    export=ROOT_INCLUDE_PATH=INSTDIR/include/bdsim/:INSTDIR/include/bdsim/analysis/
    

    This would seem to echo with what @jsnuverink mentioned.

    @jsnuverink also added the following for an interactive logon in commit #3c5c01e. I wasn't aware of these / this example and it doesn't match what's in the manual.

    gSystem->AddIncludePath("-I@CMAKE_BINARY_DIR@/analysis");
    gInterpreter->AddIncludePath("-I@CMAKE_SOURCE_DIR@/analysis");
    gInterpreter->AddIncludePath("-I@CMAKE_SOURCE_DIR@/include");
    gInterpreter->AddIncludePath("-I@CMAKE_SOURCE_DIR@");
    
    1. Are all of these necessary?
    2. Do we need to export the include path for ROOT to work at run time? This seems very odd.
    3. Are we invoking the interpreter somehow in code at run time in BDSIM - given we get an interpreter error..
    4. We should update the manual when we know which settings / exports to use.

    With the latest commits (up to #08011dd) I still see the error when creating a new output file. I have installed bdsim and use the install. I don't have BDSIM's install dir on my DYLD_LIBRARY_PATH nor the export. What do I need exactly / minimally?

    From my understanding, we used to include the build dir header location when using rootcint to create the root dictionaries, but this wasn't good as if you deleted the build directory an installation wouldn't work. We saw this behaviour on our EasyBuild installation on our farm. We also can't bake in the install directory alone as it should work without installing (I think). Stewart's solution, from what I understand, to get it working on both our laptops and the installation only setup on the farm, was to remove the paths completely and use the environmental variable. @stewartboogert - please correct me if I'm wrong!

  6. Jochem Snuverink

    From my understanding, we used to include the build dir header location when using rootcint to create the root dictionaries, but this wasn't good as if you deleted the build directory an installation wouldn't work. We saw this behaviour on our EasyBuild installation on our farm. We also can't bake in the install directory alone as it should work without installing (I think). Stewart's solution, from what I understand, to get it working on both our laptops and the installation only setup on the farm, was to remove the paths completely and use the environmental variable. Stewart Boogert - please correct me if I'm wrong!

    I think your analysis is correct and we have to supply the include paths dynamically.

    The interactive tests were added by @nevay.

    gSystem->AddIncludePath("-I@CMAKE_BINARY_DIR@/analysis");
    gInterpreter->AddIncludePath("-I@CMAKE_SOURCE_DIR@/analysis");
    gInterpreter->AddIncludePath("-I@CMAKE_SOURCE_DIR@/include");
    gInterpreter->AddIncludePath("-I@CMAKE_SOURCE_DIR@");
    

    To answer the points:

    1. Line 1 was added by @nevay. Lines 3 and 4 were added in commit 8d743b4cb to fix issue #173. Line 2 was needed due to recent changes. The lines are added before the library loading to suppress the cling message. Not sure all lines are still needed though (possibly line 4 not). Note that this is somewhat equivalent to setting ROOT_INCLUDE_PATH like Stewart does (line 2 and 3).

    2. No, not really except to suppress the cling message perhaps.

    3. From https://sft.its.cern.ch/jira/browse/ROOT-8699 :

    If you don't use these types in ROOT's interpreters (whatever language) then indeed there is no problem for you - except for the error message and an environment that we don't really support: we currently require the headers at runtime.

    So, we don't necessarily need to invoke the interpreter to get this error. And actually if we did and use that header then we would crash (this is the meaning of the error message).

    4.Agreed. The path to the bdsim headers and the analysis headers should be provided.

    With the latest commits (up to commit #08011dd) I still see the error when creating a new output file.

    The 'cling' error message? It will go away if you define $ROOT_INCLUDE_PATH. I don't know another solution unfortunately. However, it doesn't seem to be very important.

  7. Jochem Snuverink

    Okay I think I found another way to remove the error message:

    In BDSOutputROOTEventOptions.hh:

    replace

    #include "parser/optionsBase.h"
    

    with

    #include "../parser/optionsBase.h"
    

    Rationale: ROOT searches for parser/optionsBase.h only relative to BDSOutputROOTEventOptions.hh (if no other include paths are presented) and will be able to find it in this way. This also seems to work for an installed binary.

  8. Log in to comment