Madgraph fails to compile on Mac OS with M1 chip

Asked by Ameir Shaa

Hi MadGraph Team,

I used to be able to run MG5 without any issues on my Mac with the M1 chip. However, now it refuses to compile and spits out errors:

"Error detected in "generate_events run_01"
write debug file /Users/ameirshaa/Downloads/mg5/run2_monopoles_spinhalf/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 /Users/ameirshaa/Downloads/mg5/run2_monopoles_spinhalf/SubProcesses/P1_qq_mmpmmm.
 The compilation fails with the following output message:
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c driver.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c myamp.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c genps.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c unwgt.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c setcuts.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c get_color.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c cuts.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c cluster.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c reweight.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c initcluster.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c addmothers.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c setscales.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c idenparts.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c dummy_fct.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c auto_dsig.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c auto_dsig1.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c auto_dsig2.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c matrix1_orig.f -I../../Source/
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c matrix2_orig.f -I../../Source/
     gfortran -o madevent_forhel driver.o myamp.o genps.o unwgt.o setcuts.o get_color.o cuts.o cluster.o reweight.o initcluster.o addmothers.o setscales.o idenparts.o dummy_fct.o auto_dsig.o auto_dsig1.o auto_dsig2.o matrix1_orig.o matrix2_orig.o -L../../lib/ -ldhelas -ldsample -lmodel -lgeneric -lpdf -lcernlib -lbias -L/opt/homebrew/opt/qt@5/lib
     ld: library not found for -lSystem
     collect2: error: ld returned 1 exit status
     make: *** [madevent_forhel] 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"

I do not understand what the issue could be when it has been running fine all this while. Would you happen to know what these errors mean?

Many thanks in advance for your response.

Many thanks,

Ameir

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
Best Olivier Mattelaer (olivier-mattelaer) said :
#1

I guess this is because you have to setup the include/library path to the correct path for your version of xcode.
xcode-select --install
does it in some case but not always.
Not sure how I fixed that in general actually according to https://hpc.sourceforge.net/
you might want to include dedicated include path/ library path maybe the best solution is to do it via environment variable.
(but I do not know which variable).

Now note that support on M1 chip is quite chaotic for the moment and that I currently not have the full chain working on that chip (since the latest OS) only part are working so far and depending of your goal you might need to change version of python or version of clang or version of gfortran to have the component that you are interested working properly. (so yes it is a mess and you need to like to play with compiler option to have it working on M1)

Cheers,

Olivier

Revision history for this message
Ameir Shaa (ameirshaa) said :
#2

Hi Olivier,

Many thanks for your reply. Worked like a charm! :)

Many thanks,

Ameir

Revision history for this message
Ameir Shaa (ameirshaa) said :
#3

Thanks Olivier Mattelaer, that solved my question.