Linking Pythia with ROOT error

Hello, I was trying to link Pythia with Root. I used this manual to do it:
I tried other methods but they never seemed to work. But this error comes up when I compile ROOT with make.

(.text+0x1262): undefined reference to `BZ2_bzReadOpen'
(.text+0x1289): undefined reference to `BZ2_bzRead'
(.text+0x12c0): undefined reference to `BZ2_bzReadClose'
(.text+0x131e): undefined reference to `BZ2_bzReadClose'
(.text+0x1397): undefined reference to `BZ2_bzReadClose'
(.text+0x13f7): undefined reference to `BZ2_bzReadClose'
/usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrnet.o): In function `https_open_network':
(.text+0x761): undefined reference to `curl_easy_init'
(.text+0x778): undefined reference to `curl_easy_setopt'
(.text+0x7a1): undefined reference to `curl_easy_setopt'
(.text+0x7b7): undefined reference to `curl_easy_setopt'
(.text+0x7cd): undefined reference to `curl_easy_setopt'
(.text+0x810): undefined reference to `curl_easy_setopt'
/usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrnet.o):(.text+0x833): more undefined references to `curl_easy_setopt' follow
/usr/lib/x86_64-linux-gnu/libcfitsio.a(drvrnet.o): In function `https_open_network':
(.text+0x8df): undefined reference to `curl_easy_perform'
(.text+0x905): undefined reference to `curl_easy_cleanup'
(.text+0x93c): undefined reference to `curl_easy_setopt'
(.text+0x94d): undefined reference to `curl_easy_setopt'
(.text+0x955): undefined reference to `curl_easy_perform'
(.text+0x9b5): undefined reference to `curl_easy_setopt'
(.text+0x9bd): undefined reference to `curl_easy_perform'
(.text+0xa63): undefined reference to `curl_easy_cleanup'
(.text+0xb07): undefined reference to `curl_easy_setopt'
(.text+0xb0f): undefined reference to `curl_easy_perform'
collect2: error: ld returned 1 exit status
/usr/marooz_work/root/graf2d/fitsio/ recipe for target 'lib/' failed
make: *** [lib/] Error 1
make: *** Waiting for unfinished jobs....
==> lib/ done

ROOT v5-34-38
gcc version 7.4.0
ubuntu 18.04.2 LTS

you are (at least) missing ( curl_easy_cleanup)
and ( BZ2_bzReadOpen) to be found in
Modify your configure scripts/Makefile accordingly

However I would highly recommend:
Install pythia8:
Install ROOT 6.18.00 as described here:
with pythia8 enabled


1 Like

Is this a valid command to compile ROOT,

cmake -DCMAKE_INSTALL_PREFIX=/usr/marooz_work/rootinstall -DPYTHIA8_DIR=$PYTHIA8 -DPYTHIA8_INCLUDE_DIR=$PYTHIA8/include -DPYTHIA8_LIBRARY=$PYTHIA8/lib/ -DGSL_DIR=/usr/local -Dbuiltin_xrootd=ON -Droofit=ON -Dpythia8=ON …/root

cmake --build . --target install – -j1

because when I do so i get an error like this:
[ 22%] Performing build step for ‘XROOTD’
CMake Error at /usr/marooz_work/rootinstall/XROOTD-prefix/src/XROOTD-stamp/XROOTD-build-RelWithDebInfo.cmake:16 (message):
Command failed: 2


See also


CMakeFiles/XROOTD.dir/build.make:111: recipe for target ‘XROOTD-prefix/src/XROOTD-stamp/XROOTD-build’ failed
make[2]: *** [XROOTD-prefix/src/XROOTD-stamp/XROOTD-build] Error 1
CMakeFiles/Makefile2:104: recipe for target ‘CMakeFiles/XROOTD.dir/all’ failed
make[1]: *** [CMakeFiles/XROOTD.dir/all] Error 2
Makefile:151: recipe for target ‘all’ failed
make: *** [all] Error 2


I assume you did:

git clone
cd root
git checkout -b v6-18-00 v6-18-00

I just successfully built 6.18.00 on Ubuntu 18.04.02 with -Dbuiltin_xrootd=ON

Was the first cmake step ok?
Which version of cmake do you use: cmake --version
What is in:



1 Like

Hey, I tried building 6-18-00 in a new directory with the same steps as mentioned by you. the first cmake step went ok this time. my cmake version is 3.10.2. but everything stopped with this error:

– Installing: /usr/marooz_work/ROOT/buildroot/include/TClingRuntime.h
CMake Error at core/clingutils/cmake_install.cmake:55 (file):
file INSTALL cannot find
Call Stack (most recent call first):
core/cmake_install.cmake:67 (include)
cmake_install.cmake:218 (include)

Makefile:95: recipe for target ‘install’ failed
make: *** [install] Error 1

Is there any way to ignore this error?

could you try without:


I normally do after successful build:

make dist

and untar the resulting


at the place of installation


thank you for your answer. “make” worked fine and i was able to compile root properly. pythia8 example in my buildroot/tutorials also works now. but main91 and main92 still don’t work. main91 gives the error that it requires root and main92 shows:[_ZN4ROOT6Detail20TCollectionProxyInfo9IteratorsISt6vectorIN7Pythia86InBeamESaIS5_EELb0EE4nextEPvPKv]+0x7): undefined reference to kAssertMsg'[_ZN4ROOT6Detail20TCollectionProxyInfo9IteratorsISt6vectorIN7Pythia86InBeamESaIS5_EELb0EE4nextEPvPKv]+0x2b): undefined reference toFatal(char const*, char const*, …)’
/tmp/ccWlkVTX.o: In function ROOT::Detail::TCollectionProxyInfo::Iterators<std::vector<Pythia8::DecayChannel, std::allocator<Pythia8::DecayChannel> >, false>::next(void*, void const*)':[_ZN4ROOT6Detail20TCollectionProxyInfo9IteratorsISt6vectorIN7Pythia812DecayChannelESaIS5_EELb0EE4nextEPvPKv]+0x7): undefined reference tokAssertMsg’[_ZN4ROOT6Detail20TCollectionProxyInfo9IteratorsISt6vectorIN7Pythia812DecayChannelESaIS5_EELb0EE4nextEPvPKv]+0x2b): undefined reference to Fatal(char const*, char const*, ...)' /tmp/ccWlkVTX.o: In functionPythia8::ROOT::Pythia8_Dictionary()’:[_ZN7Pythia84ROOT20GenerateInitInstanceEv]+0x41): undefined reference to ROOT::Internal::DefineBehavior(void*, void*)'[_ZN7Pythia84ROOT20GenerateInitInstanceEv]+0x76): undefined reference toROOT::TGenericClassInfo::TGenericClassInfo(char const*, int, char const*, int, ROOT::Internal::TInitBehavior const*, TClass* (*)(), int)’[_ZN7Pythia84ROOT20GenerateInitInstanceEv]+0x87): undefined reference to ROOT::TGenericClassInfo::~TGenericClassInfo()'[_ZN7Pythia84ROOT20GenerateInitInstanceEv]+0x2b): undefined reference toROOT::TGenericClassInfo::GetClass()’[_ZN7Pythia84ROOT20GenerateInitInstanceEv]+0xa6): undefined reference to ROOT::TGenericClassInfo::GetClass()' /tmp/ccWlkVTX.o: In’: undefined reference to `TVersionCheck::TVersionCheck(int)’
collect2: error: ld returned 1 exit status
Makefile:159: recipe for target ‘’ failed
make: *** [] Error 1

