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

Iguana #69

Merged
merged 13 commits into from
May 29, 2024
Merged

Iguana #69

merged 13 commits into from
May 29, 2024

Conversation

dglazier
Copy link
Collaborator

Include an Iguana interface for clas12root
Header only classes given in iguana/ loaded at runtime via LoadIguana.C
Simple usage, configuration done behind the scenes :

  clas12root::Iguana ig;
  ig.GetTransformers().Use("clas12::MomentumCorrection");
  //add many other transforms, creators, filters
  ...
  while ( chain.Next() ){
    ...
    //apply all corrections to particles
    ig.GetTransformers().doAllCorrections({electron,pip,pim},{&p4el,&p4pip,&p4pim});

@dglazier dglazier self-assigned this May 24, 2024
Comment on lines +9 to +17
gInterpreter->AddIncludePath(IGUANA+"/include");

gROOT->ProcessLine("#include <iguana/algorithms/AlgorithmBoilerplate.h>");
gROOT->ProcessLine("#include <iguana/algorithms/AlgorithmSequence.h>");
gROOT->ProcessLine("#include <iguana/algorithms/Algorithm.h>");

gSystem->Load("$IGUANA/lib/libIguanaServices.so");
gSystem->Load("$IGUANA/lib/libIguanaAlgorithms.so");
gSystem->Load("$IGUANA/lib/libIguanaValidators.so");
Copy link
Member

Choose a reason for hiding this comment

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

If this is all $IGUANA is used for, then I don't think it's necessary, since $ROOT_INCLUDE_PATH and $(DY)LD_LIBRARY_PATH should be sufficient. Have you tested that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are correct, in principle includes and lib directories can be linked in that way. However I do have a preference for the explicit setting of the variable for a couple fo reasons. I think it is simpler and clearer for inexperienced users installing on their own machines and when there are multiple versions of dependencies on a machine (in this case iguana) you can easily switch between them and know exactly which one you are using. For example on ifarm at the moment when I was trying to just use ROOT_INCLUDE_PATH for linking clas12root there turned out to be an issue that module unload did not remove clas12root from the ROOT_INCLUDE_PATH and I got strange and difficult to debug errors.

I do not have particularly strong opinion on this, so could be persuaded to change.
Cheers
Derek

@c-dilks
Copy link
Member

c-dilks commented May 28, 2024

@baltzell
Copy link
Collaborator

Can you provide an example of how to reproduce the problem with a (clas12root) module not unloading correctly? I currently can't reproduce it.

@baltzell
Copy link
Collaborator

FWIW, ROOT_INCLUDE_PATH is necessary to make clas12root (and clas12-elSpectro) movable

@dglazier
Copy link
Collaborator Author

Actually, no I cannot reproduce this, clas12root is removed from ROOT_INCLUDE_PATH.

@dglazier dglazier merged commit fac3340 into JeffersonLab:master May 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants