Error installing Root 6 on Mac OS Sierra with Xcode 8

Hi everybody,
i’m trying to install Root 6.06/08 on Mac OS Sierra 10.12 with Xcode 8 and i followed the instructions:

git clone root.cern.ch/git/root.git
cd root
git checkout -b v6-06-08 v6-06-08
./configure macosx64
make

When i type make and i press return i get some lines of code and after a couple of minutes i get:

ld: library not found for -lCore
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libCore.dylib] Error 1

Does someone know how to solve this?

Thanks in advance

Try using “cmake” instead of “configure” (obsolete):

cd .. mkdir root_build cd root_build cmake ../root/ make

root.cern.ch/building-root

Thank you for the reply. I followed this instructions

git clone http://root.cern.ch/git/root.git cd root git tag -l git checkout -b v6-04-02 v6-04-02 cd .. mkdir root_build cd root_build cmake ../root/

And i got

[code][18:56:56 root_build ]> cmake …/root/
– The C compiler identification is unknown
– The CXX compiler identification is AppleClang 8.0.0.8000038
– Check for working C compiler: /usr/local/bin/gcc-4.7
– Check for working C compiler: /usr/local/bin/gcc-4.7 – broken
CMake Error at /opt/local/share/cmake-3.3/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler “/usr/local/bin/gcc-4.7” is not able to compile a simple
test program.

It fails with the following output:

Change Dir: /Users/Nico/root_build/CMakeFiles/CMakeTmp

Run Build Command:"/opt/local/bin/gmake" “cmTC_d888e/fast”

/opt/local/bin/gmake -f CMakeFiles/cmTC_d888e.dir/build.make
CMakeFiles/cmTC_d888e.dir/build

gmake[1]: ingresso nella directory
"/Users/Nico/root_build/CMakeFiles/CMakeTmp"

Building C object CMakeFiles/cmTC_d888e.dir/testCCompiler.c.o

/usr/local/bin/gcc-4.7 -o CMakeFiles/cmTC_d888e.dir/testCCompiler.c.o -c
/Users/Nico/root_build/CMakeFiles/CMakeTmp/testCCompiler.c

CMakeFiles/cmTC_d888e.dir/build.make:65: set di istruzioni per l’obiettivo
"CMakeFiles/cmTC_d888e.dir/testCCompiler.c.o" non riuscito

gmake[1]: *** [CMakeFiles/cmTC_d888e.dir/testCCompiler.c.o] Segmentation
fault: 11

gmake[1]: uscita dalla directory
"/Users/Nico/root_build/CMakeFiles/CMakeTmp"

Makefile:126: set di istruzioni per l’obiettivo “cmTC_d888e/fast” non
riuscito

gmake: *** [cmTC_d888e/fast] Errore 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)

– Configuring incomplete, errors occurred!
See also “/Users/Nico/root_build/CMakeFiles/CMakeOutput.log”.
See also “/Users/Nico/root_build/CMakeFiles/CMakeError.log”. [/code]

It seems you have a too old version of gcc

Is it possible to upgrade to at least gcc 4.9?

I’ve just found a guide to do that, i’ll try, thank you!

Hi everybody,
i installed the latest version of gcc 4.7 and also the last version of gcc 4.9 (do i need a newer version?). When i type

i still get

The C compiler identification is unknown -- The CXX compiler identification is AppleClang 8.0.0.8000038 -- Check for working C compiler: /usr/local/bin/gcc-4.7 -- Check for working C compiler: /usr/local/bin/gcc-4.7 -- broken CMake Error at /opt/local/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "/usr/local/bin/gcc-4.7" is not able to compile a simple test program.

So i think that Root does not know where the directory of my compiler is and it’s still using the old one. Does anybody know how to solve this?

Thank you in advance

gcc 4.9 is fine. Anyway, you have to tell ROOT to use the 4.9 version.

Where did you install it? If you installed 4.9 in /usr/local/bin, try for example to type this before running cmake:

[code]unset CPLUS_INCLUDE_PATH
export PATH=/usr/local/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH

alias gcc=‘gcc-4.9’
alias cc=‘gcc-4.9’
alias g++=‘g+±4.9’
alias c++=‘c+±4.9’[/code]

And / or:

