Root macro compilation fails in O2 environment on macOS Big Sur

Dear Experts,

this week I updated O2, but I ran into an issue (it came up when building clang). This was solved by reinstalling Xcode (version 12.5.1) and command line tools (I’m running on macOS Big Sur 11.2.3). After this, O2 did build without any issues.

However, if I now enter the O2 environment and run a root macro via

root -l -b -q Test_Macro.cc++

I get the following error:

Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/marcel/Test/Test_Macro_cc.so
ld: can´t use -undefined warning or suppress with -twolevel_namespace
clang-11: **error:** linker command failed with exit code 1 (use -v to see invocation)
Error in <ACLiC>: Compilation failed!

This happens with all of my root macros which have worked before. This test macro mentioned above also does nothing else than printing “Hello”.

I tried to install O2 completely from scratch and the installation went through but this didn’t solve the issue.

Do you have any suggestions on what I could try to solve this issue?
Thanks a lot in advance!

Best regards,
Marcel

Hi @mlesch,

This is something we’re fighting with in CI at the moment. Could you try:

$ cd alidist
$ git remote add twilken https://github.com/TimoWilken/alidist
$ git fetch twilken
$ git checkout fix-root-macos

and then rebuild O2, enter the new environment and try your root command again. Does it work then?

Hello Timo,
Thanks a lot for this suggestion! However, when I run

git checkout fix-root-macos

I get the following error

error: pathspec 'fix-root-macos' did not match any file(s) known to git

Do you know how to get around this?

Sorry, I made a mistake. Could you try the git fetch and git checkout again? Now it should work.

Yes, now it worked. Thanks!
I will build O2 now and try to run the root macro, I will inform you as soon as I have news.

Great, thank you!

So, I’m back with great news. I tried a few of my root macros and indeed with the fix you provided they now work again.

Thanks a lot for this!