# How to link fastjet-contrib libraries in a ROOT macro

**URL:** <https://root-forum.cern.ch/t/how-to-link-fastjet-contrib-libraries-in-a-root-macro/46596>\
**Category:** Newbie\
**Created:** [August 31, 2021, 4:15pm UTC](https://root-forum.cern.ch/t/how-to-link-fastjet-contrib-libraries-in-a-root-macro/46596 "2021-08-31T16:15:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbya99](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kbya99/32/28250_2.png) [@kbya99](https://root-forum.cern.ch/u/kbya99)\
**Post date:** [August 31, 2021, 4:15pm UTC](https://root-forum.cern.ch/t/how-to-link-fastjet-contrib-libraries-in-a-root-macro/46596/1 "2021-08-31T16:15:34Z")

</div>

Hi,

I am trying to use the RecursiveTools, EnergyCorrelator and Nsubjettiness packages from fastjet-contrib. My goal is to calculate these features on jets clustered from tower objects read from a .root file, within a ROOT macro.

I understand that I have to link all the relevant libraries by using gSystem-\>Load(…). I can successfully load the libfastjet.so and libfastjettools.so. However, when it comes to the contrib libraries, which are .a files, errors pop up. I think the issue is something to do with loading .so files versus .a files.

Can someone please explain how to link the .a files for fastjet-contrib packages? Thank you!

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 31, 2021, 4:21pm UTC](https://root-forum.cern.ch/t/how-to-link-fastjet-contrib-libraries-in-a-root-macro/46596/2 "2021-08-31T16:21:48Z")

</div>

You need to rebuild your libraries as shared (i.e., “.so”).

---

<div class="post-metadata">

**Author:** ![kbya99](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kbya99/32/28250_2.png) [@kbya99](https://root-forum.cern.ch/u/kbya99)\
**Post date:** [August 31, 2021, 4:26pm UTC](https://root-forum.cern.ch/t/how-to-link-fastjet-contrib-libraries-in-a-root-macro/46596/3 "2021-08-31T16:26:07Z")

</div>

Thank you for the quick reply! I am not so sure how to do that, since I am a noob at C++ stuff (I come from a Python background). Are there tools that can readily do this?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 31, 2021, 4:43pm UTC](https://root-forum.cern.ch/t/how-to-link-fastjet-contrib-libraries-in-a-root-macro/46596/4 "2021-08-31T16:43:52Z")

</div>

You need to talk to the authors of these packages.

A quick peek into the [HEPForge → fastjetsvn/contrib/contribs/RecursiveTools/trunk/Makefile](https://phab.hepforge.org/source/fastjetsvn/browse/contrib/contribs/RecursiveTools/trunk/Makefile) suggests that only building of an archive library (i.e., “.a”) is implemented.
