Installing ROOT on Mac OS Fatal Error

Hello everyone,

So I am fairly new to programming in ROOT, so I apologise in advance for my lack of understanding.

So far I have followed the guide lines indicated by the ROOT installation procedure Here.

First method (best method thus far)
Step 1: I get the clone of the source file. this part is fine.

Step 2: I download CMake from CMake. It creates a GUI, in the GUI it asks “Where is the source code:” and I direct it to the clone of the source. Then it asks “Where to build the binaries” I create a new folder for these binary files. (I’m assuming this is is the $ mkdir step). I run the GUI and it makes the make files in this new directory.

Step 3: I go into the newly created directory and do
$ make -j4
this runs till about 72% then it stops due too an error. The fatal error occurs at 70%

/opt/local/include/unicode/ucnv.h:52:10: fatal error: 'unicode/ucnv_err.h' file not found
#include "unicode/ucnv_err.h"

Second method (does not get me far)
When I do the steps like

git clone http://root.cern.ch/git/root.git
cd root
git checkout -b v6-04-14 v6-04-14
mkdir <builddir>
cd <builddir>
cmake ../root

This procedure says

-bash: cmake: command not found

after getting this command not found. I tried (because I saw this suggested)

./configure 

this would still give the same command not found.

I am not 100% sure what is happening here. But this laptop is my works. I am running Mojave 10.14. I downloaded the clone of git. If there is anything you can recommend that would be great!

Paul

CMake.org -> Download Latest Release

Ok I see I used cmake 14.4 so I updated to 14.5. After downloading 14.5, I preformed the steps like before in First Method and this gives me this error.

CMake Error at interpreter/llvm/src/tools/clang/tools/driver/CMakeLists.txt:120 (file):
  file failed to open for reading (No such file or directory):

    /Users/user/builddir/interpreter/llvm/src/tools/clang/clang.order

Any ideas?

You seem to be using a really old version of ROOT (6.04). On Mojave, only ROOT 6.14.08 and above will work. ROOT needed to be patched in order to work on newer Mac OS releases. Is there a reason why you are checking out this old tag and not using master?

I solved my issue, and ill try to expand on what I did to solve the problem.
Im using
macOS Mojave 10.14
Xcode 10.1

Problem 1

Typing cmake outputs unknown command

This command does not work because I did not have cmake(14.5) installed. After installing cmake I needed to add an export command to my .bashrc file, to make the cmake command work.

  1. go to cmake and install the newest version of cmake.

  2. Modify .bashrc with the command

  • vi .bashrc (1. insure you are in your home directory. 2 be carful with vi editor, google how to use it)
    insert this code into the .bashrc file.

  • export PATH=$PATH:/Applications/CMake.app/Contents/bin/
    save the .bashrc file.

this should make the command cmake work.

Problem 2

Fatal error installing root after using make -jN

  1. Build v6-16-00 worked. I tried a lot of other ones but it did not work. If build v6-16-00 does not work do the checkout command for other builds this might do the trick.
git clone http://github.com/root-project/root.git
git checkout -b v6-16-00 v6-16-00
  1. I needed to create 2 directories.
cd root
mkdir builddir
mkdir root-install
cd builddir
cmake ../ -DCMAKE_INSTALL_PREFIX=../root-install/
make -j4
make install
source /Users/user/root/root-install/bin/thisroot.sh
root

I think the real reason why it was not working was because the old version of ROOT are not working for Mojave OS x.

Also a last minute note, you can also modify your .bashrc file so when you start a terminal and type root it will start root automatically.

So type
vi .bashrc (again be careful)
and insert
source /Users/user/root/root-install/bin/thisroot.sh

into the .bashrc file. after saving type source .bashrc. You should be able to type root every time in terminal without you having to type source /Users/user/ etc each time.

anyway hope this helps!

Paul

Yes that seemed to be the problem I solved the problem by going to 16.00. I did try to use 14.08 but it still gave me a fatal error. I wrote out my solution below.

Hello everyone,

I am facing the same problem, trying to install ROOT on a freshly set up MacBook Pro.
Using ROOT v-6-16-00 does however not solve the problem for me.

A peculiarity of my setup is that I am using the version of python downloaded through MacPorts where I installed several ML libraries, hence the -DPYTHON_EXECUTABLE flag specified in the cmake command.

At about 72% I get the same error :

‘’’
In file included from /opt/local/include/libxml2/libxml/tree.h:1307:
In file included from /opt/local/include/libxml2/libxml/xmlmemory.h:218:
In file included from /opt/local/include/libxml2/libxml/threads.h:35:
In file included from /opt/local/include/libxml2/libxml/globals.h:18:
In file included from /opt/local/include/libxml2/libxml/parser.h:810:
In file included from /opt/local/include/libxml2/libxml/encoding.h:31:

/opt/local/include/unicode/ucnv.h:52:10: fatal error: ‘unicode/ucnv_err.h’ file
not found
‘’’

Here is a summary of what I did for downloading ROOT:

git clone http://github.com/root-project/root.git
cd root
git checkout -b v6-16-00 v6-16-00
cd ..
mkdir build
cd build
cmake -Dall=ON -Drpath=ON -DPYTHON_EXECUTABLE=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ../root 
make -jN

Searching through the internet, I found this topic: https://trac.macports.org/ticket/58350
If I am correct, it suggests the libxml2 in macports is broken…

I don’t know if I am missing an obvious step in the setup, or if it is due to a broken libxml2 in macports. My question is, how is the easiest way to solve the issue and get a working ROOT?

I would like to avoid too heavy changes to my setup (e.g. change to homebrew, etc…)

Thank you very much in advance!

Marc Huwiler

Config:
Mac OS 10.14.5
XCode 10.2.1
MacPorts 2.5.4
ROOT v6-16-00

You can try installing ROOT also from MacPorts. But in general we cannot support building ROOT with a mix of system software and anaconda, MacPorts, Homebrew, etc. There are many ways to select an incompatible set of packages/libraries, and it’s very hard to debug what’s happening with only an error message.

So the difference I can see, is that I made 2 directories, which are in the root folder.

I did

mkdir builddir
mkdir root-install
cd builddir

Then I cmake into the directory root-install

cmake ../ -DCMAKE_INSTALL_PREFIX=../root-install/

maybe try my method exactly, if it does not work just “make clean” after each attempt.

Paul

A quick and dirty fix is to add a symbolic link in the libxml2 include dir

ln -s /opt/local/include/unicode /opt/local/include/libxml2/

it was suggested in a similar thread about a LLVM compilation fail. It’s not pretty, but it works until the MacPorts package gets fixed.

Cheers,
Valerio