Cannot access file in python "unsafe use of relative rpath"

The command works for me on Ubuntu 17.04 / ROOT 6.10/06 / python 2.7.13.
So it’s probably a Mac specific issue?

I am not sure. Could it be an issue with the configuration of the machine? Is this the only thing which cannot be done in PyROOT or other things are broken? We might get more insights…

Cheers,
D

Is that stock python? Apple has been trying to “protect” certain binaries it considers important for the OS, python among them (several shell utilities are written in python, for example). If yes, I’d recommend installing python from one of the Mac distros (MacPorts, Homebrew, etc.), which don’t suffer from the same (and also are kept much better up to date).

(I also remember that there were fixes for this rpath business; must still be around somewhere on this forum if the history was imported.)

Even cp /usr/bin/python ~/bin/ and then calling that might solve it, because it avoids SIP.

I don’t know whether this is the only broken thing, but the commands work fine with files stored locally.

$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
>>> f = TFile.Open('sweighting/weighted/prepped_MC_weighted_ntuple.root')
>>> from ROOT import TTree
>>> t = TTree()
>>> .ls
TFile**		sweighting/weighted/prepped_MC_weighted_ntuple.root	
 TFile*		sweighting/weighted/prepped_MC_weighted_ntuple.root	
  KEY: TTree	B2DsKMuNu;1	B2DsKMuNu
>>> f.GetObject("B2DsKMuNu",t)
>>> t.Draw("D_M")
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1

@wlav I believe this is stock python. When I try to install it with Homebrew:

$ brew install python
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
ice

Warning: python 2.7.14 is already installed

@Axel could you provide some more details?

At least in some earlier version of the Mac protection system one could mkdir ~/bin; cp /usr/bin/python ~/bin/; ~/bin/python and then from ROOT import... as always. Does that help?

@mwilkins: using a local file does not load libNetxNG.so, so there is no reason to expect problems with it there. Also, all other .so’s needed for local open (libIO & friends) are directly linked with libPyROOT and not loaded on-demand afterwards.

@Axel the behavior is the same in this case.

@wlav I did not expect problems. I only tried another command because of @Danilo’s question. When following @Axel’s suggestion though, I noticed

$ cp /usr/bin/py
pydoc             python            python2.7         pythonw
pydoc2.7          python-config     python2.7-config  pythonw2.7

Perhaps this is useful since you asked what version of python I had installed?

Per @Danilo’s question, it’s probably not relevant, but I did run into trouble with iPython not picking up my python path when I installed it. Otherwise, I haven’t yet noticed anything else weird about my python installation.

It’s not so much the version, but a matter of system python v.s. non-system python. Where does your homebrew python live? (I’m only familiar with MacPorts.) Can you make sure it and its libraries are first in PATH and LD_LIBRARY_PATH respectively? (There probably is a setup script for it that needs to be sourced. There is for MacPorts anyway.)

On my mac this is the stock python. The following command will tell you where the python that is being executed lives:

which python
which python2

I believe that by default the system python comes first in the path and may be the reason that the homebrew version is not being evoked. This will list the search paths for binaries:

printenv PATH

This will let you locate all the files named python on the system, one will be the system python and one will be homebrew:

locate */python

This is typically much slower, but may be more exact:

find / -type f -name "python" 2>/dev/null

@ksmith @wlav
I am not sure what the next step should be, but here is the information you requested:

$ which python
/usr/bin/python
$ which python2
/usr/local/bin/python2
$ printenv PATH
/usr/local/opt/ipython@5/bin:/Applications/root_build/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin  
$ locate */python
/Applications/Atom.app/Contents/Resources/app/apm/bin/python-interceptor.sh
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/bin/python-config
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
/Users/michael/bin/python
/usr/bin/python
/usr/bin/python-config
/usr/bin/python2.7
/usr/bin/python2.7-config
/usr/bin/pythonw
/usr/bin/pythonw2.7
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/python
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/python-config
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/python2
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/pythonw
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/pythonw2
/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
/usr/local/Cellar/python/2.7.14/bin/python2
/usr/local/Cellar/python/2.7.14/bin/python2-config
/usr/local/Cellar/python/2.7.14/bin/python2.7
/usr/local/Cellar/python/2.7.14/bin/python2.7-config
/usr/local/Cellar/python/2.7.14/bin/pythonw2
/usr/local/Cellar/python/2.7.14/bin/pythonw2.7
/usr/local/Cellar/python/2.7.14/libexec/bin/python
/usr/local/Cellar/python/2.7.14/libexec/bin/python-config
/usr/local/Cellar/python/2.7.14/libexec/bin/pythonw
/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/bin/python3
/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/bin/python3-config
/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/bin/python3.6
/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config
/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/bin/python3.6m
/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config
/usr/local/Cellar/python3/3.6.3/bin/python3
/usr/local/Cellar/python3/3.6.3/bin/python3-config
/usr/local/Cellar/python3/3.6.3/bin/python3.6
/usr/local/Cellar/python3/3.6.3/bin/python3.6-config
/usr/local/Cellar/python3/3.6.3/bin/python3.6m
/usr/local/Cellar/python3/3.6.3/bin/python3.6m-config
/usr/local/bin/python2
/usr/local/bin/python2-config
/usr/local/bin/python2.7
/usr/local/bin/python2.7-config
/usr/local/bin/python3
/usr/local/bin/python3-config
/usr/local/bin/python3.6
/usr/local/bin/python3.6-config
/usr/local/bin/python3.6m
/usr/local/bin/python3.6m-config
/usr/local/bin/pythonw2
/usr/local/bin/pythonw2.7

