gfortran 10 compilation

Asked by yancywww123

I found a bug when compiling some model when gfortran version larger than 10.

I use a 2HDM type I model, and merge it with sm-lepton-mass model to provide tau decay.

This new model works fine with gfortran version 4.8.5

But I met errors when using it in a new PC, with almalinux in which the default gfortran version is 11.4

The following is the Error messgae:

Error detected in "generate_events run_01"
write debug file /home/yancywww/Software/bin/Simulation/MG5_aMC_v3_5_4/bp_z_h1h3/run_01_tag_1_debug.log
If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
str : A compilation Error occurs when trying to compile /home/yancywww/Software/bin/Simulation/MG5_aMC_v3_5_4/bp_z_h1h3/Source.
        The compilation fails with the following output message:
            ar cru ../lib/libdsample.a dsample.o ranmar.o DiscreteSampler.o StringCast.o
            cd MODEL; make
            make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
            make[1]: Entering directory '/home/yancywww/Software/bin/Simulation/MG5_aMC_v3_5_4/bp_z_h1h3/Source/MODEL'
            gfortran -w -fPIC -O -ffixed-line-length-132 -c -o model_functions.o model_functions.f
            model_functions.f:552:14:

              552 | FFCT2=FRHO(S,1)
                  | 1
            Error: Type mismatch in argument ‘s’ at (1); passed COMPLEX(8) to REAL(8)
            model_functions.f:561:14:

              561 | FFCT3=FA1(S,1)
                  | 1
            Error: Type mismatch in argument ‘s’ at (1); passed COMPLEX(8) to REAL(8)
            model_functions.f:570:16:

              570 | FFCT3F1=BRHO(S,1)
                  | 1
            Error: Type mismatch in argument ‘s’ at (1); passed COMPLEX(8) to REAL(8)
            model_functions.f:579:16:

              579 | FFCT3F0=BRHO(S,0)
                  | 1
            Error: Type mismatch in argument ‘s’ at (1); passed COMPLEX(8) to REAL(8)
            make[1]: *** [<builtin>: model_functions.o] Error 1
            make[1]: Leaving directory '/home/yancywww/Software/bin/Simulation/MG5_aMC_v3_5_4/bp_z_h1h3/Source/MODEL'
            make: *** [makefile:59: ../lib/libmodel.a] Error 2
            make: *** Waiting for unfinished jobs....
            ranlib ../lib/libdsample.a

        Please try to fix this compilations issue and retry.
        Help might be found at https://answers.launchpad.net/mg5amcnlo.
        If you think that this is a bug, you can report this at https://bugs.launchpad.net/mg5amcnlo

So I checked the code, and found that it is because in function FRHO(S,1), it need a real argument, but S is decleared as a Complex variable. Actually, there is a switch in the code : S = real(S), but this wouldn't work in new gfortran.

The old gnu compilers only print a warning message and still work and wouldn't stop compilation, but this has been changed in version 10, where it now will give an error and stop compilation.

It can be solved that go to the source code and find the model folder : "Source/MODEL" , and add a new flags in the makefile: -fallow-argument-mismatch, which will turn the errors into warnings. Then MG will go on compiling and work.

This bug seems only happen when merge some old UFO models, I search the forum, it seems no other report such bugs yet.

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

I would say that the issue is likely within the UFO model and not within MG5aMC.
But since I do not know which UFO model you plan to use it is difficult to be sure.
If it is true one should ask to the author of the model if they can update their model
to provide the required/needed information.

If your model is within the FR website, then you can just give me the name of the model and I can take a look.
If not, do you have an html link where the UFO model is available?

Cheers,

Olivier

> On 23 Apr 2024, at 05:00, yancywww123 <email address hidden> wrote:
>
> New question #809276 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/809276
>
> I found a bug when compiling some model when gfortran version larger than 10.
>
> I use a 2HDM type I model, and merge it with sm-lepton-mass model to provide tau decay.
>
> This new model works fine with gfortran version 4.8.5
>
> But I met errors when using it in a new PC, with almalinux in which the default gfortran version is 11.4
>
> The following is the Error messgae:
>
> Error detected in "generate_events run_01"
> write debug file /home/yancywww/Software/bin/Simulation/MG5_aMC_v3_5_4/bp_z_h1h3/run_01_tag_1_debug.log
> If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
> str : A compilation Error occurs when trying to compile /home/yancywww/Software/bin/Simulation/MG5_aMC_v3_5_4/bp_z_h1h3/Source.
> The compilation fails with the following output message:
> ar cru ../lib/libdsample.a dsample.o ranmar.o DiscreteSampler.o StringCast.o
> cd MODEL; make
> make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
> make[1]: Entering directory '/home/yancywww/Software/bin/Simulation/MG5_aMC_v3_5_4/bp_z_h1h3/Source/MODEL'
> gfortran -w -fPIC -O -ffixed-line-length-132 -c -o model_functions.o model_functions.f
> model_functions.f:552:14:
>
> 552 | FFCT2=FRHO(S,1)
> | 1
> Error: Type mismatch in argument ‘s’ at (1); passed COMPLEX(8) to REAL(8)
> model_functions.f:561:14:
>
> 561 | FFCT3=FA1(S,1)
> | 1
> Error: Type mismatch in argument ‘s’ at (1); passed COMPLEX(8) to REAL(8)
> model_functions.f:570:16:
>
> 570 | FFCT3F1=BRHO(S,1)
> | 1
> Error: Type mismatch in argument ‘s’ at (1); passed COMPLEX(8) to REAL(8)
> model_functions.f:579:16:
>
> 579 | FFCT3F0=BRHO(S,0)
> | 1
> Error: Type mismatch in argument ‘s’ at (1); passed COMPLEX(8) to REAL(8)
> make[1]: *** [<builtin>: model_functions.o] Error 1
> make[1]: Leaving directory '/home/yancywww/Software/bin/Simulation/MG5_aMC_v3_5_4/bp_z_h1h3/Source/MODEL'
> make: *** [makefile:59: ../lib/libmodel.a] Error 2
> make: *** Waiting for unfinished jobs....
> ranlib ../lib/libdsample.a
>
> Please try to fix this compilations issue and retry.
> Help might be found at https://answers.launchpad.net/mg5amcnlo.
> If you think that this is a bug, you can report this at https://bugs.launchpad.net/mg5amcnlo
>
> So I checked the code, and found that it is because in function FRHO(S,1), it need a real argument, but S is decleared as a Complex variable. Actually, there is a switch in the code : S = real(S), but this wouldn't work in new gfortran.
>
> The old gnu compilers only print a warning message and still work and wouldn't stop compilation, but this has been changed in version 10, where it now will give an error and stop compilation.
>
> It can be solved that go to the source code and find the model folder : "Source/MODEL" , and add a new flags in the makefile: -fallow-argument-mismatch, which will turn the errors into warnings. Then MG will go on compiling and work.
>
> This bug seems only happen when merge some old UFO models, I search the forum, it seems no other report such bugs yet.
>
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Can you help with this problem?

Provide an answer of your own, or ask yancywww123 for more information if necessary.

To post a message you must log in.