cmake -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-4.9 -DCMAKE_C_COMPILER=/usr/local/bin/gcc-4.9 -DCMAKE_Fortran_COMPILER=/usr/local/bin/gfortran-4.9 ../root

Check these here below, there are some extra options you may need to use:
stackoverflow.com/questions/2897 … a-homebrew
apple.stackexchange.com/question … c-compiler

I read everything and i tried everything (gcc 4.9 was installed in /opt/local/bin), changing all the environment variables, but i’m still getting this

[code][17:39:12 root_build ]> cmake …/root
– The C compiler identification is unknown
– The CXX compiler identification is GNU 4.9.3
– Check for working C compiler: /usr/local/bin/gcc-4.7
– Check for working C compiler: /usr/local/bin/gcc-4.7 – broken
CMake Error at /opt/local/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler “/usr/local/bin/gcc-4.7” is not able to compile a simple
test program.

It fails with the following output:

Change Dir: /Users/Nico/root_build/CMakeFiles/CMakeTmp

Run Build Command:"/opt/local/bin/gmake" “cmTC_98bb7/fast”

/opt/local/bin/gmake -f CMakeFiles/cmTC_98bb7.dir/build.make
CMakeFiles/cmTC_98bb7.dir/build

gmake[1]: ingresso nella directory
"/Users/Nico/root_build/CMakeFiles/CMakeTmp"

Building C object CMakeFiles/cmTC_98bb7.dir/testCCompiler.c.o

/usr/local/bin/gcc-4.7 -o CMakeFiles/cmTC_98bb7.dir/testCCompiler.c.o -c
/Users/Nico/root_build/CMakeFiles/CMakeTmp/testCCompiler.c

CMakeFiles/cmTC_98bb7.dir/build.make:65: set di istruzioni per l’obiettivo
"CMakeFiles/cmTC_98bb7.dir/testCCompiler.c.o" non riuscito

gmake[1]: *** [CMakeFiles/cmTC_98bb7.dir/testCCompiler.c.o] Segmentation
fault: 11

gmake[1]: uscita dalla directory
"/Users/Nico/root_build/CMakeFiles/CMakeTmp"

Makefile:126: set di istruzioni per l’obiettivo “cmTC_98bb7/fast” non
riuscito

gmake: *** [cmTC_98bb7/fast] Errore 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)

– Configuring incomplete, errors occurred!
See also “/Users/Nico/root_build/CMakeFiles/CMakeOutput.log”.
See also “/Users/Nico/root_build/CMakeFiles/CMakeError.log”.
[17:39:23 root_build ]> [/code]

I really don’t know how to solve this :frowning:

Don’t worry, we are getting closer.

Now, it has identified that your C++ compiler is 4.9. Still, the C compiler is still 4.7. To solve this, instead of doing cmake …/root, enter the following:

cmake -DCMAKE_CXX_COMPILER=/opt/local/bin/g++-4.9 -DCMAKE_C_COMPILER=/opt/local/bin/gcc-4.9 -DCMAKE_Fortran_COMPILER=/opt/local/bin/gfortran-4.9 ../root

If it does not work, try to type this before:

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE
export LD_LIBRARY_PATH=/opt/local/lib/ (or lib64? check it with the file browser)

I typed

(adding -mp- for each compiler because of the MacPorts download) and this solved!!! So the first part (configure) has been completed and now i’m waiting for the make command to reach the end of the process.
Thank you so so so so so so so so so much!!! :smiley: :smiley: :smiley:

You are welcome :wink:

Note that if you have eg. 4 cores you can speedup the make process with

make -j4

Thank you so much!!!

I’m here again :frowning: :frowning: :frowning:

After ~45 mins of processes i got this:

[ 48%] Built target Meta Scanning dependencies of target Unix [ 48%] Building CXX object core/unix/CMakeFiles/Unix.dir/src/TUnixSystem.cxx.o [ 48%] Built target Unix Scanning dependencies of target Macosx [ 48%] Building CXX object core/macosx/CMakeFiles/Macosx.dir/src/CocoaUtils.mm.o cc1objplus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast' make[2]: *** [core/macosx/CMakeFiles/Macosx.dir/src/CocoaUtils.mm.o] Error 1 make[1]: *** [core/macosx/CMakeFiles/Macosx.dir/all] Error 2 make: *** [all] Error 2 [20:32:15 root_build ]>

