ROOT Version: 5.34.36
Platform: Ubuntu 18.04
Compiler: Not Provided
Hello Everyone,
I am trying to compile my code with the command:
g++ -std=c++11 forWong_main.cpp -o forWong `pythia8-config --cppflags --libs --cxxflags --lhapdf` `root-config --cflags --glibs`
which uses both ROOT and PYTHIA. I have ROOT 5.34.36 and PYTHIA8.180 installed and both of them should be configured in the correct way such that ROOT should have been linked to PYTHIA . However I got the error:
/usr/bin/ld: cannot find -lpythia8-pthread
collect2: error: ld returned 1 exit status
Makefile:4: recipe for target 'main' failed
make: *** [main] Error 1
I have no idea what the library pythia8-pthread is and it’s not in my pythia8 folder, and when I search for pthread, I can only find it under some subfolder of ROOT. I am a bit confused and I tried to reinstall pythia8 but nothing changed.
Then I tried the compilation command without --lhapdf (I wanted to link to lhapdf and I am not sure if I did it correctly or not either )
g++ -std=c++11 forWong_main.cpp -o forWong `pythia8-config --cppflags --libs --cxxflags``root-config --cflags --glibs`
Then I get the following error:
/usr/bin/ld: cannot find -llhapdfdummy-pthread
I am not sure if it’s relevant but I set the following environment variables in my .bashrc file:
export PYTHIA8=/home/killua/pythia/pythia-build
export ROOTSYS=/home/ROOT
export PATH=$ROOTSYS/bin:$PATH
export PATH=${PATH}:/home/killua/pythia/pythia-build/bin
export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$ROOTSYS/bindings/pyroot:$LD$
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/killua/pythia/pythia-build/lib
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/home/killua/pythia/pythia-build/lib
source $HOME/root/bin/thisroot.sh
export PYTHONDIR=$ROOTSYS
export PYTHIA8DATA=/home/killua/pythia/pythia-build/xmldoc
export PATH=${PATH}:/home/killua/pythia/pythia-build/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
Thank you.