Error detected in "generate_events run_01"

Asked by Shaoqiu Chen

I installed MG5_aMC_v3_5_4 and when I enter "generate p p > mu+ mu-" and "launch" with default setting, I get the following error.

>0
INFO: Update the dependent parameter of the param_card.dat
WARNING: update the strong coupling value (alpha_s) to the value from the pdf selected: 0.13
WARNING: Failed to update dependent parameter. This might create trouble for external program (like MadSpin/shower/...)
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: Compiling for process 1/2.
INFO: P1_qq_ll
Error detected in "generate_events run_01"
write debug file /Users/stevenqiu/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
str : A compilation Error occurs when trying to compile /Users/stevenqiu/PROC_sm_1/SubProcesses/P1_qq_ll.
 The compilation fails with the following output message:
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c symmetry.f -I../../Source/ -I../../Source/PDF/gammaUPC
     gfortran -w -fPIC -O -ffixed-line-length-132 -w -c idenparts.f -I../../Source/ -I../../Source/PDF/gammaUPC
     gfortran -o gensym symmetry.o idenparts.o -L../../lib/ -L../../lib/ -ldhelas -ldsample -lmodel -lgeneric -lpdf -lgammaUPC -lcernlib -lbias -lc++ -mmacosx-version-min=10.8
     ld: library 'c++' not found
     collect2: error: ld returned 1 exit status
     make: *** [gensym] 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:

I do not understand what this error message means or how to fix this error. I find post with similar errors to have different versions and macOS than me so I am not sure if their methods applies in my case. I will really appreciate it if you could help me in solving this error. I plan on doing research on muon collider with madgraph and it hinges on me successfully installing it. Thank you in advance.

FYI:
1) I am on MacOS Sonoma 14.4 with 2 GHz Quad-Core Intel Core i5.

2) when I enter "echo $ROOTSYS" on a new terminal, I get
/usr/local/Cellar/root/6.30.06

3) when I enter "gfortran --version" on a new terminal, I get
GNU Fortran (Homebrew GCC 13.2.0) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

Did you run
xcode-select --install

This is sometimes needed on macos. And is likely to help since you miss some macos library

Cheers,

Olivier

> On 7 May 2024, at 09:50, Shaoqiu Chen <email address hidden> wrote:
>
> New question #812477 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/812477
>
> I installed MG5_aMC_v3_5_4 and when I enter "generate p p > mu+ mu-" and "launch" with default setting, I get the following error.
>
>> 0
> INFO: Update the dependent parameter of the param_card.dat
> WARNING: update the strong coupling value (alpha_s) to the value from the pdf selected: 0.13
> WARNING: Failed to update dependent parameter. This might create trouble for external program (like MadSpin/shower/...)
> 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: Compiling for process 1/2.
> INFO: P1_qq_ll
> Error detected in "generate_events run_01"
> write debug file /Users/stevenqiu/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
> str : A compilation Error occurs when trying to compile /Users/stevenqiu/PROC_sm_1/SubProcesses/P1_qq_ll.
> The compilation fails with the following output message:
> gfortran -w -fPIC -O -ffixed-line-length-132 -w -c symmetry.f -I../../Source/ -I../../Source/PDF/gammaUPC
> gfortran -w -fPIC -O -ffixed-line-length-132 -w -c idenparts.f -I../../Source/ -I../../Source/PDF/gammaUPC
> gfortran -o gensym symmetry.o idenparts.o -L../../lib/ -L../../lib/ -ldhelas -ldsample -lmodel -lgeneric -lpdf -lgammaUPC -lcernlib -lbias -lc++ -mmacosx-version-min=10.8
> ld: library 'c++' not found
> collect2: error: ld returned 1 exit status
> make: *** [gensym] 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:
>
> I do not understand what this error message means or how to fix this error. I find post with similar errors to have different versions and macOS than me so I am not sure if their methods applies in my case. I will really appreciate it if you could help me in solving this error. I plan on doing research on muon collider with madgraph and it hinges on me successfully installing it. Thank you in advance.
>
> FYI:
> 1) I am on MacOS Sonoma 14.4 with 2 GHz Quad-Core Intel Core i5.
>
> 2) when I enter "echo $ROOTSYS" on a new terminal, I get
> /usr/local/Cellar/root/6.30.06
>
> 3) when I enter "gfortran --version" on a new terminal, I get
> GNU Fortran (Homebrew GCC 13.2.0) 13.2.0
> Copyright (C) 2023 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Shaoqiu Chen (shaoqiu) said :
#2

Hi Olivier,

Thank you for your quick response, I ran "xcode-select --install" and it returns the following:

(base) stevenqiu@169-231-166-18 6.30.06 % xcode-select --install
xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates

seems like everything is installed, if some libraries are still missing how should I fix that.

Best regards,
Shaoqiu

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

I have seen in your other thread that you are using conda.

This is likely the root of the issue since they might hide standard path and this would explain that you do not have the standard library available anymore. The question is then how your compiler is setup for compiling C++ code.
Do you use the internal clang of macos? or do you use another clang or GCC?

I have never used conda on mac, so can not really comment on how to have a consistent developper environment with that tool.

Cheers,

Olivier

Revision history for this message
Shaoqiu Chen (shaoqiu) said :
#4

Hi Oliver,

I am not sure which compiler my MG program is trying to use. I usually use gcc for my own C++ code compiling. I believe I have both gcc and clang on my computer. Is there a way to check how my computer is set up to compile the C++ code? Also, if the way my compiler is setup and the utilization of conda is causing issue, how can I change them into something that you can help more with?

(base) stevenqiu@Shaoqius-MacBook-Pro 6.30.06 % clang --version
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

(base) stevenqiu@Shaoqius-MacBook-Pro 6.30.06 % gcc --version
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Best,
Shaoqiu

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

So looks like you do have
1) gfortran from homebrew
2) gcc/clang from xcode/apple
3) some conda environment ...

Does not sounds the perfect environment to have something working.
My suggestion would be to clean completely your environment from conda, but I have no clue on how to do that.
Another suggestion is to check that the following two paths are in your LD_LIDRARY_PATH
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib

Now my recomendation on mac is to use gfortran from:
https://hpc.sourceforge.net/
But homebrew is often use with success (and a bit simpler/clean than the above website)

Cheers,

Olivier

Revision history for this message
Shaoqiu Chen (shaoqiu) said :
#6

Hi Olivier,

Thank you for your reply. I have deleted all the conda lines from my bash_profile, which currently only includes the following lines, as prompted by Mg5.

export ROOTSYS=/usr/local/Cellar/root/6.30.06
export PATH=$PATH:$ROOTSYS/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib

I retried and still got the same following error:

MG5_aMC>install Delphes
Command "install Delphes" interrupted with error:
InvalidCmd : The environment variable ROOTSYS is not configured.
 You can set it by adding the following lines in your .bashrc [.bash_profile for mac]:
 export ROOTSYS=/usr/local/Cellar/root/6.30.06
 export PATH=$PATH:$ROOTSYS/bin
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib
 This will take effect only in a NEW terminal

My question is, do I need to modify the following lines

export ROOTSYS=/usr/local/Cellar/root/6.30.06
export PATH=$PATH:$ROOTSYS/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib

to the actual path to Root on my computer, or should I just add them to the bash_profile unmodified? Sorry I am not used to the bash language and have no idea what $ means here.

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

The line
export ROOTSYS=/usr/local/Cellar/root/6.30.06
needs to be modified to the actual path to your machine
the other line can be kept as they are.

Cheers,

Olivier

Can you help with this problem?

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

To post a message you must log in.