Try repeating the steps that created the issue, but use the command python2 instead of python. It looks as though this is the version installed by homebrew.

Alas, no, that’s worse:

$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

I tried a few times to uninstall (via both brew uninstall and by just trying to remove directories) and reinstall (via homebrew) python but no luck. In case you’re interested:

$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
$ brew uninstall python
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.14
because it is required by ipython@5 5.5.0_1, which is currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies python
$ brew uninstall ipython
Error: No such keg: /usr/local/Cellar/ipython
$ pip uninstall ipython
Cannot uninstall requirement ipython, not installed
$ brew uninstall python2
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.14
because it is required by ipython@5 5.5.0_1, which is currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies python2
$ brew uninstall --ignore-dependencies python2
Uninstalling /usr/local/Cellar/python/2.7.14... (3,555 files, 49MB)
$ brew install python
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
baresip             ffmpeg              mpv                 rpm
bento4              folly               nsq                 simgrid
cargo-completion    fzf                 passenger           xmrig
citus               hugo                pony-stable
cookiecutter        jenkins             primesieve
derby               libextractor        qcli

==> Downloading https://homebrew.bintray.com/bottles/python-2.7.14.high_sierra.b
Already downloaded: /Users/michael/Library/Caches/Homebrew/python-2.7.14.high_sierra.bottle.tar.gz
==> Pouring python-2.7.14.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> Caveats
This formula installs a python2 executable to /usr/local/bin.
If you wish to have this formula's python executable in your PATH then add
the following to ~/.bash_profile:
  export PATH="/usr/local/opt/python/libexec/bin:$PATH"

Pip and setuptools have been installed. To update them
  pip2 install --upgrade pip setuptools

You can install Python packages with
  pip2 install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python.html
==> Summary
🍺  /usr/local/Cellar/python/2.7.14: 3,517 files, 48.4MB
$ pip2 install --upgrade pip setuptools
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
Collecting setuptools
  Downloading setuptools-36.6.0-py2.py3-none-any.whl (481kB)
    100% |████████████████████████████████| 481kB 2.0MB/s 
Installing collected packages: setuptools
  Found existing installation: setuptools 36.5.0
    Uninstalling setuptools-36.5.0:
      Successfully uninstalled setuptools-36.5.0
