ROOT Version: 6.16/00
Platform: Ubuntu 18.04
Compiler: gcc 7.3.0
Hello there.
I am trying to link ROOT (version 6.16.00) and PYTHIA8 (version 8.240) following the instructions from http://home.thep.lu.se/Pythia/pythia82html/ROOTusage.html
I can run Pythia as a plugin because the Pythia8.C from myROOTdirectory/tutorials/pythia is running, but I can’t run main91.cc and also main92-93 from myPYTHIAdirectory/examples.
Compiler gives me the following:
g++ main91.cc -o main91 -w -I -I../include -O2 -pedantic -W -Wall -Wshadow -fPIC -L../lib -Wl,-rpath,../lib -lpythia8 -ldl \
`/root-config --cflags`\
-Wl,-rpath, `/home/ilias/root/bin/root-config --glibs`
bash: /root-config: No such file or directory
main91.cc:15:10: fatal error: Pythia8/Pythia.h: No such file or directory
#include "Pythia8/Pythia.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:152: recipe for target 'main91' failed
make: *** [main91] Error 1
I provide also the info from the Makefile in myPYTHIAdirectory/examples
main91: $$@.cc $(PREFIX_LIB)/libpythia8.a
ifeq ($(ROOT_USE),true)
$(CXX) $< -o $@ -w -I$(ROOT_INCLUDE) $(CXX_COMMON)\
`$(ROOTBIN)/root-config --cflags`\
-Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)/root-config --glibs`
else
@echo "Error: $@ requires ROOT"
endif
main92: $$@.cc $(PREFIX_LIB)/libpythia8.a main92.so
ifeq ($(ROOT_USE),true)
$(CXX) $< main92.so -o $@ -w -I$(ROOT_INCLUDE) $(CXX_COMMON)\
`$(ROOTBIN)root-config --cflags` -Wl,-rpath,./\
-Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)root-config --glibs`
else
@echo "Error: $@ requires ROOT"
endif
main92.so: main92Dct.cc $(PREFIX_LIB)/libpythia8.a
$(CXX) $< -o $@ -w -I$(ROOT_INCLUDE) $(CXX_SHARED) $(CXX_COMMON)\
`$(ROOTBIN)root-config --cflags`
main92Dct.cc: main92.h main92LinkDef.h
export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(ROOT_LIB);\
$(ROOT_BIN)rootcint -f $@ -c -I$(PREFIX_INCLUDE) $^
# main93 with several dependencies. It is assumed that
# Rivet and YODA are installed to system path or appended to it.
main93: $$@.cc $(PREFIX_LIB)/libpythia8.a main93.so
ifeq ($(ROOT_USE),true)
$(CXX) $< main93.so -o $@ -DUSE_ROOT -DUSE_YODA -std=c++11 -w -I$(ROOT_INCLUDE) $(CXX_COMMON)\
`$(ROOTBIN)root-config --cflags` -Wl,-rpath,./\
-Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)root-config --glibs` -lYODA\
-lHepMC -lRivet $(GZIP_INC) $(GZIP_FLAGS)
else
$(CXX) $< -o $@ -DUSE_YODA -std=c++11 -w $(CXX_COMMON) -lYODA\
-lHepMC -lRivet $(GZIP_INC) $(GZIP_FLAGS)
endif
main93.so: main93Dct.cc $(PREFIX_LIB)/libpythia8.a
ifeq ($(ROOT_USE),true)
$(CXX) $< -o $@ -w -I$(ROOT_INCLUDE) $(CXX_SHARED) $(CXX_COMMON)\
`$(ROOTBIN)root-config --cflags`
else
@echo "Skipping Root shared library"
endif
main93Dct.cc: main93.h main93LinkDef.h
ifeq ($(ROOT_USE),true)
export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(ROOT_LIB);\
$(ROOT_BIN)rootcint -f $@ -c -I$(PREFIX_INCLUDE) $^
else
@echo "Skipping Root dictionary"
endif
and also from .bashrc file
# Root path and libraries:
. $HOME/root/bin/thisroot.sh
export ROOTSYS=$HOME/root
export PATH=$PATH:$ROOTSYS/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
# Pythia 8 path and libraries:
export PYTHIA8=$HOME/Progs/pythia8240
export PYTHIA8DATA=$HOME/Progs/pythia8240/share/Pythia8/xmldoc
export LD_LIBRARY_PATH=$PYTHIA8/lib
I would appreciate your help very much into making these mains work!
Some extra detail I forgot, likely relevant:
-the path root/bin is concatenated with the file needed in this folder e.g.
root/binroot-config --glibs instead of root/bin/root-config
Above I added a “/” to the makefile for main91 after (ROOTBIN), eg
main91: $$@.cc $(PREFIX_LIB)/libpythia8.a
ifeq ($(ROOT_USE),true)
$(CXX) $< -o $@ -w -I$(ROOT_INCLUDE) $(CXX_COMMON)
`$(ROOTBIN)/root-config --cflags`
-Wl,-rpath,$(ROOT_LIB) `$(ROOT_BIN)/root-config --glibs`
and it is printed correct, but still not found.
main92 and main93 have the same problem