Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ROOT IO for celer-g4 SD output #949

Closed
wants to merge 2 commits into from

Conversation

pcanal
Copy link
Contributor

@pcanal pcanal commented Sep 20, 2023

No description provided.

@stognini
Copy link
Member

Just tried to build this locally (on macOS, not Linux), and besides a couple basic errors that I address in #950, I also hit this one:

[496/497] Linking CXX shared library lib/libceler-g4-io.dylib
FAILED: lib/libceler-g4-io.dylib 
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wall -Wextra -pedantic -fcolor-diagnostics -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -dynamiclib -Wl,-headerpad_max_install_names -L/usr/local/opt/qt@5/lib   -L/Users/Shared/ornldev/code/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/hwloc-2.9.1-vbhj7boo2gdj3h73a34dvvx7axzenhy6/lib -L/Users/Shared/ornldev/code/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/libevent-2.1.12-tzkcxwonksly7i2r2q5hn72wxvq2345c/lib -L/Users/Shared/ornldev/code/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/pmix-4.2.3-766a46zvts22uulmbkawo4jx4rzvd3bi/lib -o lib/libceler-g4-io.dylib -install_name @rpath/libceler-g4-io.dylib app/celer-g4/CMakeFiles/celer-g4-io.dir/HitClassesRootInterfaces.cxx.o app/celer-g4/CMakeFiles/celer-g4-io.dir/HitRootIO.cc.o -F/usr/local/opt/qt@5/lib -Wl,-rpath,/Users/4s2/celeritas-project/celeritas/build/lib -Wl,-rpath,/Users/4s2/programs/root/install/lib -Wl,-rpath,/Users/Shared/ornldev/code/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/vecgeom-1.2.3-orw3mfmhdxminf2kla3dp4ndsz23bnry/lib -Wl,-rpath,/Users/4s2/programs/geant4/install-v1103/lib  lib/libaccel.dylib  /Users/4s2/programs/root/install/lib/libTree.so  lib/libceleritas.dylib  /Users/Shared/ornldev/code/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/vecgeom-1.2.3-orw3mfmhdxminf2kla3dp4ndsz23bnry/lib/libvecgeom.dylib  lib/libcorecel.dylib  /Users/Shared/ornldev/code/spack/opt/spack/darwin-monterey-skylake/apple-clang-14.0.0/openmpi-4.1.5-lbbmodybuodqy2ot6iwaxmr3qtap3f5j/lib/libmpi.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4Tree.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4FR.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4GMocren.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4visHepRep.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4RayTracer.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4VRML.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4vis_management.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4modeling.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4interfaces.dylib  /usr/local/opt/qt@5/lib/QtWidgets.framework/QtWidgets  /usr/local/opt/qt@5/lib/QtGui.framework/QtGui  /usr/local/opt/qt@5/lib/QtCore.framework/QtCore  /Users/4s2/programs/geant4/install-v1103/lib/libG4persistency.dylib  /usr/local/lib/libxerces-c.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4error_propagation.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4readout.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4physicslists.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4tasking.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4run.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4event.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4tracking.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4parmodels.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4processes.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4analysis.dylib  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/lib/libexpat.tbd  /Users/4s2/programs/geant4/install-v1103/lib/libG4digits_hits.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4track.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4particles.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4geometry.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4materials.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4graphics_reps.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4intercoms.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4global.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4tools.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4clhep.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4zlib.dylib  /Users/4s2/programs/geant4/install-v1103/lib/libG4ptl.0.0.2.dylib  /Users/4s2/programs/root/install/lib/libMathCore.so  /Users/4s2/programs/root/install/lib/libImt.so  /Users/4s2/programs/root/install/lib/libMultiProc.so  /Users/4s2/programs/root/install/lib/libNet.so  /Users/4s2/programs/root/install/lib/libRIO.so  /Users/4s2/programs/root/install/lib/libThread.so  /Users/4s2/programs/root/install/lib/libCore.so && :
Undefined symbols for architecture x86_64:
  "celeritas::app::GlobalSetup::Instance()", referenced from:
      celeritas::app::HitRootIO::HitRootIO() in HitRootIO.cc.o
      celeritas::app::HitRootIO::WriteObject(celeritas::app::HitRootEvent*) in HitRootIO.cc.o
  "celeritas::app::SensitiveHit::allocator()", referenced from:
      celeritas::app::SensitiveHit::operator new(unsigned long) in HitClassesRootInterfaces.cxx.o
      celeritas::app::SensitiveHit::operator delete(void*) in HitClassesRootInterfaces.cxx.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