Do you know how to solve this issue? :frowning:

Thanks again

I am not sure, but there is recent bug fix with Cocoa and Mac, see
root.cern.ch/gitweb/?p=root.git … 54beb7e56b

So, I would remove everything, do “git pull” again and try with the master branch (instead of checkout 6-06-08).

If it still fails, submit a bug report:
root.cern.ch/bugs

I’ll try with this, thanks again!!

I’m sorry, i don’t want to make errors :blush:

I erased everything and i typed

git clone http://root.cern.ch/git/root.git cd root git pull git tag -l

Now what i should do instead of

git checkout -b v6-04-02 v6-04-02 ?

Don’t type anything after “git clone”. The default behaviour is to be on the master branch (the latest version). To check this, just do:

cd root
git status

And it should tell you that you are in the master branch.

In summary:

cd /opt/
git clone http://root.cern.ch/git/root.git root
mkdir root_build
cd root_build

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE
export PATH=/opt/local/bin:$PATH
export LD_LIBRARY_PATH=/opt/local/lib/:$LD_LIBRARY_PATH (or lib64?)

cmake -DCMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-4.9 -DCMAKE_C_COMPILER=/opt/local/bin/gcc-mp-4.9 -DCMAKE_Fortran_COMPILER=/opt/local/bin/gfortran-mp-4.9 ../root
make -j4

Yes, you’re right, i got it:

[12:20:54 root ]> git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean [13:27:15 root ]>

I follow what you wrote and i tell you what i get :slight_smile:

It ended with

[ 28%] Built target Meta make: *** [all] Error 2

I think i must submit a bug report :frowning: :frowning: :frowning:
But i have no permissions #-o

I was looking at this:

