Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions offline/QA/KFParticle_Track2Calo/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
AUTOMAKE_OPTIONS = foreign

lib_LTLIBRARIES = \
libQAKFParticleTracktoCalo.la

AM_LDFLAGS = \
-L$(libdir) \
-L$(OFFLINE_MAIN)/lib

AM_CPPFLAGS = \
-I$(includedir) \
-isystem$(OFFLINE_MAIN)/include \
-isystem`root-config --incdir`

pkginclude_HEADERS = \
QAKFParticleTracktoCalo.h

libQAKFParticleTracktoCalo_la_SOURCES = \
QAKFParticleTracktoCalo.cc

libQAKFParticleTracktoCalo_la_LDFLAGS = \
-L$(libdir) \
-L$(OFFLINE_MAIN)/lib \
-lKFParticle \
-lcalo_io \
-lCLHEP \
-lfun4all
Comment on lines +21 to +27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm how peer Makefile.am files declare link libraries vs LDFLAGS,
# and which libraries export the symbols/headers this module uses.
set -e
fd -a 'Makefile.am' offline/QA | xargs -I{} sh -c 'echo "=== {} ==="; cat {}' | sed -n '1,2000p'
echo "--- headers that declare the classes we depend on ---"
for sym in KFParticle_Container SvtxTrackMap ActsGeometry SvtxVertexMap QAHistManagerDef TrkrClusterContainer; do
  echo "### $sym"
  rg -n --no-heading -g '*.h' "class\s+$sym\b" offline || true
done

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 32575


🏁 Script executed:

# Examine the QAKFParticleTracktoCalo source files
cd offline/QA/KFParticle_Track2Calo
echo "=== QAKFParticleTracktoCalo.h ===" 
cat -n QAKFParticleTracktoCalo.h
echo ""
echo "=== QAKFParticleTracktoCalo.cc (first 150 lines) ===" 
head -150 QAKFParticleTracktoCalo.cc

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 16688


🏁 Script executed:

# Search for QAHistManagerDef
rg -n "QAHistManagerDef" offline --type h

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 522


🏁 Script executed:

# Check the KFParticle/Makefile.am sibling for comparison
cat -n offline/QA/KFParticle/Makefile.am

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 1346


Use LIBADD instead of LDFLAGS and add missing library dependencies.

Verified: This module uses LDFLAGS (incorrect for libtool targets), while all sibling QA modules correctly use LIBADD. Additionally, the source code includes headers from several libraries not currently linked:

  • KFParticle_Container, KFParticle_Tools-lkfparticle_sphenix (line 26–27 of header)
  • SvtxTrack, SvtxTrackMap-ltrack_io (lines 29–30)
  • ActsGeometry, TrkrCluster*, TrkrDefs-ltrackbase_historic (lines 31–37)
  • SvtxVertexMap, SvtxVertex-lglobalvertex_io (lines 22–23)
  • QAHistManagerDef-lqautils (qautils/QAHistManagerDef.h in source)
  • SubsysReco-lSubsysReco (line 4; not always transitively exported by -lfun4all)
  • -lphool is also needed (used throughout; included by peer modules)
Suggested rework
-libQAKFParticleTracktoCalo_la_LDFLAGS = \
-  -L$(libdir) \
-  -L$(OFFLINE_MAIN)/lib \
-  -lKFParticle \
-  -lcalo_io \
-  -lCLHEP \
-  -lfun4all
+libQAKFParticleTracktoCalo_la_LIBADD = \
+  -lKFParticle \
+  -lkfparticle_sphenix \
+  -lcalo_io \
+  -lCLHEP \
+  -lfun4all \
+  -lSubsysReco \
+  -lphool \
+  -lqautils \
+  -lglobalvertex_io \
+  -ltrack_io \
+  -ltrackbase_historic
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
libQAKFParticleTracktoCalo_la_LDFLAGS = \
-L$(libdir) \
-L$(OFFLINE_MAIN)/lib \
-lKFParticle \
-lcalo_io \
-lCLHEP \
-lfun4all
libQAKFParticleTracktoCalo_la_LIBADD = \
-lKFParticle \
-lkfparticle_sphenix \
-lcalo_io \
-lCLHEP \
-lfun4all \
-lSubsysReco \
-lphool \
-lqautils \
-lglobalvertex_io \
-ltrack_io \
-ltrackbase_historic


clean-local:
rm -f $(BUILT_SOURCES)
Loading