ROOT macros compilation


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.24.04
Platform: MacOS Monterey
Compiler: gcc 13.0.0


I am still quite new to ROOT and have some general questions as well as a specific one for compiling a ROOT macro. From what I have noticed so far, it doesn’t seem like the macros need to be compiled, i.e. I can make changes to a ROOT macros (let’s call it some_macro.C), and .x some_macro.C would reflect said changes. So, when do I need to compile a macro? And what are the benefits of compiling before execution?

Specifically, I am running a macro that seems to behave like expected when run using .x macro.C, but when I try to compile it using .x macro.C++, I get the following error:

ld: library not found for -lCoreEntitlements
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried to look up -lCoreEntitlements, but nothing usefule shows up on Google. Is this a library from ROOT that I am missing?

Can you post a small example reproducing the problem ? it is strange you do not get this error with an interpreted execution of the macro and you get it when you compile it. It should be the same. The only difference (when you compile a macro) is that you need to specify the #include files like in a normal C/C++ program.

Hi, I think this is an issue with macOS Monterey that was fixed by @Axel in [tclingg] Do not link libCoreEntitlements (macOS 12 error in ACLiC). · root-project/root@191a7aa · GitHub .

Can you try with a ROOT nightly build that contains the fix?

Cheers,
Enrico

Hi,

Thank you for the responses. I am trying to install the latest nightly build by using the conda package method provided at Nightlies - ROOT . However, when I try

conda create -n root-nightly -c https://root.cern/download/conda-nightly/latest -c conda-forge root-nightly

I get the following:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - root-nightly

Current channels:

  - https://root.cern/download/conda-nightly/latest/osx-64
  - https://root.cern/download/conda-nightly/latest/noarch
  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Is there something that I need to do differently?

The problem is that the conda nightlies are not available for macOS, they are linux-only :confused: We should specify this on the website, sorry!

I see! Thank you for clarifying.

The next thing I tried to do was download the tar file, specifically root_v6.25.01.macos-11.6-arm64-clang120.tar.gz, and follow the instructions for pre-compiled binary distribution:

tar -xzvf root_v6.25.01.macos-11.6-arm64-clang120.tar.gz
source root/bin/thisroot.sh

Then, when I try to run root (root -l), I get the following message:

I tried to find a way to run root anyway but could not find anything useful. Is there a workaround for this? Or is there another way to install the nightlies?

We need to sign and “notarify” ROOT’s binaries with ROOT; we have not started that yet. Until then, instead of brower-click-downloading thhe binaries, please copy the URL and use the terminal to download it: curl -L -O https://root.cern/... - that package should happily install.

2 Likes

Hi,

I was able to install root correctly using curl to download. This root version seems to have fixed my original problem with the missing library as well! Thank you everyone for helping.

1 Like