MadGraph 2.7.2 fails to compile source directory on Fedora 32

Asked by Jean-Loup Tastet

MadGraph fails to compile the source directory on Fedora 32. When trying to generate a simple process like p p > mu+ mu-, I get the error message attached below. Everything works fine on Fedora 31.

The error seems to be emitted by the Fortran compiler:
     dsample.f:144:132:

       144 | call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
           | 1
     Error: More actual than formal arguments in procedure call at (1)

There are also some gmake-related warnings.

Versions:
- gfortran: 10.1.1 20200507 (Red Hat 10.1.1-1)
- python2: Python 2.7.18
- gmake: 4.2.1

Let me know if you need any extra information.

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

INFO: Update the dependent parameter of the param_card.dat
Generating 10000 events with run name run_01
survey run_01
INFO: compile directory
compile Source Directory
Error detected in "generate_events run_01"
write debug file /scratch/PROC_sm_1/run_01_tag_1_debug.log
If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
MadGraph5Error : A compilation Error occurs when trying to compile /scratch/PROC_sm_1/Source.
 The compilation fails with the following output message:
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o StringCast.o StringCast.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o ranmar.o ranmar.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o alfas_functions.o alfas_functions.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o transpole.o transpole.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o invarients.o invarients.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o hfill.o hfill.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pawgraphs.o pawgraphs.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o ran1.o ran1.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_events.o rw_events.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_routines.o rw_routines.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o kin_functions.o kin_functions.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o open_file.o open_file.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o basecode.o basecode.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o setrun.o setrun.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o run_printout.o run_printout.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dgauss.o dgauss.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o readgrid.o readgrid.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o getissud.o getissud.f
     cd DHELAS; make
     cd PDF; make
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/scratch/PROC_sm_1/Source/DHELAS'
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/scratch/PROC_sm_1/Source/PDF'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o Ctq6Pdf.o Ctq6Pdf.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o aloha_functions.o aloha_functions.f
     cd MODEL; make
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/scratch/PROC_sm_1/Source/MODEL'
     cd CERNLIB; make
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o couplings.o couplings.f
     cd BIAS/dummy; make
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o DiscreteSampler.o DiscreteSampler.f
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/scratch/PROC_sm_1/Source/CERNLIB'
     make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
     make[1]: Entering directory '/scratch/PROC_sm_1/Source/BIAS/dummy'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dummy.o dummy.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o abend.o abend.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o lha_read.o lha_read.f
     ar cru ../../../lib/libbias.a dummy.o
     ranlib ../../../lib/libbias.a
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dlsqp2.o dlsqp2.f
     make[1]: Leaving directory '/scratch/PROC_sm_1/Source/BIAS/dummy'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdfwrap.o pdfwrap.f
     ar cru ../lib/libgeneric.a alfas_functions.o transpole.o invarients.o hfill.o pawgraphs.o ran1.o rw_events.o rw_routines.o kin_functions.o open_file.o basecode.o setrun.o run_printout.o dgauss.o readgrid.o getissud.o
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o lenocc.o lenocc.f
     ranlib ../lib/libgeneric.a
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o opendata.o opendata.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mtlprt.o mtlprt.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o mtlset.o mtlset.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdf.o pdf.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o PhotonFlux.o PhotonFlux.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o printout.o printout.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o radmul.o radmul.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o pdg2pdf.o pdg2pdf.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o NNPDFDriver.o NNPDFDriver.f
     ar cru ../../lib/libcernlib.a abend.o dlsqp2.o lenocc.o mtlprt.o mtlset.o radmul.o
     ranlib ../../lib/libcernlib.a
     make[1]: Leaving directory '/scratch/PROC_sm_1/Source/CERNLIB'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o rw_para.o rw_para.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o model_functions.o model_functions.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o couplings1.o couplings1.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o couplings2.o couplings2.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV1P0_3.o FFV1P0_3.f
     ar cru ../../lib/libmodel.a couplings.o lha_read.o printout.o rw_para.o model_functions.o couplings1.o couplings2.o
     ranlib ../../lib/libmodel.a
     make[1]: Leaving directory '/scratch/PROC_sm_1/Source/MODEL'
     ar cru ../../lib/libpdf.a Ctq6Pdf.o pdfwrap.o opendata.o pdf.o PhotonFlux.o pdg2pdf.o NNPDFDriver.o
     ranlib ../../lib/libpdf.a
     make[1]: Leaving directory '/scratch/PROC_sm_1/Source/PDF'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV2_3.o FFV2_3.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV1_0.o FFV1_0.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV2_0.o FFV2_0.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV4_0.o FFV4_0.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV3_3.o FFV3_3.f
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o FFV5_3.o FFV5_3.f
     ar cru ../../lib/libdhelas.a aloha_functions.o FFV1P0_3.o FFV2_3.o FFV1_0.o FFV2_0.o FFV4_0.o FFV3_3.o FFV5_3.o
     ranlib ../../lib/libdhelas.a
     make[1]: Leaving directory '/scratch/PROC_sm_1/Source/DHELAS'
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -c -o dsample.o dsample.f
     dsample.f:144:132:

       144 | call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
           | 1
     Error: More actual than formal arguments in procedure call at (1)
     dsample.f:321:132:

       321 | call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
           | 1
     Error: More actual than formal arguments in procedure call at (1)
     make: *** [<builtin>: dsample.o] Error 1

 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
quit
INFO:

Question information

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

Likely an issue related to gfortran10.
Can you downgrade to gfortran9 for the moment?

I will take a look at what can be done to support gfortran10.

Cheers,

Olivier

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

Did you look at this:
https://philbull.wordpress.com/2012/09/07/weird-gfortran-compiler-error-of-the-week/ <https://philbull.wordpress.com/2012/09/07/weird-gfortran-compiler-error-of-the-week/>

looks like a
cd Source; make clean
can solve the isssue...

Cheers,

Olivier

> On 12 May 2020, at 08:18, Olivier Mattelaer <email address hidden> wrote:
>
> Question #690632 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/690632
>
> Olivier Mattelaer posted a new comment:
> Likely an issue related to gfortran10.
> Can you downgrade to gfortran9 for the moment?
>
> I will take a look at what can be done to support gfortran10.
>
> Cheers,
>
> Olivier
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#3

Running `make clean` and `make` again in the Source directory did not help; I keep getting the same error.

I will try to run MadGraph in a virtual machine for the time being. This way it won't be broken by a surprise compiler update :)

Cheers,
Jean-Loup

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

HI,

This patch can fix the issue, but if this is a new restriction of gfortran 10, it might happens that some other compilation error occurs at some other place of the code:

=== modified file 'Template/LO/Source/dsample.f'
--- Template/LO/Source/dsample.f 2020-01-20 14:53:46 +0000
+++ Template/LO/Source/dsample.f 2020-05-12 16:09:17 +0000
@@ -141,7 +141,7 @@
                fx =0d0
                wgt=0d0
             endif
- call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
+ call sample_put_point(wgt,x(1),iter,ipole) !Store result
          endif
          if (wgt .ne. 0d0) kevent=kevent+1
 c
@@ -318,7 +318,7 @@
             endif

             if (nzoom .le. 0) then
- call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
+ call sample_put_point(wgt,x(1),iter,ipole) !Store result
             else
                nzoom = nzoom -1
                ievent=ievent-1

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#5

Hi Oliver,

Indeed, your patch fixes the issue, but another compilation error follows. It seems to be a type mismatch this time:

