Rootls could not load cppyy_backend library


ROOT Version: 6.36.04
Platform: macosxarm64
Compiler: clang-1700.3.19.1

I compiled ROOT from source on my MacBook and general it all works ok (both CLING and usage from python). But when I try to run “rootls” in a terminal with a ROOT file I get the following errors:

rootls ../Lecture1/tree2.root

Traceback (most recent call last):

  File "/opt/hep/root/v6-36-04/bin//rootls", line 10, in <module>

    import cmdLineUtils

  File "/opt/hep/root/v6-36-04/lib/cmdLineUtils.py", line 79, in <module>

    import ROOT

  File "/opt/hep/root/v6-36-04/lib/ROOT/\__init_\_.py", line 25, in <module>

    import cppyy

  File "/opt/hep/root/v6-36-04/lib/cppyy/\__init_\_.py", line 88, in <module>

    from .\_cpython_cppyy import \*

  File "/opt/hep/root/v6-36-04/lib/cppyy/\_cpython_cppyy.py", line 24, in <module>

    c = loader.load_cpp_backend()

  File "/opt/hep/root/v6-36-04/lib/cppyy_backend/loader.py", line 100, in load_cpp_backend

    raise RuntimeError("could not load cppyy_backend library, details:\\n%s" %

        '\\n'.join(\['  '+x for x in err\]))

**RuntimeError**: could not load cppyy_backend library, details:

  dlopen(libcppyy_backend.cpython-313-darwin.so, 0x000A): tried: 'libcppyy_backend.cpython-313-darwin.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibcppyy_backend.cpython-313-darwin.so' (no such file), '/opt/homebrew/lib/libcppyy_backend.cpython-313-darwin.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libcppyy_backend.cpython-313-darwin.so' (no such file), '/opt/homebrew/lib/libcppyy_backend.cpython-313-darwin.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libcppyy_backend.cpython-313-darwin.so' (no such file), '/usr/lib/libcppyy_backend.cpython-313-darwin.so' (no such file, not in dyld cache), 'libcppyy_backend.cpython-313-darwin.so' (no such file)

  dlopen(/opt/hep/root/v6-36-04/lib/cppyy_backend/lib/libcppyy_backend.cpython-313-darwin.so, 0x000A): tried: '/opt/hep/root/v6-36-04/lib/cppyy_backend/lib/libcppyy_backend.cpython-313-darwin.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/hep/root/v6-36-04/lib/cppyy_backend/lib/libcppyy_backend.cpython-313-darwin.so' (no such file), '/opt/hep/root/v6-36-04/lib/cppyy_backend/lib/libcppyy_backend.cpython-313-darwin.so' (no such file)

  dlopen(/opt/hep/root/v6-36-04/lib/cppyy_backend/lib/libcppyy_backend.so, 0x000A): tried: '/opt/hep/root/v6-36-04/lib/cppyy_backend/lib/libcppyy_backend.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/hep/root/v6-36-04/lib/cppyy_backend/lib/libcppyy_backend.so' (no such file), '/opt/hep/root/v6-36-04/lib/cppyy_backend/lib/libcppyy_backend.so' (no such file)

  dlopen(libcppyy_backend.so, 0x000A): tried: 'libcppyy_backend.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibcppyy_backend.so' (no such file), '/opt/homebrew/lib/libcppyy_backend.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libcppyy_backend.so' (no such file), '/opt/homebrew/lib/libcppyy_backend.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libcppyy_backend.so' (no such file), '/usr/lib/libcppyy_backend.so' (no such file, not in dyld cache), 'libcppyy_backend.so' (no such file)

I can see this library does exist in my ROOT install:

find /opt/hep/root/v6-36-04/ -name 'libcppyy_backend\*'

/opt/hep/root/v6-36-04/lib/libcppyy_backend.so

and that is in my DYLD_LIBRARY_PATH:

echo $DYLD_LIBRARY_PATH

:/opt/hep/root/v6-36-04/lib

Am I missing that I should do something else in setup for this to work? Or if not what else could be the issue?

I built ROOT with the following cmake setup:

cmake -DCMAKE_INSTALL_PREFIX=/opt/hep/root/v6-36-04  /Users/markhodgkinson/root_src_Sep2025 -GNinja \\

  -DCMAKE_BUILD_TYPE=Release \\

  -DCMAKE_CXX_STANDARD=17 \\

  -Dfail-on-missing=ON \\

  -Dgdml=ON \\

  -Dx11=ON \\

  -Dpyroot=ON \\

  -Ddataframe=ON \\

  -Dmysql=OFF \\

  -Doracle=OFF \\

  -Dpgsql=OFF \\

  -Dsqlite=OFF \\

  -Dpythia6=OFF \\

  -Dpythia8=OFF \\

  -Dfftw3=OFF \\

  -Dbuiltin_cfitsio=ON \\

  -Dbuiltin_xxhash=ON \\

  -Dbuiltin_afterimage=OFF\\

  -Dbuiltin_openssl=OFF \\

  -Dbuiltin_ftgl=ON \\

  -Dbuiltin_glew=ON \\

  -Dbuiltin_gsl=ON \\

  -Dbuiltin_gl2ps=ON \\

  -Dbuiltin_xrootd=ON \\

  -Dgfal=OFF \\

  -Ddavix=ON \\

  -Dbuiltin_vdt=ON \\

  -Dxrootd=OFF \\

  -Dtmva=ON

Cheers,

Mark


Maybe @silverweed has an idea about what can be the issue…

Hello @Mark_C_Hodgkinson,

you may have to set the PYTHONPATH to the same directory for python to find the library. Does this solve the problem?

Hello,

It seems my PYTHONPATH already points there, so that won’t help:

echo $PYTHONPATH

:/opt/hep/root/v6-36-04/lib

Cheers,

Mark

Unfortunately I can’t say much about 6.36 as it’s still using the Python-based rootls, which I’m not very familiar with. All I can say is that this won’t be an issue anymore starting from 6.38 which replaces it with a native version (but that doesn’t solve OP’s problem)…