@mrguilima
Copy link
Contributor

mrguilima commented Sep 20, 2023

On my MacOS, I also see the same thing as Stefano, but with two more lines:

ld: Undefined symbols:
  celeritas::app::GlobalSetup::Instance(), referenced from:
      celeritas::app::HitRootIO::HitRootIO() in HitRootIO.cc.o
      celeritas::app::HitRootIO::WriteHits(G4Event const*) in HitRootIO.cc.o
      celeritas::app::HitRootIO::WriteObject(celeritas::app::HitRootEvent*) in HitRootIO.cc.o
  celeritas::app::SensitiveHit::allocator(), referenced from:
      ROOT::new_celeritascLcLappcLcLSensitiveHit(void*) in HitClassesRootInterfaces.cxx.o.     <----
      ROOT::delete_celeritascLcLappcLcLSensitiveHit(void*) in HitClassesRootInterfaces.cxx.o. <----
      celeritas::app::SensitiveHit::operator delete(void*) in HitClassesRootInterfaces.cxx.o
      celeritas::app::SensitiveHit::~SensitiveHit() in HitClassesRootInterfaces.cxx.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@sethrj sethrj marked this pull request as draft September 21, 2023 10:04
@sethrj sethrj added external Dependencies and framework-oriented features app Application front ends labels Sep 21, 2023
@sethrj sethrj changed the title Put celer-g4 ROOT IO dict in a shared library Support ROOT IO for celer-g4 SD output Sep 21, 2023
@sethrj
Copy link
Member

sethrj commented Sep 21, 2023

@pcanal @stognini Would it be reasonable for us to have a standard "SD hit output" object that we keep in celeritas/io and use in our celer-g4 app? That could make it easier for us to, say, export hits directly from CPU through celer-sim and compare performance, in addition to making it easier to use the output from celer-g4.

@sethrj
Copy link
Member

sethrj commented Oct 12, 2023

@pcanal @stognini This will be replaced by Stefano's work to put in a "hit output" in celeritas/io right? This was just a temporary hack to get out CMS verifiction data in time for the geant4 presentation, wasn't it?

@stognini
Copy link
Member

I made a similar update on my branch to get a dictionary for testing my decoupling of classes/data. So we will need a dictionary anyway. I guess the question is: are we fine with the dictionary being generated this way, or is there something else planned? The main difference between here and my branch is that my HitClassesLinkDef, and therefore the final dictionary, is much simpler, with just structs with basic types.

@sethrj
Copy link
Member

sethrj commented Oct 13, 2023

Let's stick with @stognini 's branch; simpler structs are better too. Also, didn't we discuss putting the dictionary code in celeritas/io? The way ROOT works, we kind of need the dictionaries to sit alongside the libraries, right?

@pcanal
Copy link
Contributor Author

pcanal commented Oct 13, 2023

we kind of need the dictionaries to sit alongside the libraries, right?

Not completely necessary but much easier.

@sethrj sethrj closed this Oct 23, 2023
@sethrj sethrj added the performance Changes for performance optimization label Nov 14, 2023
@pcanal pcanal deleted the celer-g4-io branch October 18, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Application front ends external Dependencies and framework-oriented features performance Changes for performance optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants