fortran compiler

Asked by Shu-Yuan Guo on 2020-07-04

Hi, I'm running MG(v2.7) on a new Mac, and when I generate a SM process for test, after output it gives me the error information of "no fortran compiler found", but actually I had installed gcc-6 by Homebrew and set alias gfortran='gfortran-6', and I had even test a f90 file on my Mac, it works correctly, so where' the problem, how can I fix it?

I past the error info here, it may help:
import model sm
define p = g u c d s u~ c~ d~ s~
define j = g u c d s u~ c~ d~ s~
define l+ = e+ mu+
define l- = e- mu-
define vl = ve vm vt
define vl~ = ve~ vm~ vt~
generate p p > e+ e-
output exam
Traceback (most recent call last):
  File "/Users/hep/Documents/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1514, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/Users/hep/Documents/MG5_aMC_v2_6_5/madgraph/interface/extended_cmd.py", line 1463, in onecmd_orig
    return func(arg, **opt)
  File "/Users/hep/Documents/MG5_aMC_v2_6_5/madgraph/interface/master_interface.py", line 292, in do_output
    self.cmd.do_output(self, line, *args, **opts)
  File "/Users/hep/Documents/MG5_aMC_v2_6_5/madgraph/interface/madgraph_interface.py", line 7663, in do_output
    self.finalize(nojpeg, flaglist=flaglist)
  File "/Users/hep/Documents/MG5_aMC_v2_6_5/madgraph/interface/madgraph_interface.py", line 7984, in finalize
    flaglist)
  File "/Users/hep/Documents/MG5_aMC_v2_6_5/madgraph/iolibs/export_v4.py", line 5432, in finalize
    super(ProcessExporterFortranMEGroup, self).finalize(*args, **opts)
  File "/Users/hep/Documents/MG5_aMC_v2_6_5/madgraph/iolibs/export_v4.py", line 3884, in finalize
    self.set_compiler(compiler)
  File "/Users/hep/Documents/MG5_aMC_v2_6_5/madgraph/iolibs/export_v4.py", line 1751, in set_fortran_compiler
    raise MadGraph5Error, 'No Fortran Compiler detected! Please install one'
MadGraph5Error: No Fortran Compiler detected! Please install one

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
2020-07-06
Last query:
2020-07-06
Last reply:
2020-07-06

Are you using the latest version? (2.7.3)
This might have been fixed in that version.

Cheers,

Olivier

Shu-Yuan Guo (shyuan007) said : #2

yes, I have tried the latest 2.7.3 version and the problem is still there.

Ok weird,

What is the output of
gfortran -dumpversion
this the method we use to know your gfortran version

Cheers,

Olivier

Shu-Yuan Guo (shyuan007) said : #4

it returns 6.5.0, which is the same as gfortran --version.

Ah I miss read the error. I thought it fails to detect the corrrect version number but actually it fails to find your gfortran executable.

which means either your gfortran is not in your PATH or not excutable.
If you really set an alias (and not a symbolic link) then this will not be supported by MG5aMC.

In principle to make it work with an alias you can edit the file
input/mg5_configuration.txt
and set your fortran compiler to your alias.
I have never tested that but it might work ( but you will see at least a warning that MG5aMC fails to detect that you are using the correct executable)

Cheers,

Olivier

Shu-Yuan Guo (shyuan007) said : #6

it works, thanks for your kindly response, Olivier.

Shu-Yuan Guo (shyuan007) said : #7

Thanks Olivier Mattelaer, that solved my question.