[15:02:42 root_build ]> sudo cmake -DCMAKE_CXX_COMPILER=/opt/local/bin/g++-mp-4.9 -DCMAKE_C_COMPILER=/opt/local/bin/gcc-mp-4.9 -DCMAKE_Fortran_COMPILER=/opt/local/bin/gfortran-mp-4.9 ../root
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /opt/local/bin/gcc-mp-4.9
-- Check for working C compiler: /opt/local/bin/gcc-mp-4.9 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /opt/local/bin/g++-mp-4.9
-- Check for working CXX compiler: /opt/local/bin/g++-mp-4.9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is GNU 4.9.3
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Check for working Fortran compiler: /opt/local/bin/gfortran-mp-4.9
-- Check for working Fortran compiler: /opt/local/bin/gfortran-mp-4.9  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/local/bin/gfortran-mp-4.9 supports Fortran 90
-- Checking whether /opt/local/bin/gfortran-mp-4.9 supports Fortran 90 -- yes
-- Found GCC. Major version 4, minor version 9
-- Performing Test HAS_CXX11
-- Performing Test HAS_CXX11 - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Found a Mac OS X System 10.12
-- Found a 64bit system
-- Found GNU compiler collection
-- ROOT Platform: macosx
-- ROOT Architecture: macosx64
-- Build Type: RelWithDebInfo
-- Compiler Flags:  -m64 -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -pthread -std=c++11 -O2 -g -DNDEBUG
-- Looking for ZLib
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8") 
-- Looking for Unuran
-- Could NOT find UNURAN (missing:  UNURAN_LIBRARY UNURAN_INCLUDE_DIR) 
-- Unuran not found. Switching on builtin_unuran option
-- Building freetype version 2.6.1 included in ROOT itself
-- Looking for PCRE
-- Found PCRE: /opt/local/include  
-- Looking for LZMA
-- Found LZMA includes at /opt/local/include
-- Found LZMA library at /usr/lib/liblzma.dylib
-- Could NOT find GIF (missing:  GIF_LIBRARY GIF_INCLUDE_DIR) 
-- Found TIFF: /opt/local/lib/libtiff.dylib (found version "4.0.6") 
-- Found PNG: /opt/local/lib/libpng.dylib (found version "1.6.25") 
-- Found JPEG: /opt/local/lib/libjpeg.dylib  
-- Building AfterImage library included in ROOT itself
-- Looking for GSL
-- FindGSL: gsl-config not found.
-- GSL not found. Set variable GSL_DIR to point to your GSL installation
--                Alternatively, you can also enable the option 'builtin_gsl' to build the GSL libraries internally'
--                For the time being switching OFF 'mathmore' option
-- Looking for Python
-- Found PythonInterp: /usr/bin/python (found version "2.7.10") 
-- Found Python interpreter version 2.7
-- Found PythonLibs: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib (found version "2.7.10") 
-- Found NumPy: version "1.8.0rc1" /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include
-- Looking for OpenGL
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework  
-- Looking for gl2ps
-- Could NOT find GL2PS (missing:  GL2PS_LIBRARY GL2PS_INCLUDE_DIR) 
-- gl2ps not found. Switching on builtin_gl2ps option
-- Looking for Graphviz
-- Could NOT find GRAPHVIZ (missing:  GRAPHVIZ_INCLUDE_DIR GRAPHVIZ_cdt_LIBRARY GRAPHVIZ_gvc_LIBRARY GRAPHVIZ_graph_LIBRARY GRAPHVIZ_pathplan_LIBRARY) 
-- Graphviz not found. Switching off gviz option
-- Looking for Bonjour
-- Checking whether Bonjour/Avahi is supported
-- Looking for Kerberos 5
-- Found KRB5: /usr/lib/libkrb5.dylib  
-- Looking for LibXml2
-- Found LibXml2: /opt/local/lib/libxml2.dylib (found version "2.9.4") 
-- Looking for OpenSSL
-- Found OpenSSL: /opt/local/lib/libssl.dylib;/opt/local/lib/libcrypto.dylib (found version "1.0.2j") 
-- Looking for Castor
-- Could NOT find CASTOR (missing:  CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR) 
-- Castor not found. Switching off castor option
-- Looking for RFIO
-- Could NOT find CASTOR (missing:  CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR) 
-- Castor or DPM not found. Switching off rfio option
-- Looking for MySQL
-- Could NOT find MYSQL (missing:  MYSQL_INCLUDE_DIR MYSQL_LIBRARIES) 
-- MySQL not found. Switching off mysql option
-- Looking for Oracle
-- Oracle not found.
-- Oracle: You can specify includes: -DORACLE_PATH_INCLUDES=/usr/include/oracle/10.2.0.3/client
--    currently found includes: 
-- Oracle: You can specify libs: -DORACLE_PATH_LIB=/usr/lib/oracle/10.2.0.3/client/lib
--    currently found libs: ORACLE_LIBRARY_OCCI-NOTFOUND;ORACLE_LIBRARY_CLNTSH-NOTFOUND;ORACLE_LIBRARY_LNNZ-NOTFOUND
-- Oracle not found. Switching off oracle option
-- Looking for ODBC
-- Could NOT find ODBC (missing:  ODBC_INCLUDE_DIR) 
-- ODBC not found. Switching off odbc option
-- Looking for PostgreSQL
-- Found PostgreSQL: /usr/local/include  
-- Looking for SQLite
-- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.29.1") 
-- Found Sqlite: /usr/include  
-- Looking for Pythia6
-- Pythia6 not found. Switching off pythia6 option
-- Looking for Pythia8
-- Could NOT find Pythia8 (missing:  PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY) 
-- Pythia8 not found. Switching off pythia8 option
-- Looking for FFTW3
-- FFTW3 not found. Set [environment] variable FFTW_DIR to point to your FFTW3 installation
--                  Alternatively, you can also enable the option 'builtin_fftw3' to build FFTW3 internally'
--                  For the time being switching OFF 'fftw3' option
-- Looking for CFITSIO
-- Could NOT find CFITSIO (missing:  CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY) 
-- CFITSIO not found. You can enable the option 'builtin_cfitsio' to build the library internally'
--                    For the time being switching off 'fitsio' option
-- Support Shadow password not found. Switching off shadowpw option
-- Alien API not found. Set variable ALIEN_DIR to point to your Alien installation
-- For the time being switching OFF 'alien' option
-- Monalisa not found. Set variable MONALISA_DIR to point to your Monalisa installation
-- For the time being switching OFF 'monalisa' option
-- Looking for XROOTD
-- XROOTD not found. Set environment variable XRDSYS to point to your XROOTD installation
--                   Alternatively, you can also enable the option 'builtin_xrootd' to build XROOTD internally
--                   For the time being switching OFF 'xrootd' option
-- Could NOT find GFAL (missing:  GFAL_INCLUDE_DIR SRM_IFCE_INCLUDE_DIR GFAL_LIBRARY) 
-- GFAL library not found. Set variable GFAL_DIR to point to your gfal installation
                      and the variable SRM_IFCE_DIR to the srm_ifce installation
