Error installing Root 6 on Mac OS Sierra with Xcode 8

Hello:

I downloaded the latest version of ROOT, then:

Opened the Xcode project and built from inside. Everything was built smoothly that way.
Using cmake produced lot of failures.

Update:
I reinstalled Xcode using the command line:

then

cmake ../root-6.06.08-source cmake --build . --target intall

And ROOT compiled and runs on macOS Sierra 10.12

This thread was extremely helpful to me, I was having a similar issue to the OP.

I am only posting because there was a slight erratum in the instructions given upthread, the cmake invocation should be:

Rather than

which is a directory that does not actually exist.

No, cmake …/root is correct, assuming that this is the path of the source code and your build directory is /opt/root_build.

cd /opt/
git clone http://root.cern.ch/git/root.git
--> Clones the source code to /opt/root
mkdir root_build
cd root_build
--> You enter the build directory /opt/root_build
cmake ../root
--> You point at where the source code is. Alternatively:
cmake /opt/root

Note that it is recommended that source code and build directory are separated. Thus, you do not call mkdir root_build inside /opt/root/ but in /opt/

Ah, I misunderstood, I thought root_build was intended to be created as a subdirectory of root.

Hi everybody, I apologize for my late reply.
I absolutely needed Root from the beginning of this week, so I used MacPorts and everything went fine.
The instructions given by ferhue are correct, my problem was that I previously installed an old Root version (it was March 2016) and I probably deleted something important for the compiler while erasing this old version.
Thanks a lot for your help and I hope this discussion will be helpful. :slight_smile:

Nice to hear!

Please remember to “mark as solved” (green tick).

Hello Experts,

I think this thread has been marked as solved but I would really appreciate if some can help me in fixing some problems with installing ROOT6 on Max OS Sierra 10.12. I have the following steps:

-- git clone http://root.cern.ch/git/root.git root6_src
-- mkdir root_build
-- cd build_root
-- cmake ../root6_src/ -DCMAKE_INSTALL_PREFIX=/usr/local/root -DPYTHON_EXECUTABLE=/opt/local/bin/python -DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/3.4/Headers -DPYTHON_LIBRARY=/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4.dylib -Droofit=ON -Dtmva=ON -Dminuit2=ON -Dpython=ON -Dcocoa=ON

-- cmake --build . --target install 

[Error Log]
=====================
[ 72%] Generating etc/allDict.cxx.pch
Traceback (most recent call last):
  File "/Users/macbook/SW/root6_src/etc/dictpch/makepch.py", line 21, in <module>
    import subprocess
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py", line 405, in <module>
    import _posixsubprocess
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_posixsubprocess.so, 2): Symbol not found: _PyString_AsString
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_posixsubprocess.so
  Expected in: flat namespace
 in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_posixsubprocess.so
gmake[2]: *** [CMakeFiles/onepcm.dir/build.make:65: etc/allDict.cxx.pch] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:394: CMakeFiles/onepcm.dir/all] Error 2
gmake: *** [Makefile:152: all] Error 2
=====================

By default I am using python3.4, However if one looks at the error it complains or looks for something in python2.7. I would really appreciate if anyone can help me in this regard.

Hello Again,

Sorry for the noise: I just realized that I was not changing the python path from python-2 to python-3. Fixing the PYTHONPATH fixes every thing.

#export PYTHONPATH="/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages"
export PYTHONPATH="/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages"

Hi,

I haven’t tried Brew yet, but I can confirm you that the ROOT installation with MacPorts works fine.