Root_v6-30-00 installation issue with Pythia6

Dear ROOT Team,

I am trying to install root version V6-30-00 with Pythia6 library on Fedora33 Machine and I am getting the following error, please help me to fix the issue:

[ 88%] Built target G__GuiHtml
[ 88%] Linking CXX shared library …/…/lib/libEGPythia6.so
Scanning dependencies of target G__Recorder
[ 88%] Building CXX object gui/recorder/CMakeFiles/G__Recorder.dir/G__Recorder.cxx.o
/usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::GenerateEvent()': TPythia6.cxx:(.text+0x75): undefined reference to pyevnt_’
/usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::TPythia6()': TPythia6.cxx:(.text+0x6b8): undefined reference to pythia6_common_address’
/usr/bin/ld: TPythia6.cxx:(.text+0x6c8): undefined reference to pythia6_common_address' /usr/bin/ld: TPythia6.cxx:(.text+0x6d8): undefined reference to pythia6_common_address’
/usr/bin/ld: TPythia6.cxx:(.text+0x6e8): undefined reference to pythia6_common_address' /usr/bin/ld: TPythia6.cxx:(.text+0x6f8): undefined reference to pythia6_common_address’
/usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o:TPythia6.cxx:(.text+0x708): more undefined references to pythia6_common_address' follow /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::OpenFortranFile(int, char*)‘:
TPythia6.cxx:(.text+0xa80): undefined reference to tpythia6_open_fortran_file_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::CloseFortranFile(int)’:
TPythia6.cxx:(.text+0xa9e): undefined reference to tpythia6_close_fortran_file_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyinit(char*, char*, char*, double)‘:
TPythia6.cxx:(.text+0xb03): undefined reference to pyinit_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pycomp(int)’:
TPythia6.cxx:(.text+0xd3e): undefined reference to pycomp_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyedit(int)‘:
TPythia6.cxx:(.text+0xd62): undefined reference to pyedit_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyhepc(int)’:
TPythia6.cxx:(.text+0xdde): undefined reference to pyhepc_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pylist(int)‘:
TPythia6.cxx:(.text+0xdfe): undefined reference to pylist_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyname(int, char*)’:
TPythia6.cxx:(.text+0xe2a): undefined reference to pyname_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyr(int)‘:
TPythia6.cxx:(.text+0xe4e): undefined reference to pyr_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyrget(int, int)’:
TPythia6.cxx:(.text+0xe77): undefined reference to pyrget_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyrset(int, int)‘:
TPythia6.cxx:(.text+0xe97): undefined reference to pyrset_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pystat(int)’:
TPythia6.cxx:(.text+0xeae): undefined reference to pystat_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pytest(int)‘:
TPythia6.cxx:(.text+0xece): undefined reference to pytest_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pytune(int)’:
TPythia6.cxx:(.text+0xeee): undefined reference to pytune_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyupda(int, int)‘:
TPythia6.cxx:(.text+0xf17): undefined reference to pyupda_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pymass(int)’:
TPythia6.cxx:(.text+0xf2e): undefined reference to pymass_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pychge(int)‘:
TPythia6.cxx:(.text+0xf4e): undefined reference to pychge_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Py1ent(int, int, double, double, double)’:
TPythia6.cxx:(.text+0xf95): undefined reference to py1ent_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pydiff()‘:
TPythia6.cxx:(.text+0xd81): undefined reference to pydiff_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyevnt()’:
TPythia6.cxx:(.text+0xd91): undefined reference to pyevnt_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pyexec()‘:
TPythia6.cxx:(.text+0xda1): undefined reference to pyexec_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TPythia6.cxx.o: in function TPythia6::Pygive(char const*)’:
TPythia6.cxx:(.text+0xdc4): undefined reference to pygive_' /usr/bin/ld: CMakeFiles/EGPythia6.dir/src/TMCParticle.cxx.o: in function TMCParticle::GetName() const’:
TMCParticle.cxx:(.text+0xb5): undefined reference to `pyname_’
collect2: error: ld returned 1 exit status
gmake[2]: *** [montecarlo/pythia6/CMakeFiles/EGPythia6.dir/build.make:150: lib/libEGPythia6.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:41373: montecar

Here is my configuration command :
cmake -DCMAKE_INSTALL_PREFIX=/opt/root_install/ /opt/root/ -Dmathmore=ON -Dpythia6=ON -DPYTHIA6_INCLUDE_DIR=/opt/Pythia6/v6_428/inc/ -DPYTHIA6_LIBRARY=/opt/Pythia6/v6_428/lib/ -Dxrootd=OFF -Dwebgui=OFF -Dtmva-pymva=OFF -Dtmva=OFF -Dtmva-cpu=OFF

See for example ROOT with Pythia6 and Pythia8 - #2 by bellenot

Hey, I tried to do make using gfortran since g77 is not supported yet but now found some other issues with the code you recommended. Please let me know if I should try with some other Fortran option.

Apptainer> ls
main.c		 makePythia6.alpha  makePythia6.linuxx8664  makePythia6.macosxicc  makePythia6.win     pythia6416.o		 tarPythia6
main.o		 makePythia6.hpux   makePythia6.macosx	    makePythia6.sgi	   makePythia6.wingcc  pythia6_common_address.c  tpythia6_called_from_cc.F
makePythia6.aix  makePythia6.linux  makePythia6.macosx64    makePythia6.solaris    pythia6416.f        pythia6_common_address.o  tpythia6_called_from_cc.o
Apptainer> vi makePythia6.linux
Apptainer> ./makePythia6.linux
./makePythia6.linux: line 2: g77: command not found
./makePythia6.linux: line 3: g77: command not found
./makePythia6.linux: line 7: g77: command not found
Apptainer> vi makePythia6.linux
Apptainer> ./makePythia6.linux
pythia6416.f:10256:72:

10256 |   100   VINT(J)=VINTSV(J)
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 100 at (1)
pythia6416.f:54209:72:

54209 |          DO 440 J = I, N
      |                                                                        1
Warning: Fortran 2018 deleted feature: Shared DO termination label 440 at (1)
pythia6416.f:54277:72:

54277 |          DO 540 I = LOW, IGH
      |                                                                        1
Warning: Fortran 2018 deleted feature: Shared DO termination label 540 at (1)
pythia6416.f:54502:72:

54502 |   220 SCALE(I) = 1.0D0
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 220 at (1)
pythia6416.f:54708:72:

54708 |   100    SCALE = SCALE + DABS(AR(I,M-1)) + DABS(AI(I,M-1))
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 100 at (1)
/usr/bin/ld: pythia6_common_address.o:(.bss+0x61aa0): multiple definition of `pydat1_'; pythia6416.o:(.data+0x280c0): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0x62d60): multiple definition of `pydat2_'; pythia6416.o:(.data+0x29380): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0x6ca20): multiple definition of `pydat3_'; pythia6416.o:(.data+0x33040): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xb46a0): multiple definition of `pydat4_'; pythia6416.o:(.data+0x7acc0): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xb8520): multiple definition of `pydatr_'; pythia6416.o:(.data+0x7eb40): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xb8860): multiple definition of `pysubs_'; pythia6416.o:(.data+0x9e820): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xb9900): multiple definition of `pypars_'; pythia6416.o:(.data+0x9d560): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xbabc0): multiple definition of `pyint1_'; pythia6416.o:(.bss+0x20): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xbbe80): multiple definition of `pyint2_'; pythia6416.o:(.data+0x7ee80): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xd66c0): multiple definition of `pyint4_'; pythia6416.o:(.data+0x94380): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xe0340): multiple definition of `pyint6_'; pythia6416.o:(.data+0x99980): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xe3a20): multiple definition of `pyint7_'; pythia6416.o:(.bss+0x12e0): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xe4d20): multiple definition of `pymssm_'; pythia6416.o:(.data+0x9d0a0): first defined here
/usr/bin/ld: pythia6_common_address.o:(.bss+0xe5640): multiple definition of `pybins_'; pythia6416.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status

I’m not a Fortran expert, I only knew the recipe… Maybe @couet can help?

It seems some loops are malformed. Loops should be formatted this way:

      DO 10 I=1,10
      ...
 10   CONTINUE

or:

      DO 10 I=1,10
      ...
 10   END DO

or:

      DO I=1,10
      ...
      END DO

So that’s maybe the issue. Try to contact Pythia6 authors for more information how to fix Pythia6 for gfortran

Not sure if this is still relevant, but what has worked for me in the past is to edit makePythia6.linux and replace g77 to gfortran -std=legacy