mg5 3.6.3 and python 3.13 :(

Asked by Richard Ruiz

Hi folks,

Is 3.6.3 fully compatible with python3.13? Are there any specific dependencies that have changed w.r.t. python 3.12, e.g., f2py3 version X?

(I updated to Ubuntu 25.04 out of necessity and ... well... madgraph broke.) To clarify, I am running a development version of mg5 (EVA_NLP) that was just re-merged with origin/3.6.3, so my local version *should* be up to date.

PS I am asking here to document the continued struggle between mg5 and python.

best
richard

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Richard Ruiz
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Yes no problem between 3.6.3 and Python3.13 (but loop induced process since this part is not fully python3.12 ready yet)

Maybe more issue with GCC15 tough.

Olivier

Revision history for this message
Richard Ruiz (rruiz) said :
#2

Hi Olivier,

Thanks for following up so quickly. I have 14.2.0, so I should be good here. Any thoughts on resolving the following two issues:

#1

INFO: compile directory
write compile file for card: /home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/HeavyNnlo_h_ww_eNeN_XLO/Cards/param_card.dat
Traceback (most recent call last):
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/HeavyNnlo_h_ww_eNeN_XLO/bin/internal/ufomodel/write_param_card.py", line 180, in <module>
    ParamCardWriter('./param_card.dat', generic=True)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/HeavyNnlo_h_ww_eNeN_XLO/bin/internal/ufomodel/write_param_card.py", line 28, in __init__
    self.write_card(list_of_parameters)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/HeavyNnlo_h_ww_eNeN_XLO/bin/internal/ufomodel/write_param_card.py", line 88, in write_card
    self.write_dep_param_block(lhablock)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/HeavyNnlo_h_ww_eNeN_XLO/bin/internal/ufomodel/write_param_card.py", line 137, in write_dep_param_block
    value = complex(eval(param.value)).real
                    ~~~~^^^^^^^^^^^^^
  File "<string>", line 1, in <module>
NameError: name 'MZ' is not defined

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#2

Traceback (most recent call last):
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/extended_cmd.py", line 1548, in onecmd
    return self.onecmd_orig(line, **opt)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/extended_cmd.py", line 1497, in onecmd_orig
    return func(arg, **opt)
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/madevent_interface.py", line 2406, in do_generate_events
    self.run_generate_events(switch_mode, args)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/common_run_interface.py", line 7893, in new_fct
    scan_over_run_card(original_fct, obj, *args, **opts)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/common_run_interface.py", line 7825, in scan_over_run_card
    return original_fct(obj, *args, **opts)
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/madevent_interface.py", line 2599, in run_generate_events
    self.exec_cmd('survey %s %s' % (self.run_name,' '.join(args)),
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  postcmd=False)
                  ^^^^^^^^^^^^^^
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/extended_cmd.py", line 1577, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/extended_cmd.py", line 1497, in onecmd_orig
    return func(arg, **opt)
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/interface/madevent_interface.py", line 3460, in do_survey
    jobs, P_zero_result = ajobcreator.get_helicity()
                          ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/madgraph/madevent/gen_ximprove.py", line 163, in get_helicity
    nb_channel = max([math.floor(float(d)) for d in lines[-1].split()])
                                 ~~~~~^^^
ValueError: could not convert string to float: '#13'
Command "generate_events run_01" interrupted with error:
ValueError : could not convert string to float: '#13'
Please report this bug on https://bugs.launchpad.net/mg5amcnlo
More information is found in '/home/richard/Scripts/MadGraph/MGaMC_git_3_x_EVA_NLP/HeavyNnlo_h_ww_eNeN_XLO/run_01_tag_1_debug.log'.
Please attach this file to your report.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

Are you sure that you did merge correctly with 3.6.3?

Olivier

Revision history for this message
Richard Ruiz (rruiz) said :
#4

No, but I did a fresh git clone of 3.6.3 and the issue persists. I have several "error" messages printed to the terminal (see below).

I fully believe that this is a library issue, that once I update the right libraries things will work. Which libraries though?

richard

------------------------------------------------------------------------------------------------

#1
Running MG5 in debug mode
/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/madgraph/iolibs/export_cpp.py:82: SyntaxWarning: invalid escape sequence '\w'
  compiler_option_re = re.compile('^#\w')
/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/madgraph/iolibs/helas_call_writers.py:1729: SyntaxWarning: invalid escape sequence '\d'
  findcoupling = re.compile('pars->([-]*[\d\w_]+)\s*,')
/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/madgraph/various/banner.py:3309: SyntaxWarning: invalid escape sequence '\s'
  function_pat = re.compile('^\s+(?:SUBROUTINE|(?:%(type)s)\s+function)\s+([a-zA-Z]\w*)' \
/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/madgraph/iolibs/export_v4.py:4187: SyntaxWarning: invalid escape sequence '\d'
  arg['coup'] = re.sub('coup(\d+)\)s','coup\g<1>)s%(vec\g<1>)s', arg['coup'])
/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/madgraph/iolibs/export_v4.py:4187: SyntaxWarning: invalid escape sequence '\g'
  arg['coup'] = re.sub('coup(\d+)\)s','coup\g<1>)s%(vec\g<1>)s', arg['coup'])
/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/models/import_ufo.py:942: SyntaxWarning: invalid escape sequence '\('
  split = re.split("(%s)\(([\d,\s\-\+]*)\)" % '|'.join(all_color_flag), old_color)
/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/models/import_ufo.py:999: SyntaxWarning: invalid escape sequence '\('
  split = re.split("(%s)\(([\d,\s\-\+]*)\)" % '|'.join(self.all_aloha_obj), lor_orig.structure )
('WARNING: loading of madgraph too slow!!!', 0.5761599540710449)
Note that this is a development version.
This version is intended for development/beta testing and NOT for production.
This version has not been fully tested (if at all) and might have limited user support (if at all)

-------------------------------------------------------------------------------------------------------------------

#2
Traceback (most recent call last):
  File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/madgraph/madevent/gen_ximprove.py", line 383, in launch
    [float(s) for s in jobs]
     ~~~~~^^^
ValueError: could not convert string to float: 'At'

-------------------------------------------------------------------------------------------------------------------

#3

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
...
*lots of stuff*
...
File "/home/richard/Scripts/MadGraph/MGaMC_git_3_x_/madgraph/madevent/gen_ximprove.py", line 396, in launch
    raise Exception('Parsing error in gensym: %s' % stdout)
Exception: Parsing error in gensym: At line 250 of file symmetry.f (unit = 6, file = 'stdout')
Fortran runtime error: Missing comma between descriptors
(F3.1$)
     ^

Error termination. Backtrace:
#0 0x78ae34628e16 in ???
#1 0x78ae34629aa1 in ???
#2 0x78ae3462a72c in ???
#3 0x78ae348e9fcd in ???
#4 0x78ae348ea75c in ???
#5 0x78ae348eb603 in ???
#6 0x78ae348fe957 in ???
#7 0x5767ab54b427 in ???
#8 0x5767ab54c22f in ???
#9 0x5767ab54c282 in ???
#10 0x78ae3422a337 in __libc_start_call_main
 at ../sysdeps/nptl/libc_start_call_main.h:58
#11 0x78ae3422a3fa in __libc_start_main_impl
 at ../csu/libc-start.c:360
#12 0x5767ab54a1e4 in ???
#13 0xffffffffffffffff in ???

Revision history for this message
Richard Ruiz (rruiz) said :
#5

I am particularly confused about the "At line 250 of file symmetry.f" statement. I cannot find anything like this line in .f file.

richard

Revision history for this message
Richard Ruiz (rruiz) said :
#6

alright, progress!

it seems that the problem I am facing involves the compilation of gensym. it compiles but crashes:

$ ./gensym
At line 250 of file symmetry.f (unit = 6, file = 'stdout')
Fortran runtime error: Missing comma between descriptors
(F3.1$)
     ^

Error termination. Backtrace:
#0 0x753896c28e16 in ???
#1 0x753896c29aa1 in ???
#2 0x753896c2a72c in ???
#3 0x753896ee9fcd in ???
#4 0x753896eea75c in ???
#5 0x753896eeb603 in ???
#6 0x753896efe957 in ???
#7 0x639d8bed25e8 in ???
#8 0x639d8bed3425 in ???
#9 0x639d8bed3478 in ???
#10 0x75389682a337 in __libc_start_call_main
 at ../sysdeps/nptl/libc_start_call_main.h:58
#11 0x75389682a3fa in __libc_start_main_impl
 at ../csu/libc-start.c:360
#12 0x639d8bed11e4 in ???
#13 0xffffffffffffffff in ???

Revision history for this message
Richard Ruiz (rruiz) said :
#7

got it! this was previously reported and patched back in april, with a june update! :)

I am closing the thread but for reference, this is my setup:

gcc (Ubuntu 14.2.0-19ubuntu2) 14.2.0
Python 3.13.3
6.14.0-061400-generic
Ubuntu 25.04

1. https://answers.launchpad.net/mg5amcnlo/+question/821781
2. https://github.com/mg5amcnlo/mg5amcnlo/commit/7b2cd1313979bf88f6a5d570a46e654be6da0759