I am quoting some part of the “error”. I hope i can fix this somehow without compiling root again :slight_smile: .

seems to me in your pythia env you dont see your ROOT installation

this symbol is defined in ROOTs

Does this work in your pythia dir:
root-config --glibs
Do you have e.g. $ROOT_LIBS defined
in pythias Makefile we have:

main92: $$ $$@.h $$@LinkDef.h $(PREFIX_LIB)/libpythia8.a
ifeq ($(ROOT_USE),true)
         $(ROOT_BIN)rootcint -f $ -c -I$(PREFIX_INCLUDE) $@.h $@LinkDef.h
        $(CXX) $ $^ -o $@ -w -I$(ROOT_INCLUDE) $(CXX_COMMON)\
         -Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)root-config --glibs`
        @echo "Error: $@ requires ROOT"


I forgot:
Assume ROOTSYS points to your ROOT installation then
you should do:

source $ROOTSYS/bin/

this should initialize the needed env variables


Hey, I am sorry for the late reply. I do have source $ROOTSYS/bin/ in my .bashrc and I have also given the ROOT_libs path. This is what I have in .bashrc:

export PYTHIA8=/usr/marooz_work/pythia8243
export PYTHIA8DATA=/usr/marooz_work/pythia8243/share/Pythia8/xmldoc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/marooz_work/pythia8243/lib
export ROOTSYS=/usr/marooz_work/ROOT/buildroot
export PATH=$PATH:$ROOTSYS/bin

source $ROOTSYS/bin/

and using root-config --glibs in pythia directory gives:
-L/usr/marooz_work/ROOT/buildroot/lib -lGui -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -pthread -lm -ldl -rdynamic

But I do not have anything like what you quoted in Makefile. I am afraid that it might be the actual problem. Infact in, I have for ROOT:

ROOT configuration.


there seems in fact a problem with pythias Makefile concerning ROOT.
I did with ROOT 6.18.00:
Download the latest pythia8243.tgz, untar and go to pythia8243
Make sure ROOTSYS is correctly set

./configure --with-root=$ROOTSYS

Go to examples and check if in ROOT vars are
correctly set, e.g. for me:


Modify the Makefile:
line 37:

CXX_COMMON+= -Wl,-rpath, -L$(PREFIX_LIB) -lpythia8 -ldl

Replace code for targets main91, main92 by the following:

main91: $$ $(PREFIX_LIB)/libpythia8.a
ifeq ($(ROOT_USE),true)
        $(CXX) $< -o $@ -w $(CXX_COMMON)\
         `$(ROOT_BIN)/root-config --cflags`\
         -Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)/root-config --glibs`
        @echo "Error: $@ requires ROOT"
