Project

General

Profile

Bug #13446

service libraries now need a link to the root core library

Added by Lynn Garren almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
08/04/2016
Due date:
% Done:

100%

Estimated time:
4.00 h
Spent time:
Scope:
Internal
Experiment:
-
SSI Package:
art
Duration:

Description

At some point between art 2.00.03 and 2.02.01, builds of the service libraries have changed to require TVersionCheck. An error such as the following occurs, and can be resolved by including ${ROOT_CORE} in the appropriate CMakeLists.txt file.

[ 42%] Linking CXX shared library ../../lib/liblardata_Utilities_LArPropertiesServiceArgoNeuT_service.so
CMakeFiles/lardata_Utilities_LArPropertiesServiceArgoNeuT_service.dir/LArPropertiesServiceArgoNeuT_service.cc.o: In function `__static_initialization_and_destruction_0':
/products/root/v6_06_04b/Linux64bit+2.6-2.12-e10-nu-prof/include/TVersionCheck.h:34: undefined reference to `TVersionCheck::TVersionCheck(int)'
collect2: error: ld returned 1 exit status
make[2]: *** [lardata/lib/liblardata_Utilities_LArPropertiesServiceArgoNeuT_service.so] Error 1
make[1]: *** [lardata/lardata/Utilities/CMakeFiles/lardata_Utilities_LArPropertiesServiceArgoNeuT_service.dir/all] Error 2

History

#1 Updated by Kyle Knoepfel almost 3 years ago

  • Status changed from New to Accepted
  • Estimated time set to 4.00 h

#2 Updated by Kyle Knoepfel almost 3 years ago

  • Assignee set to Paul Russo

#3 Updated by Paul Russo almost 3 years ago

The cause is located at:

canvas/canvas/Persistency/Common/detail/aggregate.h line 27:

#include "TH1.h" 

in order to make this possible:

    //==============================================================
    // ROOT-TH1 specializations

    template <typename T>
    struct CanBeAggregated<T, std::enable_if_t<std::is_base_of<TH1,T>::value>> : std::true_type {
      static void aggregate(T& p, T const& other)
      {
        p.Add(&other);
      }
    };

Which enables ROOT histograms to be aggregated automatically using their Add() member function.

#4 Updated by Paul Russo almost 3 years ago

The commit where this appeared is:

$ git log -L27,27:canvas/Persistency/Common/detail/aggregate.h
commit 511095387837c5affb0e74c1d6b4619d7593d125
Author: Kyle Knoepfel <knoepfel@fnal.gov>
Date:   Fri May 6 15:32:29 2016 -0500

    Add (and test) aggregation behavior for TH1-derived objects.

diff --git a/canvas/Persistency/Common/detail/aggregate.h b/canvas/Persistency/Common/detail/aggregate.h
--- a/canvas/Persistency/Common/detail/aggregate.h
+++ b/canvas/Persistency/Common/detail/aggregate.h
@@ -26,0 +26,1 @@
+#include "TH1.h" 

$ git name-rev --tags 511095387837c5affb0e74c1d6b4619d7593d125
511095387837c5affb0e74c1d6b4619d7593d125 tags/ART_SUITE_v2_01_00^2~19

#5 Updated by Kyle Knoepfel almost 3 years ago

Paul, Lynn, please stop by when you have the chance. If I clone lardata and checkout commit lardata:commit:bb1c7086bf3e5 (one before the commit that added the ROOT_CORE library to the services), I get a clean debug and prof builds. Furthermore, when I run the preprocessor on LArPropertiesServiceArgoNeuT_service.cc, the TH1 and aggregate.h headers are not included at all.

I would appreciate it if you could stop by so we can sort this out.

#6 Updated by Kyle Knoepfel almost 3 years ago

Lynn informed me that the art version lardata depends upon had not yet been updated. After updating to the new version, I confirm the error and Paul's diagnosis. Nice work, Paul.

Thinking of solutions...

#7 Updated by Kyle Knoepfel almost 3 years ago

The fix was simple, although it required a bit of thinking. It was sufficient to forward-declare TH1 in the aggregate.h file instead of including the TH1.h file.

Implemented with commit canvas:7471e2fe.

#8 Updated by Kyle Knoepfel almost 3 years ago

I confirm that the lardata services now build correctly with the above commit, without needing to add the ROOT_CORE library as a dependency.

#9 Updated by Kyle Knoepfel almost 3 years ago

  • Project changed from cet-is to canvas
  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100
  • SSI Package art added
  • SSI Package deleted ()

#10 Updated by Kyle Knoepfel almost 3 years ago

  • Status changed from Resolved to Closed
  • Target version set to 2.03.00


Also available in: Atom PDF