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
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? 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 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!
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.