main92: $$ $(PREFIX_LIB)/libpythia8.a
ifeq ($(ROOT_USE),true)
        $(CXX) $< -o $@ -w -I$(ROOT_INCLUDE) \
         `$(ROOT_BIN)/root-config --cflags` -Wl,-rpath,./\
         -Wl,-rpath,$(ROOT_LIB) $(CXX_COMMON) `$(ROOT_BIN)/root-config --glibs`
        @echo "Error: $@ requires ROOT"
endif $(PREFIX_LIB)/libpythia8.a
        $(CXX) $< -o $@ -c -w -I$(ROOT_INCLUDE) $(CXX_SHARED) $(CXX_COMMON)\
         `$(ROOT_BIN)/root-config --cflags` main92.h main92LinkDef.h
         $(ROOT_BIN)/rootcint -f $@ -c -I$(PREFIX_INCLUDE) $^

Essentially: ROOTBIN ->ROOT_BIN, add a “/” before root-config and rootcint,
add -c option in target
Then try

make main91
make main92

I am not sure who takes care of this Makefile especially the ROOT part.


hey, I did exactly as u said. ROOT_BIN has the correct path and line 37 is same. and Makefile is same as you quoted. But make main91 gives the error: fatal error: Pythia8/Pythia.h: No such file or directory
#include “Pythia8/Pythia.h”
compilation terminated.
Makefile:144: recipe for target ‘main91’ failed
make: *** [main91] Error 1

sorry there was still a “/” missing in main91:
but this should have given a different error message (in fact about 5 pages)
Could you try with this and show the complete log:
Esp. the line with: g++ …

main91: $$ $(PREFIX_LIB)/libpythia8.a
ifeq ($(ROOT_USE),true)
        $(info CXX_COMMON= $(CXX_COMMON))
        $(info ROOT_BIN= $(ROOT_BIN))
        $(CXX) $< -o $@ -w $(CXX_COMMON)\
         `$(ROOT_BIN)/root-config --cflags`\
         -Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)/root-config --glibs`

what about: make main92?

same error:
ROOT_BIN= /usr/marooz_work/ROOT/buildroot/bin
Makefile:146: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.

makefile is very picky:
“TABs and spaces are as from different worlds”
Please replace the spaces by TAB

1 Like

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