Linking TPythia8 with root

Hi all! I am trying to test out the root tutorial: pythiaExample.C using TPythia8.h instead of TPythia6.h. When I try to load and execute in root prompt it returns:

/path/to/pythia8.C:2:10 fatal error: ‘TPythia8.h’ file not found.

I copied the header to /root-6.26.10-install/include/TPythia8.h
and get a similar error:
/path/to/root-6.26.10-install/include/TPythia8.h:9:10 fatal error: ‘Pythia8/Pythia.h’ file not found.

Seems like I need to add the standalone pythia header to root’s compile path?

Thanks in advance!

ROOT Version: 6.26.10
Platform: Ubuntu 22
Compiler: g++


Check if: root-config --has-pythia8

It returned a flat ‘no’. Can you advise me on how to fix this?

You need to build ROOT from source or you can try the conda package (which possibly provides it).

Hi, I rebuilt ROOT from source using the instructions in the link you provided. I am still getting the same error and root-config --has-pythia8 is still returning a flat no.

Maybe you need something like this:
cmake -Dpythia8=ON -DPYTHIA8_DIR=/path/to/Pythia8/installation /path/to/ROOT/source