Madgraph failing to compile; library "c++" not found; gcc error

Asked by Ella Piergrossi

I am using Madgraph 3.5.8 and it is failing to compile when generating even the simplest event (p p > mu+ mu-). I am getting an "Error detected in "generate_events run_01"". The library 'c++' cannot be found and I think it might be an error with the gcc because Apple is using clang version 17.0.0 (clang-1700.0.13.5), but I'm trying to use gcc 14 as that was suggested to me as another possible fix. I tried to uninstall gcc and reinstall gcc 14 (Homebrew) but it seems to still be using clang even though gcc 14 has been installed. I've attached my log as well.

#************************************************************
#* MadGraph5_aMC@NLO/MadEvent *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 3.5.8 2024-03-15 *
#* *
#* The MadGraph5_aMC@NLO Development Team - Find us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadEvent *
#* *
#* run as ./bin/madevent.py filename *
#* *
#************************************************************
generate_events run_01
Traceback (most recent call last):
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/extended_cmd.py", line 1546, in onecmd
    return self.onecmd_orig(line, **opt)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/extended_cmd.py", line 1495, in onecmd_orig
    return func(arg, **opt)
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/madevent_interface.py", line 2402, in do_generate_events
    self.run_generate_events(switch_mode, args)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/common_run_interface.py", line 7784, in new_fct
    original_fct(obj, *args, **opts)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/madevent_interface.py", line 2596, in run_generate_events
    self.exec_cmd('survey %s %s' % (self.run_name,' '.join(args)),
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  postcmd=False)
                  ^^^^^^^^^^^^^^
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/extended_cmd.py", line 1575, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/extended_cmd.py", line 1495, in onecmd_orig
    return func(arg, **opt)
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/madevent_interface.py", line 3419, in do_survey
    self.configure_directory()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/madevent_interface.py", line 6029, in configure_directory
    self.compile(arg=[name], cwd=os.path.join(self.me_dir, 'Source'))
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/interface/extended_cmd.py", line 1641, in compile
    return misc.compile(nb_core=self.options['nb_core'], *args, **opts)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/madgraph/various/misc.py", line 591, in compile
    raise MadGraph5Error(error_text)
madgraph.MadGraph5Error: A compilation Error occurs when trying to compile /Users/elllllla/Downloads/Madgraph/MG5_aMC_v3_5_8/PROC_sm_0/Source.
The compilation fails with the following output message:
    xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

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'm not an expert on this,
did you ever run xcode-select --install?
I guess that even homebrew need to run such command at least once to be able to work on mac.
(But I hear that such command might not be working with recent mac --but to be checked--)

Cheers,

Olivier

Revision history for this message
Ella Piergrossi (ellap2226) said :
#2

I tried running that, but I get this:

xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates

Not sure if that means it won't solve my issue or if there's something further I need to do.

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

Did you check this link:
https://www.google.com/search?client=firefox-b-d&q=+++xcode-select%3A+note%3A+no+developer+tools+were+found+at+%27%2FApplications%2FXcode.app%27%2C+requesting+install.+Choose+an+option+in+the+dialog+to+download+the+command+line+developer+tools.

The first link seems to be identical to yours and suggest to install xcode (which you might have already).
If that does not work, checking the various thread reporting the same error as you will likely help you

Cheers,

Olivier

Can you help with this problem?

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

To post a message you must log in.