Root-config: No such file or directory


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) $&lt; -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

Hi,

it looks like something is not configured correctly in your environment. The system is looking for the root-config script in the linux / directory (see bash: /root-config: No such file or directory) which is most likely the wrong place.

Cheers,
D

Thank you for your reply Danilo!
root-config is in the folder $HOME/root/bin/

Is there something I must change in the .bashrc file? ( I posted above what commands relative to ROOT it contains).
Or should I install everything from the beginning?

Hi,

source $HOME/root/bin/thisroot.sh is the easiest.

Cheers,
D

Hello again Danilo.
The terminal output
bash: /root-config: No such file or directory
was because I added a " \ " character trying to fixing the original problem, as I stated above:
bash: /home/ilias/root/binroot-config: No such file or directory

Note how the bin/root-config became binroot-config
I also had already in my .bashrc :
. $HOME/root/bin/thisroot.sh

No progress at all :frowning:

It seems that “${ROOT_BIN}” works, while “${ROOTBIN}” does not.

When you source “thisroot.sh”, there is no need to set “ROOTSYS”, “PATH”, “LD_LIBRARY_PATH”.

BTW. When you post “source code” or “output” here, do remember to enclose them into two lines which contain just three characters ``` (see how your post has been edited above).

Thanks for your advice Wile!
ROOT_BIN and ROOTBIN are as the “default” Makefile of pythia8240/examples was. I tried editing making both ROOT_BIN, and still i get

bash: /home/ilias/root/binroot-config: No such file or directory
bash: /home/ilias/root/binroot-config: No such file or directory

Then I tried changing both to ROOTBIN and it’s ok!
It remains one more problem that i thought it was derived by this, but it is likely independent:

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, `root-config --glibs`
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

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