FastJet within ROOT import issue

Hi all,

I am trying to use FastJet within a ROOT macro. A have the error:

fatal error: 'fastjet/config.h' file not found
#include "fastjet/config.h"

Even if I do:

gSystem->AddIncludePath("/Users/corredoira097/Desktop/PhD/HV/code/fastjet-install/include");

or

gSystem->AddIncludePath("-I/Users/corredoira097/Desktop/PhD/HV/code/fastjet-install/include");

Do I have to modify any environment variable? Is gSystem->AddIncludePath properly used ?

Cheers,
Imanol


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi @imanol097,

setting the include path like this only works if you compile your scripts with ACLiC like explained here:

So after starting the ROOT interpreter, you add the include path, then you compile and run the script:

root [0] gSystem->AddIncludePath("-I/Users/corredoira097/Desktop/PhD/HV/code/fastjet-install/include");
root [1] .x myMacro.C+()

Alternatively, you have to put install the fastjet headers in the system, or compile your macro as a standalone C++ executable where you pass the include paths to the compiler, or your hardcode the paths in the actual #includes. If you prefer any of these options and need help with them, feel free to ask again here!

Hi @jonas , thanks for your answer.

I did what you suggest and now I don’t have the problem that I used to have. The thing is that it does not work yet, It says that:

/Users/corredoira097/Desktop/PhD/HV/code/fastjet-install/include/fastjet/ClusterSequence.hh:377:44: error: no template named 'auto_ptr' in namespace 'std'
  inline void plugin_associate_extras(std::auto_ptr<Extras> extras_in)){
                                      ~~~~~^
/Users/corredoira097/Desktop/PhD/HV/code/fastjet-install/include/fastjet/internal/deprecated.hh:43:71: note: expanded from macro 'FASTJET_DEPRECATED_MSG'
#define FASTJET_DEPRECATED_MSG(message,func)  [[deprecated(message)]] func

This is weird because this FastJet version should work with C++11 standard (or later) according to the documentation in FastJet 3.4.0 release. I am using ROOT Version: 6.28/00, which is from February 2023.

Do you have some idea?

Cheers,
Imanol

What is the output of root-config --cflags? It tells you what was the C++ standard used to compile ROOT. You have to use the same C++ standards in your scripts.

If it’s C++17, then the deprecated auto_ptr was removed from the standard:
https://en.cppreference.com/w/cpp/memory/auto_ptr

In that case, you can’t use any headers that have the auto_ptr, and if fastjet uses it is not compliant with the C++11 standard or later, because it is not compliant with C++17 anymore. Maybe a new version of fastjet is? Or you can just replace the std::auto_ptr in the fastjet sources with std::unique_ptr?

Anyway, it’s not really a ROOT problem anymore :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.