# Installing ROOT on Mac OS Fatal Error

**URL:** <https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365>\
**Category:** Newbie\
**Created:** [June 1, 2019, 10:12am UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365 "2019-06-01T10:12:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulK](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/67e7ee/32.png) [@PaulK](https://root-forum.cern.ch/u/PaulK)\
**Post date:** [June 1, 2019, 10:12am UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/1 "2019-06-01T10:12:58Z")

</div>

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](https://github.com/root-project/root/blob/master/README/INSTALL).

**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](http://cmake.org). 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%

```auto
/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

```auto
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

```auto
-bash: cmake: command not found

```

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

```auto
./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

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 1, 2019, 10:25am UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/2 "2019-06-01T10:25:34Z")

</div>

[CMake.org -\> Download Latest Release](https://cmake.org/download/)

---

<div class="post-metadata">

**Author:** ![PaulK](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/67e7ee/32.png) [@PaulK](https://root-forum.cern.ch/u/PaulK)\
**Post date:** [June 1, 2019, 10:53am UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/3 "2019-06-01T10:53:01Z")

</div>

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.

```auto
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?

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [June 3, 2019, 12:29pm UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/4 "2019-06-03T12:29:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![PaulK](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/67e7ee/32.png) [@PaulK](https://root-forum.cern.ch/u/PaulK)\
**Post date:** [June 3, 2019, 12:55pm UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/5 "2019-06-03T12:55:47Z")

</div>

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.

```auto
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.

```auto
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

---

<div class="post-metadata">

**Author:** ![PaulK](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/67e7ee/32.png) [@PaulK](https://root-forum.cern.ch/u/PaulK)\
**Post date:** [June 3, 2019, 12:57pm UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/6 "2019-06-03T12:57:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mhuwiler](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mhuwiler/32/30636_2.png) [@mhuwiler](https://root-forum.cern.ch/u/mhuwiler)\
**Post date:** [June 7, 2019, 9:11am UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/7 "2019-06-07T09:11:18Z")

</div>

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:

```auto
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](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

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [June 7, 2019, 9:38am UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/8 "2019-06-07T09:38:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PaulK](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/67e7ee/32.png) [@PaulK](https://root-forum.cern.ch/u/PaulK)\
**Post date:** [June 7, 2019, 11:39am UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/9 "2019-06-07T11:39:03Z")

</div>

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

I did

```auto
mkdir builddir
mkdir root-install
cd builddir

```

Then I cmake into the directory root-install

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

```

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

Paul

---

<div class="post-metadata">

**Author:** ![valerio.formato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/valerio.formato/32/12474_2.png) [@valerio.formato](https://root-forum.cern.ch/u/valerio.formato)\
**Post date:** [July 29, 2019, 12:35pm UTC](https://root-forum.cern.ch/t/installing-root-on-mac-os-fatal-error/34365/10 "2019-07-29T12:35:49Z")

</div>

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

```auto
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
