GenerateDictionary Compilation Issues

Hi all,
I am having issues with running the following code. GenerateDictionary() seems to cause compilation issues on my m1 Macbook air. Any helps appreciated!

const std::string& dic = "vector<vector<UChar_t>>;vector<UChar_t>";
const std::string& CWD = getcwd(NULL, 0);
const std::string& incP = gInterpreter->GetIncludePath();
if (incP.rfind(CWD+"/cpp")!=std::string::npos)  return;
gSystem->mkdir((CWD+"/cpp").c_str());
gSystem->ChangeDirectory((CWD+"/cpp").c_str());
gInterpreter->AddIncludePath((CWD+"/cpp").c_str()); // Needed to find the new dictionaries
gInterpreter->GenerateDictionary(dic.c_str(), "vector");
gSystem->ChangeDirectory(CWD.c_str());

Following is the errors:
In file included from input_line_1:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk/usr/include/c++/v1/new:93: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk/usr/include/c++/v1/cstdlib:135:9: error: no member named 'at_quick_exit' in the global namespace using ::at_quick_exit _LIBCPP_USING_IF_EXISTS; ~~^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk/usr/include/c++/v1/cstdlib:136:9: error: no member named 'quick_exit' in the global namespace using ::quick_exit _LIBCPP_USING_IF_EXISTS;

… fatal error: too many errors emitted, stopping now

ROOT Version: 6.26.06
Platform: MacBook, M1, MacOS 13.4
Compiler: Not Provided


Hi,

Welcome to the ROOT forum, and thanks for your excellent report that makes it very clear what the problem is!

Can we first fix your C++ code? :slight_smile: The three first strings are not references to std::string, they reference a temporary std::string constructed from a const char *. Accessing them through a reference means you access deleted memory, anything can happen - or nothing.

const std::string dic = "vector<vector<UChar_t>>;vector<UChar_t>";
// getcwd allocates memory, must free(). Instead, use:
const std::string CWD = gSystem->pwd();
const std::string incP = gInterpreter->GetIncludePath();
if (incP.rfind(CWD+"/cpp")!=std::string::npos)  return;
gSystem->mkdir((CWD+"/cpp").c_str());
gSystem->ChangeDirectory((CWD+"/cpp").c_str());
gInterpreter->AddIncludePath((CWD+"/cpp").c_str()); // Needed to find the new dictionaries
gInterpreter->GenerateDictionary(dic.c_str(), "vector");
gSystem->ChangeDirectory(CWD.c_str());

The error you see was introduced by a macOS upgrade 13.4 after the release of 6.26/06. I wish you could continue to use the relatively fresh ROOT version on macOS 13.4 but sadly we cannot fix through time-travel :wink: and we will have to prepare a new 6.26 release if you need 6.26. Or can you re-try with 6.28/04? That should work out of the box!

1 Like

Thank you for the detailed response! :grinning:

I am current using the homebrew root and it has not been updated since last year.

I saw there is a pull request in the homebrew root github. Maybe @henryiii can provide more info on when it would be updated?

Thanks for the helps!

Standalone minuit2 was (and still is as far as I know) broken, which means we can’t update the homebrew formula, which requires root and minuit2 versions to match*. I haven’t had time to work on fixing it.

*: Actually, I’m not totally sure you have to, maybe you are just supposed to. I could try updating ROOT only and leaving Minuit stuck on an older version. At a dev summit this week so can’t try quite yet.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.