Successfully installed setuptools-36.6.0
$ mm .bash_profile
[1] 59358
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
[1]+  Done                    emacs $var
Abort trap: 6
$ which python
/usr/bin/python
$ which python2
/usr/local/bin/python2
$ which python3
/usr/local/bin/python3
$ rm -r /usr/bin/python
python            python2.7         pythonw           
python-config     python2.7-config  pythonw2.7        
$ rm -r /usr/bin/python*
override rwxr-xr-x  root/wheel restricted,compressed for /usr/bin/python? n
override rwxr-xr-x  root/wheel restricted,compressed for /usr/bin/python-config? n
rm: /usr/bin/python2.7: Operation not permitted
rm: /usr/bin/python2.7-config: Operation not permitted
override rwxr-xr-x  root/wheel restricted,compressed for /usr/bin/pythonw? rm -r /usr/bin/python
rm: /usr/bin/pythonw2.7: Operation not permitted
$ rm -r /usr/bin/python*
override rwxr-xr-x  root/wheel restricted,compressed for /usr/bin/python? yes
rm: /usr/bin/python: Operation not permitted
override rwxr-xr-x  root/wheel restricted,compressed for /usr/bin/python-config? no
rm: /usr/bin/python2.7: Operation not permitted
rm: /usr/bin/python2.7-config: Operation not permitted
override rwxr-xr-x  root/wheel restricted,compressed for /usr/bin/pythonw? no
rm: /usr/bin/pythonw2.7: Operation not permitted
$ 
$ 
$ 
$ rm -r /usr/local/bin/py
pydoc2             python2            python3-config     pythonw2
pydoc2.7           python2-config     python3.6          pythonw2.7
pydoc3             python2.7          python3.6-config   pyvenv
pydoc3.6           python2.7-config   python3.6m         pyvenv-3.6
pygmentize         python3            python3.6m-config  
$ rm -r /usr/local/bin/python2
$ rm -r /usr/local/bin/python3
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Applications/root_build/bin/root-config
$ brew prune
$ brew install python
Warning: python 2.7.14 is already installed
$ python2
-bash: /usr/local/bin/python2: No such file or directory
$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
>>> f = TFile.Open("root://eoslhcb.cern.ch//eos/lhcb/user/m/mwilkins/bfractions_fromGanga/data/Down16/548.100/DVnTuples.root")
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdUtils.2.dylib
  Referenced from: /Applications/root_build/lib/libNetxNG.so
  Reason: unsafe use of relative rpath libXrdUtils.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libNetxNG.so for TNetXNGSystem
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdUtils.2.dylib
  Referenced from: /Applications/root_build/lib/libNetxNG.so
  Reason: unsafe use of relative rpath libXrdUtils.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdUtils.2.dylib
  Referenced from: /Applications/root_build/lib/libNetxNG.so
  Reason: unsafe use of relative rpath libXrdUtils.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libNetxNG.so for TNetXNGFile
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdUtils.2.dylib
  Referenced from: /Applications/root_build/lib/libNetxNG.so
  Reason: unsafe use of relative rpath libXrdUtils.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
>>> ^D
$ brew uninstall python
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.14
because it is required by ipython@5 5.5.0_1, which is currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies python
$ brew uninstall --ignore-dependenies python
Error: Refusing to uninstall /usr/local/Cellar/python/2.7.14
because it is required by ipython@5 5.5.0_1, which is currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies python
$ brew uninstall --ignore-dependencies python
Uninstalling /usr/local/Cellar/python/2.7.14... (3,564 files, 49.2MB)
$ brew uninstall --ignore-dependencies python
Error: No such keg: /usr/local/Cellar/python
$ which python
/usr/bin/python
$ rm -r /usr/bin/python
override rwxr-xr-x  root/wheel restricted,compressed for /usr/bin/python? yes
rm: /usr/bin/python: Operation not permitted
$ rm -r /usr/bin/python
override rwxr-xr-x  root/wheel restricted,compressed for /usr/bin/python? y
rm: /usr/bin/python: Operation not permitted
$ which python
/usr/bin/python
$ brew install python2
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.14.high_sierra.b
Already downloaded: /Users/michael/Library/Caches/Homebrew/python-2.7.14.high_sierra.bottle.tar.gz
==> Pouring python-2.7.14.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg instal
==> Caveats
This formula installs a python2 executable to /usr/local/bin.
If you wish to have this formula's python executable in your PATH then add
the following to ~/.bash_profile:
  export PATH="/usr/local/opt/python/libexec/bin:$PATH"

Pip and setuptools have been installed. To update them
  pip2 install --upgrade pip setuptools

You can install Python packages with
  pip2 install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python.html
==> Summary
🍺  /usr/local/Cellar/python/2.7.14: 3,517 files, 48.4MB
$ pip2 install --upgrade pip setuptools
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
Collecting setuptools
  Using cached setuptools-36.6.0-py2.py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 36.5.0
    Uninstalling setuptools-36.5.0:
      Successfully uninstalled setuptools-36.5.0
Successfully installed setuptools-36.6.0
$ python2
Python 2.7.14 (default, Sep 25 2017, 09:54:19) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
$ 

Okay so I found on this thread that python quitting is due to conflicting python versions. The same thread recommends sticking with the system build though.

I think this is a legitimate bug related to Apple’s introduction of System Integrity Protection. I was able to fix it using install_name_tool. Unfortunately, there were several such links so it needed to be done multiple times; there’s a suggestion here for doing it automatically, but I just did it manually:

$ install_name_tool -change libXrdUtils.2.dylib /Applications/root_build/lib/libXrdUtils.2.dylib /Applications/root_build/lib/libNetxNG.so
$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
>>> f = TFile.Open("root://eoslhcb.cern.ch//eos/lhcb/user/m/mwilkins/bfractions_fromGanga/data/Down16/548.100/DVnTuples.root")
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdCl.2.dylib
  Referenced from: /Applications/root_build/lib/libNetxNG.so
  Reason: unsafe use of relative rpath libXrdCl.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libNetxNG.so for TNetXNGSystem
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdCl.2.dylib
  Referenced from: /Applications/root_build/lib/libNetxNG.so
  Reason: unsafe use of relative rpath libXrdCl.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdCl.2.dylib
  Referenced from: /Applications/root_build/lib/libNetxNG.so
  Reason: unsafe use of relative rpath libXrdCl.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libNetxNG.so for TNetXNGFile
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdCl.2.dylib
  Referenced from: /Applications/root_build/lib/libNetxNG.so
  Reason: unsafe use of relative rpath libXrdCl.2.dylib in /Applications/root_build/lib/libNetxNG.so with restricted binary
>>> ^D
$ install_name_tool -change libXrdCl.2.dylib /Applications/root_build/lib/libXrdCl.2.dylib /Applications/root_build/lib/libNetxNG.so
$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile ; f = TFile.Open("root://eoslhcb.cern.ch//eos/lhcb/user/m/mwilkins/bfractions_fromGanga/data/Down16/548.100/DVnTuples.root")
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdXml.2.dylib
  Referenced from: /Applications/root_build/lib/libXrdCl.2.dylib
  Reason: unsafe use of relative rpath libXrdXml.2.dylib in /Applications/root_build/lib/libXrdCl.2.dylib with restricted binary
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libNetxNG.so for TNetXNGSystem
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdXml.2.dylib
  Referenced from: /Applications/root_build/lib/libXrdCl.2.dylib
  Reason: unsafe use of relative rpath libXrdXml.2.dylib in /Applications/root_build/lib/libXrdCl.2.dylib with restricted binary
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdXml.2.dylib
  Referenced from: /Applications/root_build/lib/libXrdCl.2.dylib
  Reason: unsafe use of relative rpath libXrdXml.2.dylib in /Applications/root_build/lib/libXrdCl.2.dylib with restricted binary
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libNetxNG.so for TNetXNGFile
cling::DynamicLibraryManager::loadLibrary(): dlopen(/Applications/root_build/lib/libNetxNG.so, 9): Library not loaded: libXrdXml.2.dylib
  Referenced from: /Applications/root_build/lib/libXrdCl.2.dylib
  Reason: unsafe use of relative rpath libXrdXml.2.dylib in /Applications/root_build/lib/libXrdCl.2.dylib with restricted binary
>>> ^D
$ install_name_tool -change libXrdXml.2.dylib /Applications/root_build/lib/libXrdXml.2.dylib /Applications/root_build/lib/libXrdCl.2.dylib
...

etc.

Now I’ve got a new problem:

$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TFile
>>> f = TFile.Open("root://eoslhcb.cern.ch//eos/lhcb/user/m/mwilkins/bfractions_fromGanga/data/Down16/548.100/DVnTuples.root")
Error in <TNetXNGFile::Open>: [FATAL] Auth failed

But it seems unrelated to the original problem in this post, so I will simply start a new thread. Thanks much for taking the time to help, everyone.

By the way, there are WAY too many problems trying to get this installation up and running. I almost regret even trying.

This is the same error message I get from the system python, therefore I assume you build ROOT against the system python and not homebrew. You can check which python you built against with this command:

grep "/python$" root-build-dir/CMakeCache.txt

I am avoiding using the system python and building ROOT against the version provided from macports (the same can be done with homebrew). macports provides a simple method to set there version as the default in the path and I suspect something like that exists for homebrew as well. After that the build of ROOT will use the non system python by default. Alternatively, you can force CMake to use a specific version of python with the following:

cmake root-source -DPYTHON_EXECUTABLE=/usr/local/bin/python

Thanks for the guidance. I don’t see any reason to install python3 or anything other than the system version at this point though. (I need to stick with python2.7 for LHCb compatibility reasons.)

Sorry I didn’t meant to confuse the issue with python3. I was just indicating how to avoid the macOS system version of python 2.7 that has SIP.

So it turns out that this is actually just a symptom of the underlying issue with SIP—Seems the default version of python has system integrity protection that interferes with the ROOT build operating as designed.

True solution here:

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

This is now https://github.com/xrootd/xrootd/issues/959