INFO: Update the dependent parameter of the param_card.dat
Generating 10000 events with run name run_01
survey run_01
INFO: compile directory
compile Source Directory
Using random number seed offset = 21
INFO: Running Survey
Creating Jobs
Working on SubProcesses
INFO: P1_qq_ll
Error detected in "generate_events run_01"
write debug file /scratch/mg/PROC_sm_0/run_01_tag_1_debug.log
If you need help with this issue please contact us on https://answers.launchpad.net/mg5amcnlo
MadGraph5Error : A compilation Error occurs when trying to compile /scratch/mg/PROC_sm_0/SubProcesses/P1_qq_ll.
 The compilation fails with the following output message:
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c driver.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c myamp.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c genps.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c unwgt.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c setcuts.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c get_color.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c cuts.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c cluster.f -I../../Source/
     gfortran -O -w -fbounds-check -fPIC -ffixed-line-length-132 -w -c reweight.f -I../../Source/
     genps.f:867:14:

       226 | call sample_get_x(sjac,x(ndim),ndim,mincfig,0d0,1d0)
           | 2
     ......
       867 | $ 0, -tmin/stot)
           | 1
     Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)).
     make: *** [makefile:60: genps.o] Error 1
     make: *** Waiting for unfinished jobs....
     cuts.f:1397:132:

      1397 | 10 CALL SORTTI (A,INDEX,N)
           | 1
     Error: Type mismatch in argument ‘a’ at (1); passed REAL(4) to INTEGER(4)
     cuts.f:1400:132:

      1400 | 20 CALL SORTTC(A,INDEX,N)
           | 1
     Error: Type mismatch in argument ‘a’ at (1); passed REAL(4) to INTEGER(4)
     make: *** [makefile:60: cuts.o] Error 1

 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
quit
INFO:

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

You can also add in Source/make_opts
the flag "-std-legacy" which allows gfortran10 to not crash on such old way to code.

Since gfortran10 is not stable enough, it is not yet available on clusters neither on development version of easybuild.
I'm trying now a vagrant file of fedora32 to see if I can get gfortan 10 easily like that

Cheers,

Olivier

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#7

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#8

Thanks!

Adding `-std=legacy` to `FFLAGS` solved the compilation issue. Everything works fine now.

Cheers,
Jean-Loup

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

HI,

I have put here all the patches that I had to apply to fix the issue with the crash of GCC10:
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/revision/311

So expect if they still change gcc10 (does not look freeze yet) the next version of the code should be ready.

Cheers,

Olivier

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#10

Hi Oliver,

I can confirm that this patch set works without any issues on my machine.

It seems that GCC 10.1 was released last week (https://gcc.gnu.org/gcc-10/), so I doubt there will be any breaking changes for this release now.

Thanks again for you work!

Cheers,
Jean-Loup

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#11

Hi Oliver,

I noticed another, related issue. When trying to `launch` the NLO simulation, gfortran 10.1 is detected as gfortran 1, resulting in the following error message:

Command "launch" interrupted with error:
aMCatNLOError : In order to be able to run at NLO MadGraph5_aMC@NLO, you need to have gfortran 4.6 or later installed.
 gfortran 1 has been detected
 Note that You can still run all MadEvent run without any problem!

I believe this comes from the following two lines at madgraph/interface/amcatnlo_run_interface.py:176:
        curr_version = misc.get_gfortran_version(compiler)
        if not ''.join(curr_version.split('.')) >= '46':
I think the condition wrongly evaluates to true if the major version number has two digits.

In addition, I also needed to add -std=legacy at vendor/IREGI/src/makefile_ML5_lib:8 (line number is for v2.7.2).

Cheers,
Jean-Loup

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

Those two should be already fixed in the current development version.

Thanks,

Olivier

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#13

Thanks! I'll check it out and report

Jean-Loup

Revision history for this message
Jean-Loup Tastet (jltastet) said :
#14

I can confirm that the NLO works fine with the lp:~mg5core1/mg5amcnlo/2.7.3 branch. Sorry for the noise!

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

Thanks a lot for the check :-)