pyROOT load macro issue


I posted earlier last year (PyROOT LoadMacro problem with shared library) about a similar question regarding loading a C++ macro into a python script. The advice I got was to run the command as,

gROOT-> LoadMacro("Macro.C++")

To force the building of the shared library I recently upgrade to python 3.8 and to root 6.18.04 and from MacOS 10.14 to 10.15. When I tried to run my script in this fashion, with no other changes to env variables, I got the following error:

Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/Code/Macro/
dyld: Library not loaded: @rpath/
  Referenced from: /Users/Code/ROOT/root-6.18.04/bin/rootcling
  Reason: image not found
Error in <ACLiC>: Dictionary generation failed!

I get the same error if I run the command as only “Macro.C+” (a single + sign) but everything seems to run fine as only

gROOT-> LoadMacro("Macro.C")

Is there a reason that the original command above would fail now? Is running without the ‘+’ or ‘++’ okay? I must not fully understand what they are doing.

Thank you,

_ROOT Version: 6.18.04
_Platform: MacOSX 10.15
Compiler: Not Provided

When you update Mac OS X, you need to reinstall ROOT, as the system headers and the compiler change and ROOT depends on them. As usual, Apple also broke a lot of things with Catalina, so I recommend you to download the pre-built nightly binaries, or to build from source using the master branch to get all fixes that were necessary for Catalina. Cheers,

When I upgraded to Catalina, the first thing I did was rebuild root. Which was its own process since Catalina killed off /usr/include and the compilers had no idea where to find header files anymore. There was also other changes between how I built root-6.16.00 on Mojave and that didn’t work with 6.18.04 on Catalina but that’s another post!

For this problem though, I have root 6.18.04 built. ROOT runs just fine, PyROOT runs just fine. The only thing that now no longer works in my codes is the single command:


Where I am asking root to compile the macro and create a shared library. Then it fails with errors in my original post. If I simply ask root to load the macro and drop the ‘++’ then things work. I also change/add-to the macro path so ROOT knows where to find this macro and that works fine, but asking to compile the macro it fails that it can’t find rootcling which doesn’t make sense since its in the PATH. ROOTSYS is being set and all the other environment variables from the file.

Thanks for the help!

Ok, I understand the problem now. If you have the .so file, please paste the output of otool -L here. I suspect it’s a problem with the install_name of the library not being correct.

I am sorry, I don’t have a version of the .so built. I deleted it when things were going wrong thinking it might have been causing problems and hoping to force it to rebuild if it was gone. I have attempted to run this directly in the root interpreter and that fails as well with the same error. I also tried a build of 6.16.00 that I have on my machine as well with no success (just in case).

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