-- For the time being switching OFF 'gfal' option
-- Could NOT find DCAP (missing:  DCAP_INCLUDE_DIR DCAP_LIBRARY) 
-- dCap library not found. Set variable DCAP_DIR to point to your dCache installation
-- For the time being switching OFF 'dcache' option
-- Found LDAP: /usr/include  
-- Could NOT find CHIRP (missing:  CHIRP_INCLUDE_DIR CHIRP_LIBRARY) 
-- chirp library not found. Set variable CHIRP_DIR to point to your chirp installation
-- For the time being switching OFF 'chirp' option
-- Could NOT find HDFS (missing:  HDFS_INCLUDE_DIR HDFS_LIBRARY) 
-- hdfs library not found. Set variable HDFS_DIR to point to your hdfs installation
-- For the time being switching OFF 'hdfs' option
-- Looking for BLAS for optional parts of TMVA
-- Looking for Fortran dgemm
-- Looking for Fortran dgemm - found
-- >>> Option 'glite' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'sapdb' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- >>> Option 'srp' not implemented yet! Signal your urgency to pere.mato@cern.ch
-- Enabled support for:  asimage astiff bonjour builtin_afterimage builtin_ftgl builtin_freetype builtin_gl2ps builtin_glew builtin_unuran builtin_llvm cxx11 cling cocoa exceptions explicitlink fortran genvector krb5 ldap memstat opengl pch pgsql python shared sqlite ssl thread tmva vdt xml
-- The ASM compiler identification is GNU
-- Found assembler: /opt/local/bin/gcc-mp-4.9
-- Found libtool - /opt/local/bin/libtool
-- Target triple: x86_64-apple-darwin16.0.0
-- Native target architecture is X86
-- Threads disabled.
-- Doxygen disabled.
-- Sphinx disabled.
-- Go bindings disabled.
-- Could NOT find OCaml (missing:  OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- Could NOT find OCaml (missing:  OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- OCaml bindings disabled.
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Targeting X86
-- Clang version: 3.9.0
-- Cling version (from VERSION file): ROOT_0.4~dev
-- Cling will look for C++ headers in '/opt/local/include/gcc49/c++/:/opt/local/include/gcc49/c++//x86_64-apple-darwin16:/opt/local/include/gcc49/c++//backward' at runtime.
-- And if not found, will invoke: 'g++-mp-4.9' for them.
-- Performing Test CXX_HAS_Wno_shadow
-- Performing Test CXX_HAS_Wno_shadow - Success
-- Performing Test CXX_HAS_fno_rtti
-- Performing Test CXX_HAS_fno_rtti - Success
-- Performing Test C_HAS_Wno_strict_overflow
-- Performing Test C_HAS_Wno_strict_overflow - Success
-- Performing Test C_HAS_Wno_maybe_uninitialized
-- Performing Test C_HAS_Wno_maybe_uninitialized - Success
-- Performing Test C_HAS_Wno_parentheses_equality
-- Performing Test C_HAS_Wno_parentheses_equality - Success
-- Performing Test CXX_HAS_fno_strict_aliasing
-- Performing Test CXX_HAS_fno_strict_aliasing - Success
-- Performing Test CXX_HAS_Wno_parentheses_equality
-- Performing Test CXX_HAS_Wno_parentheses_equality - Success
-- Performing Test found_setresuid
-- Performing Test found_setresuid - Failed
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Failed
-- Performing Test found_stdexpstringview
-- Performing Test found_stdexpstringview - Failed
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Failed
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Failed
Running /opt/root/build/unix/compiledata.sh
Making include/compiledata.h
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/root_build
[15:04:59 root_build ]> sudo make -j4

Maybe Clang 3.9.0 is too old or maybe the issues come from the failed tests at the end

Could be a good idea to install Root with this?

 sudo port install root 

Can you type “make” instead of “make -j4”? Maybe we can see then a clearer error message.

Clang version should be enough. Did you check this?
root.cern.ch/build-prerequisites

Maybe, it is related to this bug:

And you can try to use a bash shell instead of fish shell?