PyROOT with Anaconda Python 3.6 with ROOT 6.12.04

conda/anaconda is a bad implementation of an even worse idea that on top is full of bugs, so good luck with that.

But fundamentally, you have to understand that you are trying to build ROOT in the anaconda run-time environment, which is not the environment in which anaconda packages themselves were configured and build, so the information needed for proper configuration is not made available by anaconda. Worse, if such configuration is available anywhere on the system, it will be for system packages. That will be silently picked up and used, with virtually zero chance of being correct.

It gets worse if you are tempted to pull in packages from other channels. I’m thinking e.g. of a modern cmake, where anaconda only since a few weeks has a recent version, but conda-forge has had one for quite a while. Problem is, conda-forge and anaconda are not compatible. Gets more worse as you add more channels.

What you have to do is first of all update your Xcode (your compiler is out of date), then a) stick to a pure, vanilla, anaconda environment; b) setup the run-time environment with the build-time dependencies of all packages you care about (i.e. everything that ROOT would pick up from the anaconda build installation of all dependent packages) but only from anaconda, no other channels; and c) install in the build directory, do not relocate, do not switch conda environments (or (re)build ROOT for each).

That actually works. Or at least for a minimal version of ROOT+python with use of all of ROOT’s own builtins enabled. In fact, if you do this within the conda-build environment, disable binary patching, remove a few headers that cling pulls in, and disable use of ncurses by llvm, you can even create a portable conda package out of that!

Or, use a real package manager such as macports, homebrew, fink, or what-have-you. In which case it’s just cmake ../root and you’re off to the races.